{"id":18798591,"url":"https://github.com/liteobject/demo-openai-api","last_synced_at":"2026-01-02T02:30:16.088Z","repository":{"id":220445575,"uuid":"751655139","full_name":"LiteObject/demo-openai-api","owner":"LiteObject","description":"Learn OpenAI API","archived":false,"fork":false,"pushed_at":"2024-05-03T21:53:23.000Z","size":36,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-29T18:21:55.489Z","etag":null,"topics":["open-ai","openai","pthon3","python"],"latest_commit_sha":null,"homepage":"","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/LiteObject.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-02T03:15:21.000Z","updated_at":"2024-02-02T04:31:56.000Z","dependencies_parsed_at":"2024-11-07T22:12:34.743Z","dependency_job_id":"e538336b-ef2e-4ce5-b9a7-02e1c714b522","html_url":"https://github.com/LiteObject/demo-openai-api","commit_stats":null,"previous_names":["liteobject/demo-openai-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fdemo-openai-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fdemo-openai-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fdemo-openai-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fdemo-openai-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiteObject","download_url":"https://codeload.github.com/LiteObject/demo-openai-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727055,"owners_count":19687099,"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":["open-ai","openai","pthon3","python"],"created_at":"2024-11-07T22:12:26.471Z","updated_at":"2026-01-02T02:30:16.031Z","avatar_url":"https://github.com/LiteObject.png","language":"Python","readme":"# Demo OpenAI API\n\n## Create a virtual python environment\n- `virtualenv -p python3.11 env_name`\n- `python -m venv env_name`\n\n---\n## Create a file listing all required dependencies of the Python project\n    pip freeze \u003e requirements.txt\n\n## Install dependencies from requirements.txt:\n    pip install -r requirements.txt\n    \n---\n## How to create an assistant/agent\n\n### High Level Components\n```mermaid\nflowchart LR\n\nA(1. Assustant/Agent)\n--\u003e T(2. Thread)\n--\u003e M(3. Message)\n--\u003e R(4. Run)\n\n```\n### Code Example\n```python\n# Create an assitant\nassistant = client.beta.assistants.create(\n    name=\"Math Tutor\",\n    instructions=\"You are a personal math tutor. Write and run code to answer math questions.\",\n    tools=[{\"type\": \"code_interpreter\"}],\n    model=\"gpt-4-1106-preview\",\n)\n\n# Create a thread\nthread = client.beta.threads.create()\n\n# Create a message\nmessage = client.beta.threads.messages.create(\n    thread_id=thread.id,\n    role=\"user\",\n    content=\"I need to solve the equation `3x + 11 = 14`. Can you help me?\",\n)\n\n...\n\n# Finally run\nrun = client.beta.threads.runs.retrieve(thread_id=thread.id, run_id=run.id)\n\n```\n\n\n---\n## References:\n- [OpenAI Assistants API](https://platform.openai.com/docs/assistants/overview)\n- [OpenAI Python Code Examples](https://github.com/openai/openai-python/blob/main/examples)\n- [GPT Guide](https://platform.openai.com/docs/guides/text-generation)\n- [Visit the OpenAI Cookbook for in-depth example API use-cases, as well as code snippets for common tasks.](https://cookbook.openai.com/)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fdemo-openai-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliteobject%2Fdemo-openai-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fdemo-openai-api/lists"}