MCPcopy Index your code
hub / github.com/bra1nDump/openai-assistants-starter

github.com/bra1nDump/openai-assistants-starter @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
3 symbols 8 edges 2 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

beta openai example: assistants + threads + runs

  • TypeScript
  • Cloudflare Workers
  • OpenAI node.js SDK

This project includes:

  • VSCode debugging with breakpoints for both the worker and the unit tests
  • Unit tests
  • 2 endpoints
  • POST /threads that creates a new thread and returns the thread id
  • POST /threads/:threadId/messages
    • Reads user message from the request body as plain text
    • Adds a message to a thread
    • Creats an assistant if it doesn't exist
    • Runs the assistant on the thread
    • Polls the run until it's completed
    • Returns the assistant response as plain text

Running

  1. Clone the repo and run npm install
  2. Copy wrangler.example.toml to wrangler.toml and fill in the OpenAI API key
  3. Assuming you are using VSCode, press F5 to start the worker
  4. You can also select Worker + Test to run the unit tests and see the worker in action (all breakpoitable!)

Other goodies

I have included assistant-documentation that you can simply paste into chatgpt to answer any questions about the new beta.assistants API. I have actually used this to build the initial version of the code.

Extension points exported contracts — how you extend this code

Env (Interface)
(no doc)
src/index.ts

Core symbols most depended-on inside this repo

fetch
called by 4
src/index.ts
addNumbers
called by 1
src/index.ts

Shape

Function 2
Interface 1

Languages

TypeScript100%

Modules by API surface

src/index.ts3 symbols

For agents

$ claude mcp add openai-assistants-starter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page