|
1 | 1 | package dev.langchain4j.community.model.oracle.oci.genai; |
2 | 2 |
|
3 | | -import com.fasterxml.jackson.annotation.JsonProperty; |
4 | | -import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
5 | 3 | import com.oracle.bmc.generativeaiinference.model.AssistantMessage; |
6 | 4 | import com.oracle.bmc.generativeaiinference.model.ChatContent; |
7 | 5 | import com.oracle.bmc.generativeaiinference.model.FunctionCall; |
|
21 | 19 | import com.oracle.bmc.generativeaiinference.model.ToolDefinition; |
22 | 20 | import com.oracle.bmc.generativeaiinference.model.ToolMessage; |
23 | 21 | import com.oracle.bmc.generativeaiinference.model.UserMessage; |
24 | | -import com.oracle.bmc.http.client.Serializer; |
25 | 22 | import dev.langchain4j.agent.tool.ToolExecutionRequest; |
26 | 23 | import dev.langchain4j.agent.tool.ToolSpecification; |
27 | 24 | import dev.langchain4j.data.image.Image; |
|
34 | 31 | import dev.langchain4j.model.chat.request.ResponseFormat; |
35 | 32 | import dev.langchain4j.model.chat.request.ResponseFormatType; |
36 | 33 | import dev.langchain4j.model.chat.request.json.JsonObjectSchema; |
37 | | -import java.io.IOException; |
38 | 34 | import java.util.ArrayList; |
39 | | -import java.util.HashMap; |
40 | 35 | import java.util.List; |
41 | 36 | import java.util.Map; |
42 | 37 | import java.util.Objects; |
@@ -261,59 +256,6 @@ private ToolDefinition map(ToolSpecification toolSpecification) { |
261 | 256 | .build(); |
262 | 257 | } |
263 | 258 |
|
264 | | - /** |
265 | | - * <pre>{@code |
266 | | - * { |
267 | | - * "type": "function", |
268 | | - * "function": { |
269 | | - * "name": "currentTime", |
270 | | - * "description": "Returns current local time now at provided location.", |
271 | | - * "parameters": { |
272 | | - * "type": "object", |
273 | | - * "properties": { |
274 | | - * "location": { |
275 | | - * "type": "string", |
276 | | - * "description": "The location where the time will be determined." |
277 | | - * } |
278 | | - * }, |
279 | | - * "required": [ |
280 | | - * "location" |
281 | | - * ] |
282 | | - * } |
283 | | - * } |
284 | | - * } |
285 | | - * }</pre> |
286 | | - */ |
287 | | - @JsonPropertyOrder({"type", "properties", "required"}) |
288 | | - static class ToolFunctionParameters { |
289 | | - |
290 | | - @JsonProperty("type") |
291 | | - private String type = "object"; |
292 | | - |
293 | | - @JsonProperty("properties") |
294 | | - private Map<String, Object> properties = new HashMap<>(); |
295 | | - |
296 | | - @JsonProperty("required") |
297 | | - private List<String> required = new ArrayList<>(); |
298 | | - |
299 | | - void addProperty(String key, Object value) { |
300 | | - this.properties.put(key, value); |
301 | | - } |
302 | | - |
303 | | - void addRequired(String required) { |
304 | | - this.required.add(required); |
305 | | - } |
306 | | - |
307 | | - @Override |
308 | | - public String toString() { |
309 | | - try { |
310 | | - return Serializer.getDefault().writeValueAsString(this); |
311 | | - } catch (IOException e) { |
312 | | - throw new RuntimeException(e); |
313 | | - } |
314 | | - } |
315 | | - } |
316 | | - |
317 | 259 | abstract static class Builder<T extends BaseGenericChatModel<T>, B extends Builder<T, B>> |
318 | 260 | extends BaseChatModel.Builder<T, B> { |
319 | 261 |
|
|
0 commit comments