You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+9-24Lines changed: 9 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,53 +1,38 @@
1
-
# OpenAI Assistants API Quickstart
1
+
# OpenAI Assistants API Quickstart with Python, Jinja2, and FastAPI
2
2
3
-
A quick-start template using the OpenAI [Assistants API](https://platform.openai.com/docs/assistants/overview) with [Next.js](https://nextjs.org/docs).
4
-
<br/>
5
-
<br/>
6
-

3
+
A quick-start template using the OpenAI [Assistants API](https://platform.openai.com/docs/assistants/overview) with [Python](https://www.python.org/), [Jinja2](https://jinja.palletsprojects.com/en/3.1.x/), and [FastAPI](https://fastapi.tiangolo.com/).
### 2. Set your [OpenAI API key](https://platform.openai.com/api-keys)
18
15
19
16
```shell
20
-
export OPENAI_API_KEY="sk_..."
17
+
cp .env.example .env
21
18
```
22
19
23
-
(or in `.env.example` and rename it to `.env`).
24
-
25
20
### 3. Install dependencies
26
21
27
22
```shell
28
-
npm install
23
+
uv install -r pyproject.toml
29
24
```
30
25
31
26
### 4. Run
32
27
33
28
```shell
34
-
npm run dev
29
+
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
35
30
```
36
31
37
32
### 5. Navigate to [http://localhost:3000](http://localhost:3000).
38
33
39
-
## Deployment
40
-
41
-
You can deploy this project to Vercel or any other platform that supports Next.js.
42
-
43
-
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fopenai%2Fopenai-assistants-quickstart&env=OPENAI_API_KEY,OPENAI_ASSISTANT_ID&envDescription=API%20Keys%20and%20Instructions&envLink=https%3A%2F%2Fgithub.com%2Fopenai%2Fopenai-assistants-quickstart%2Fblob%2Fmain%2F.env.example)
44
-
45
34
## Overview
46
35
47
-
This project is intended to serve as a template for using the Assistants API in Next.js with [streaming](https://platform.openai.com/docs/assistants/overview/step-4-create-a-run), tool use ([code interpreter](https://platform.openai.com/docs/assistants/tools/code-interpreter) and [file search](https://platform.openai.com/docs/assistants/tools/file-search)), and [function calling](https://platform.openai.com/docs/assistants/tools/function-calling). While there are multiple pages to demonstrate each of these capabilities, they all use the same underlying assistant with all capabilities enabled.
48
-
49
-
The main logic for chat will be found in the `Chat` component in `app/components/chat.tsx`, and the handlers starting with `api/assistants/threads` (found in `api/assistants/threads/...`). Feel free to start your own project and copy some of this logic in! The `Chat` component itself can be copied and used directly, provided you copy the styling from `app/components/chat.module.css` as well.
0 commit comments