{"id":27027221,"url":"https://github.com/isaiahbjork/assistants-api-python-retrieval","last_synced_at":"2025-04-04T23:17:36.706Z","repository":{"id":209723281,"uuid":"724213193","full_name":"isaiahbjork/assistants-api-python-retrieval","owner":"isaiahbjork","description":"OpenAI Assistants API Retrieval Python Tutorial  ","archived":false,"fork":false,"pushed_at":"2023-11-28T20:26:08.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-11-28T21:51:56.127Z","etag":null,"topics":["gpt-4","gpt4","openai","openai-api","python","python-tutorial"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/watch?v=isB1qKi1oRA\u0026t=1s","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaiahbjork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-27T16:15:05.000Z","updated_at":"2023-11-28T21:52:00.492Z","dependencies_parsed_at":"2023-11-28T22:04:33.819Z","dependency_job_id":null,"html_url":"https://github.com/isaiahbjork/assistants-api-python-retrieval","commit_stats":null,"previous_names":["isaiahbjork/assistants-api-python-retrieval"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaiahbjork%2Fassistants-api-python-retrieval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaiahbjork%2Fassistants-api-python-retrieval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaiahbjork%2Fassistants-api-python-retrieval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaiahbjork%2Fassistants-api-python-retrieval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaiahbjork","download_url":"https://codeload.github.com/isaiahbjork/assistants-api-python-retrieval/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261562,"owners_count":20910109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gpt-4","gpt4","openai","openai-api","python","python-tutorial"],"created_at":"2025-04-04T23:17:36.244Z","updated_at":"2025-04-04T23:17:36.694Z","avatar_url":"https://github.com/isaiahbjork.png","language":"Python","readme":"# OpenAI Assistant API Retrieval Tutorial \n\n[YouTube Tutorial](https://youtu.be/isB1qKi1oRA): Watch the detailed walkthrough of this code and its functionalities.\n\n## Overview\nThis script demonstrates the creation and interaction with a custom OpenAI Retrieval Assistant, specifically designed for \"Bean There Café.\" It showcases how to upload a file, create an assistant, start a thread, send messages, run the assistant, retrieve results, check messages, and modify the assistant.\n\n## Prerequisites\nBefore you begin, ensure you have the following installed:\n- Python 3.8 or later.\n- `openai` Python package.\n- `python-dotenv` package for environment variable management.\n\n## Installation\n1. Clone this repository.\n2. Install the required Python packages:\n   ```bash\n   pip install openai python-dotenv\n   ```\n\n## Setting Up\n1. Create a `.env` file in your project's root directory.\n2. Add your OpenAI API key to the `.env` file:\n   ```\n   OPENAI_API_KEY=your_api_key_here\n   ```\n\n## Usage\nThe script is divided into several steps, each performing a distinct function:\n1. **Upload File**: Uploads a PDF file to be used by the assistant.\n2. **Create Assistant**: Creates a new assistant with specific instructions and tools.\n3. **Create Thread**: Starts a new thread for communication.\n4. **Create Message**: Sends a query to the thread.\n5. **Run the Assistant**: Processes the query using the assistant.\n6. **Retrieve the Run**: Fetches the result of the assistant's processing.\n7. **Check the Messages**: Retrieves and prints all messages in a thread.\n8. **Modify the Assistant**: Updates the assistant with additional capabilities.\n\nTo run the script, execute:\n```python\npython main.py\n```\n\n## Customizing Your Assistant\nYou can customize the assistant by changing the file upload, the instructions, the query, and the tools as per your requirements.\n\n## Prompts\n1. What are the items on the menu?\n2. Could 'Bean There Café' benefit from adopting RFID technology for inventory management, and how would this align with its operational and financial plans?\n3. What's the total monthly revenue supposed to be and the startup cost?\n4. How long will it take us to be profitable at our current monthly revenue if it stays consistent and how long will it take to make back the startup costs?\n\n## Additional Resources\n- [OpenAI API Documentation](https://platform.openai.com/docs/): Provides more in-depth details and advanced features.\n\n## Feedback and Contributions\nYour feedback is valuable! If you have suggestions or modifications, feel free to create an issue or a pull request. For specific queries related to the tutorial, drop a comment on the YouTube video.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaiahbjork%2Fassistants-api-python-retrieval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaiahbjork%2Fassistants-api-python-retrieval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaiahbjork%2Fassistants-api-python-retrieval/lists"}