The OpenAI Chatbot is a powerful tool that leverages OpenAI's GPT-4o model with a Code Interpreter tool to provide detailed and accurate responses to user queries. This app is built using Streamlit and allows users to interact with the chatbot by simply typing their questions. The chatbot processes the input and returns a comprehensive answer, making it an ideal assistant for various tasks.
The app starts by initializing the OpenAI client using the API key stored in the environment variables.
An assistant is created with the instructions to be a helpful assistant and the GPT-4o model with the Code Interpreter tool.
The Streamlit interface is set up with a title and a text input field for user queries.
When the user inputs a query, a thread is created, and the assistant processes the query.
The app checks the status of the query processing. If completed, it displays the result; otherwise, it informs the user that the analysis is in progress.