-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ChatWithTools provider #167
Conversation
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
6993b75
to
05a9e8b
Compare
@@ -137,6 +138,7 @@ public function translate(?string $fromLanguage, string $toLanguage, string $tex | |||
|
|||
if ($this->openAiAPIService->isUsingOpenAi() || $this->openAiSettingsService->getChatEndpointEnabled()) { | |||
$completion = $this->openAiAPIService->createChatCompletion($this->userId, $adminModel, $prompt, null, null, 1, PHP_INT_MAX); | |||
$completion = $completion['messages']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
summaries will need adjustment too, after edward's PR, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's see who merges first.
Signed-off-by: Julien Veyssier <[email protected]>
…completion choice Signed-off-by: Julien Veyssier <[email protected]>
…, expect a list of JSON object strings as history Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Signed-off-by: Julien Veyssier <[email protected]>
This will be used by the Agency feature which uses the tooling capabilities of LLMs.
This provider can be tested in the assistant because it dynamically generates a form for the task type (we will hide this task type later).
One small issue: We enforce all the input params but we might wanna set the tool_message (The result of tool calls in the last interaction).
If we give a fake/useless value to the OpenAI API, the request fails because the tool_message does not come after a "tool call" message.
To be discussed.
To test this provider, just replace
$toolMessage = $input['tool_message'];
by$toolMessage = null;
in the provider and pass a dummy tool_message value in the form.As all input fields have to be defined, also add at least one message in the "chat history".
You can use that in the "tools" input:
So if you ask for the weather in the city, you should get a tool call as a response. If not, you should get a classic response.