Functions

modify-assistant

fn (assistant-id: Str, request: ModifyAssistantRequest): ModifyAssistantResponse
fn (assistant-id: Str, request: ModifyAssistantRequest, opts: Map): ModifyAssistantResponse

POST /assistants/{assistant_id} - Update an assistant's configuration (model, name, instructions, tools, etc.).

Example

assistant ::openai::modify/modify-assistant("asst_abc123", ::openai::modify/ModifyAssistantRequest({
  name: "Math Tutor v2",
  instructions: "Show your work."
}))
assistant.name

modify-certificate

fn (certificate-id: Str, request: ModifyCertificateRequest): ModifyCertificateResponse
fn (certificate-id: Str, request: ModifyCertificateRequest, opts: Map): ModifyCertificateResponse

POST /organization/certificates/{certificate_id} - Update the name of a certificate.

Example

cert ::openai::modify/modify-certificate("cert_abc123", ::openai::modify/ModifyCertificateRequest({
  name: "Production cert"
}))
cert.name

modify-message

fn (thread-id: Str, message-id: Str, request: ModifyMessageRequest): ModifyMessageResponse
fn (thread-id: Str, message-id: Str, request: ModifyMessageRequest, opts: Map): ModifyMessageResponse

POST /threads/{thread_id}/messages/{message_id} - Update a message's metadata.

Example

message ::openai::modify/modify-message("thread_abc123", "msg_abc123", ::openai::modify/ModifyMessageRequest({
  metadata: {reviewed: "true"}
}))
message.metadata

modify-run

fn (thread-id: Str, run-id: Str, request: ModifyRunRequest): ModifyRunResponse
fn (thread-id: Str, run-id: Str, request: ModifyRunRequest, opts: Map): ModifyRunResponse

POST /threads/{thread_id}/runs/{run_id} - Update a run's metadata.

Example

run ::openai::modify/modify-run("thread_abc123", "run_abc123", ::openai::modify/ModifyRunRequest({
  metadata: {ticket: "T-42"}
}))
run.metadata

modify-thread

fn (thread-id: Str, request: ModifyThreadRequest): ModifyThreadResponse
fn (thread-id: Str, request: ModifyThreadRequest, opts: Map): ModifyThreadResponse

POST /threads/{thread_id} - Update a thread's tool resources or metadata.

Example

thread ::openai::modify/modify-thread("thread_abc123", ::openai::modify/ModifyThreadRequest({
  metadata: {user: "u_123"}
}))
thread.metadata

modify-vector-store

fn (vector-store-id: Str, request: ModifyVectorStoreRequest): ModifyVectorStoreResponse
fn (vector-store-id: Str, request: ModifyVectorStoreRequest, opts: Map): ModifyVectorStoreResponse

POST /vector_stores/{vector_store_id} - Update a vector store's name, expiration, or metadata.

Example

store ::openai::modify/modify-vector-store("vs_abc123", ::openai::modify/ModifyVectorStoreRequest({
  name: "Support docs v2",
  expires_after: {anchor: "last_active_at", days: 30}
}))
store.name

Types

AssistantObject

AssistantObject type {
    id: Str,
    object: "assistant",
    created_at: Int,
    name: Str?,
    description: Str?,
    model: Str,
    instructions: Str?,
    tools: Vec<AssistantTool>,
    tool_resources: Map?,
    metadata: Metadata?,
    temperature: Dec?,
    top_p: Dec?,
    response_format: AssistantsApiResponseFormatOption?
}

AssistantTool

AssistantTool type Map

AssistantsApiResponseFormatOption

AssistantsApiResponseFormatOption type Any

Certificate

Certificate type {
    object: CertificateObjectType,
    id: Str,
    name: Str?,
    created_at: Int,
    certificate_details: Map,
    active: Bool?
}

CertificateObjectType

CertificateObjectType type "certificate" | "organization.certificate" | "organization.project.certificate"

MessageContent

MessageContent type Any

MessageObject

MessageObject type {
    id: Str,
    object: "thread.message",
    created_at: Int,
    thread_id: Str,
    status: MessageStatus,
    incomplete_details: Map?,
    completed_at: Int?,
    incomplete_at: Int?,
    role: MessageRole,
    content: Vec<MessageContent>,
    assistant_id: Str?,
    run_id: Str?,
    attachments: Vec<Map>?,
    metadata: Metadata?
}

MessageRole

MessageRole type "user" | "assistant"

MessageStatus

MessageStatus type "in_progress" | "incomplete" | "completed"

Metadata

Metadata type Map

ModifyAssistantRequest

ModifyAssistantRequest type {
    model: Any?,
    reasoning_effort: ReasoningEffort?,
    name: Str?,
    description: Str?,
    instructions: Str?,
    tools: Vec<AssistantTool>?,
    tool_resources: Map?,
    metadata: Metadata?,
    temperature: Dec?,
    top_p: Dec?,
    response_format: AssistantsApiResponseFormatOption?
}

ModifyAssistantRequest

ModifyAssistantRequest type {
    model: Any?,
    reasoning_effort: ReasoningEffort?,
    name: Str?,
    description: Str?,
    instructions: Str?,
    tools: Vec<AssistantTool>?,
    tool_resources: Map?,
    metadata: Metadata?,
    temperature: Dec?,
    top_p: Dec?,
    response_format: AssistantsApiResponseFormatOption?
}

ModifyAssistantResponse

