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

Verify assistant api doc 2 #49

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nate-dryer
Copy link

No description provided.

Update `chat/state.py` to use the OpenAI Assistants API and set the model to gpt-4o.

* **Assistant Creation**: Create an assistant using `client.beta.assistants.create` with the model set to "gpt-4o".
* **Thread Creation**: Create a thread using `client.beta.threads.create`.
* **Message Addition**: Add a message to the thread using `client.beta.threads.messages.create`.
* **Run Creation and Streaming**: Create a run and stream the response using `client.beta.threads.runs.stream` with an event handler to process the response.
* **Requirements Update**: Add `openai-assistants>=0.1.0` to `requirements.txt`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/nate-dryer/reflex-chat?shareId=XXXX-XXXX-XXXX-XXXX).
…API call

* **Documentation**: Add a summary of the Assistant API documentation at the top of `chat/state.py`.
* **New Method**: Add a new method `openai_process_question` to handle the OpenAI API call.
* **Error Handling**: Add error handling for the OpenAI API call.
* **QA Class**: Update the `QA` class to include a `timestamp` field.
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