Expand description
OpenAI threads endpoint handlers.
Constants§
- THREADS_
PATH - Route path for thread creation (
POST /v1/threads). - THREAD_
MESSAGES_ ROUTE - Templated route for a thread’s message collection (
/v1/threads/{id}/messages). - THREAD_
RETRIEVAL_ PREFIX - Path prefix shared by thread retrieval and message routes (
/v1/threads/). - THREAD_
RETRIEVAL_ ROUTE - Templated route for retrieving a single thread by id (
/v1/threads/{id}).
Functions§
- handle_
thread_ get - Handles
GET /v1/threads/{id}andGET /v1/threads/{id}/messages, dispatching to thread retrieval or message listing based on the request path. - handle_
thread_ post - Handles
POST /v1/threads/{id}/messages, appending a message to the thread. - handle_
threads - Handles
POST /v1/threads, creating a new thread and returning its JSON object. - list_
messages - Returns the thread’s messages as an OpenAI
listobject, or a not-found error response when the thread does not exist. - retrieve_
thread - Returns the JSON object for a stored thread, or a not-found error response.