Skip to content
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

docs: add example of using an assistant with tools #704

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant