Skip to content

Conversation

@sixlive
Copy link
Contributor

@sixlive sixlive commented Oct 27, 2024

Description

Closes #21

$weather = Tool::as('weather')
    ->for('useful when you need to search for current weather conditions')
    ->withStringParameter('city', 'The city that you want the weather for')
    ->using(fn (string $city): string => 'The weather will be 75° and sunny');

Prism::text()
    ->withTools([$weather])
    ->withToolChoice(ToolChoice::Auto)
    ->withToolChoice(ToolChoice::Any)
    ->withToolChoice('weather');

@sixlive sixlive self-assigned this Oct 27, 2024
@mrfelipemartins
Copy link

mrfelipemartins commented Oct 28, 2024

It would be nice to able to pass a tool class like ->withToolChoice(SearchTool::class), as described in Defining Complex Tools

@sixlive
Copy link
Contributor Author

sixlive commented Nov 2, 2024

@mrfelipemartins great suggestion! I added support for passing Tool classes as well!

@sixlive sixlive marked this pull request as ready for review November 2, 2024 16:16
@sixlive sixlive merged commit 433e1c6 into main Nov 2, 2024
@sixlive sixlive deleted the tool-choice branch November 2, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Required tools

3 participants