ibek commented on PR #19820:
URL: https://github.com/apache/camel/pull/19820#issuecomment-3496563419
It's now possible to set the openai component like this:
```yaml
- route:
id: route-1145
from:
id: from-1972
uri: timer
parameters:
repeatCount: 1
timerName: timer
steps:
- to:
id: to-1908
uri: openai:chat-completion
parameters:
userMessage: What's the weather in Brno?
tools: resource:classpath:assets/tools.json
- log: "Response: ${body}"
```
tools.json is standard representation of tools in openai api:
```
[
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Weather by city",
"parameters": {
"type": "object",
"properties": { "city": { "type": "string" } },
"required": ["city"]
}
}
}
]
```
The response in this case (requiring a tool call) is list of
ChatCompletionMessageToolCall objects from OpenAI SDK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]