Skip to content

Conversation

@scbrubaker02
Copy link

Describe the change
Adds an example of using the assistants API with a custom function as a tool. The assistants API is different enough from the chat/completions API that this seemed worthwhile.

Provide OpenAI documentation link
https://platform.openai.com/docs/api-reference/assistants

Describe your solution
I adapted the example in the completion-with-tool directory in a straightforward way.

Tests
Typical output:

Asking OpenAI 'What is the weather in Boston today?' and providing it a 'get_current_weather()' function... OpenAI called us back wanting to invoke our function 'get_current_weather' with params '{"location":"Boston","unit":"fahrenheit"}' Sending OpenAI our 'get_current_weather()' function's response user: What is the weather in Boston today? assistant: The weather in Boston today is sunny with a temperature of 80 degrees Fahrenheit. 

Additional context
Similar to #639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant