Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Assistants

Build Assistants that can call models and use tools.

Create assistant
Deprecated
client.Beta.Assistants.New(ctx, body) (*Assistant, error)
POST/assistants
Delete assistant
Deprecated
client.Beta.Assistants.Delete(ctx, assistantID) (*AssistantDeleted, error)
DELETE/assistants/{assistant_id}
List assistants
Deprecated
client.Beta.Assistants.List(ctx, query) (*CursorPage[Assistant], error)
GET/assistants
Retrieve assistant
Deprecated
client.Beta.Assistants.Get(ctx, assistantID) (*Assistant, error)
GET/assistants/{assistant_id}
Modify assistant
Deprecated
client.Beta.Assistants.Update(ctx, assistantID, body) (*Assistant, error)
POST/assistants/{assistant_id}
ModelsExpand Collapse
type Assistant struct{…}

Represents an assistant that can call the model and use tools.

type AssistantDeleted struct{…}
type AssistantStreamEventUnion interface{…}

Represents an event emitted when streaming a Run.

Each event in a server-sent events stream has an event and data property:

event: thread.created
data: {"id": "thread_123", "object": "thread", ...}

We emit events whenever a new object is created, transitions to a new state, or is being streamed in parts (deltas). For example, we emit thread.run.created when a new run is created, thread.run.completed when a run completes, and so on. When an Assistant chooses to create a message during a run, we emit a thread.message.created event, a thread.message.in_progress event, many thread.message.delta events, and finally a thread.message.completed event.

We may add additional events over time, so we recommend handling unknown events gracefully in your code. See the Assistants API quickstart to learn how to integrate the Assistants API with streaming.

type AssistantToolUnion interface{…}
type CodeInterpreterTool struct{…}
type FileSearchTool struct{…}
type FunctionTool struct{…}
type MessageStreamEventUnion interface{…}

Occurs when a message is created.

type RunStepStreamEventUnion interface{…}

Occurs when a run step is created.

type RunStreamEventUnion interface{…}

Occurs when a new run is created.

type ThreadStreamEvent struct{…}

Occurs when a new thread is created.