ModifyAssistantResponse type {
    id: Str,
    object: "assistant",
    created_at: Int,
    name: Str?,
    description: Str?,
    model: Str,
    instructions: Str?,
    tools: Vec<AssistantTool>,
    tool_resources: Map?,
    metadata: Metadata?,
    temperature: Dec?,
    top_p: Dec?,
    response_format: AssistantsApiResponseFormatOption?
}

ModifyCertificateRequest

ModifyCertificateRequest type {
    name: Str
}

ModifyCertificateRequest

ModifyCertificateRequest type {
    name: Str
}

ModifyCertificateResponse

ModifyCertificateResponse type {
    object: CertificateObjectType,
    id: Str,
    name: Str?,
    created_at: Int,
    certificate_details: Map,
    active: Bool?
}

ModifyMessageRequest

ModifyMessageRequest type {
    metadata: Metadata?
}

ModifyMessageRequest

ModifyMessageRequest type {
    metadata: Metadata?
}

ModifyMessageResponse

ModifyMessageResponse type {
    id: Str,
    object: "thread.message",
    created_at: Int,
    thread_id: Str,
    status: MessageStatus,
    incomplete_details: Map?,
    completed_at: Int?,
    incomplete_at: Int?,
    role: MessageRole,
    content: Vec<MessageContent>,
    assistant_id: Str?,
    run_id: Str?,
    attachments: Vec<Map>?,
    metadata: Metadata?
}

ModifyRunRequest

ModifyRunRequest type {
    metadata: Metadata?
}

ModifyRunRequest

ModifyRunRequest type {
    metadata: Metadata?
}

ModifyRunResponse

ModifyRunResponse type {
    id: Str,
    object: "thread.run",
    created_at: Int,
    thread_id: Str,
    assistant_id: Str?,
    status: RunStatus,
    required_action: Map?,
    last_error: Map?,
    expires_at: Int?,
    started_at: Int?,
    cancelled_at: Int?,
    failed_at: Int?,
    completed_at: Int?,
    incomplete_details: Map?,
    model: Str,
    instructions: Str?,
    tools: Vec<AssistantTool>,
    metadata: Metadata?,
    usage: RunCompletionUsage?,
    temperature: Dec?,
    top_p: Dec?,
    max_prompt_tokens: Int?,
    max_completion_tokens: Int?,
    truncation_strategy: Any,
    tool_choice: Any,
    parallel_tool_calls: ParallelToolCalls,
    response_format: AssistantsApiResponseFormatOption
}

ModifyThreadRequest

ModifyThreadRequest type {
    tool_resources: Map?,
    metadata: Metadata?
}

ModifyThreadRequest

ModifyThreadRequest type {
    tool_resources: Map?,
    metadata: Metadata?
}

ModifyThreadResponse

ModifyThreadResponse type {
    id: Str,
    object: "thread",
    created_at: Int,
    tool_resources: Map?,
    metadata: Metadata?
}

ModifyVectorStoreRequest

ModifyVectorStoreRequest type {
    name: Str?,
    expires_after: Any?,
    metadata: Metadata?
}

ModifyVectorStoreResponse

ModifyVectorStoreResponse type {
    id: Str,
    object: "vector_store",
    created_at: Int,
    name: Str?,
    usage_bytes: Int,
    file_counts: Map,
    status: VectorStoreStatus,
    expires_after: VectorStoreExpirationAfter?,
    expires_at: Int?,
    last_active_at: Int?,
    metadata: Metadata?
}

ParallelToolCalls

ParallelToolCalls type Bool

ReasoningEffort

ReasoningEffort type Str

RunCompletionUsage

RunCompletionUsage type {
    completion_tokens: Int,
    prompt_tokens: Int,
    total_tokens: Int
}

RunObject

RunObject type {
    id: Str,
    object: "thread.run",
    created_at: Int,
    thread_id: Str,
    assistant_id: Str?,
    status: RunStatus,
    required_action: Map?,
    last_error: Map?,
    expires_at: Int?,
    started_at: Int?,
    cancelled_at: Int?,
    failed_at: Int?,
    completed_at: Int?,
    incomplete_details: Map?,
    model: Str,
    instructions: Str?,
    tools: Vec<AssistantTool>,
    metadata: Metadata?,
    usage: RunCompletionUsage?,
    temperature: Dec?,
    top_p: Dec?,
    max_prompt_tokens: Int?,
    max_completion_tokens: Int?,
    truncation_strategy: Any,
    tool_choice: Any,
    parallel_tool_calls: ParallelToolCalls,
    response_format: AssistantsApiResponseFormatOption
}

RunStatus

RunStatus type Str

ThreadObject

ThreadObject type {
    id: Str,
    object: "thread",
    created_at: Int,
    tool_resources: Map,
    metadata: Metadata?
}

UpdateVectorStoreRequest

UpdateVectorStoreRequest type {
    name: Str?,
    expires_after: Any?,
    metadata: Metadata?
}

VectorStoreExpirationAfter

VectorStoreExpirationAfter type {
    anchor: "last_active_at",
    days: Int
}

VectorStoreObject

VectorStoreObject type {
    id: Str,
    object: "vector_store",
    created_at: Int,
    name: Str?,
    usage_bytes: Int,
    file_counts: Map,
    status: VectorStoreStatus,
    expires_after: VectorStoreExpirationAfter?,
    expires_at: Int?,
    last_active_at: Int?,
    metadata: Metadata?
}

VectorStoreStatus

VectorStoreStatus type "expired" | "in_progress" | "completed"