-
-
Notifications
You must be signed in to change notification settings - Fork 253
Open
Description
Hey There,
I am using Version 0.99.11 and probably found a bug or did something totally wrong.
I create the following test-script to verify the effect:
$weatherTool = Tool::as('weather')
->for('Get current weather conditions')
->withStringParameter('city', 'The city to get weather for')
->using(function (string $city): string {
// Your weather API logic here
Log::debug('weather tool called for city: ' . $city);
return "The weather in {$city} is sunny and 72°F.";
});
$pendingRequest = \Prism\Prism\Facades\Prism::text()->using(
provider: Provider::OpenAI,
model: ...,
providerConfig: ...
);
$result = $pendingRequest
->withMessages([new UserMessage('What is the weather like in New York today?')])
->withTools([$weatherTool])
->withToolChoice('weather')
->withMaxSteps(5)
->asText();
dump($result->text);
In this case, the log from the weather tool is printed five times, the result test from the llm is empty. In case I comment out the tool choice, I get the correct answer. This seems to be an issue at least for OpenAI and Gemini.
shinanmhd
Metadata
Metadata
Assignees
Labels
No labels