OpenAiClient
Constructors
Signature
declare function make(options: { readonly apiKey?: Redacted<string>; readonly apiUrl?: string; readonly organizationId?: Redacted<string>; readonly projectId?: Redacted<string>; readonly transformClient?: (client: HttpClient) => HttpClient;}): Effect<Service, never, any>Context
OpenAiClient
Signature
declare class OpenAiClient extends any { constructor();}Layers
Signature
declare function layer(options: { readonly apiKey?: Redacted<string>; readonly apiUrl?: string; readonly organizationId?: Redacted<string>; readonly projectId?: Redacted<string>; readonly transformClient?: (client: HttpClient) => HttpClient;}): Layer<OpenAiClient, never, HttpClient>layerConfig
Signature
declare function layerConfig(options: { readonly apiKey?: Config<Redacted<string> | undefined>; readonly apiUrl?: Config<string | undefined>; readonly organizationId?: Config<Redacted<string> | undefined>; readonly projectId?: Config<Redacted<string> | undefined>; readonly transformClient?: (client: HttpClient) => HttpClient;}): Layer<OpenAiClient, ConfigError, HttpClient>Models
ResponseStreamEvent type
Represents the events that can be emitted during a streaming response.
Signature
type ResponseStreamEvent = typeof ResponseStreamEvent.TypeSignature
interface Service { readonly client: Client; readonly createEmbedding: (options: { [key: string]: any; }) => Effect<CreateEmbeddingResponse, AiError>; readonly createResponse: (options: { [key: string]: any; }) => Effect<Response, AiError>; readonly createResponseStream: (options: Omit<typeof Generated.CreateResponse.Encoded, "stream">) => Stream<ResponseCreatedEvent | ResponseQueuedEvent | ResponseInProgressEvent | ResponseCompletedEvent | ResponseIncompleteEvent | ResponseFailedEvent | ResponseOutputItemAddedEvent | ResponseOutputItemDoneEvent | ResponseContentPartAddedEvent | ResponseContentPartDoneEvent | ResponseOutputTextDeltaEvent | ResponseOutputTextDoneEvent | ResponseOutputTextAnnotationAddedEvent | ResponseRefusalDeltaEvent | ResponseRefusalDoneEvent | ResponseFunctionCallArgumentsDeltaEvent | ResponseFunctionCallArgumentsDoneEvent | ResponseFileSearchCallInProgressEvent | ResponseFileSearchCallSearchingEvent | ResponseFileSearchCallCompletedEvent | ResponseWebSearchCallInProgressEvent | ResponseWebSearchCallSearchingEvent | ResponseWebSearchCallCompletedEvent | ResponseReasoningSummaryPartAddedEvent | ResponseReasoningSummaryPartDoneEvent | ResponseReasoningSummaryTextDeltaEvent | ResponseReasoningSummaryTextDoneEvent | ResponseReasoningTextDeltaEvent | ResponseReasoningTextDoneEvent | ResponseImageGenerationCallInProgressEvent | ResponseImageGenerationCallGeneratingEvent | ResponseImageGenerationCallPartialImageEvent | ResponseImageGenerationCallCompletedEvent | ResponseMcpCallArgumentsDeltaEvent | ResponseMcpCallArgumentsDoneEvent | ResponseMcpCallInProgressEvent | ResponseMcpCallCompletedEvent | ResponseMcpCallFailedEvent | ResponseMcpListToolsInProgressEvent | ResponseMcpListToolsCompletedEvent | ResponseMcpListToolsFailedEvent | ResponseCodeInterpreterCallInProgressEvent | ResponseCodeInterpreterCallInterpretingEvent | ResponseCodeInterpreterCallCompletedEvent | ResponseCodeInterpreterCallCodeDeltaEvent | ResponseCodeInterpreterCallCodeDoneEvent | ResponseCustomToolCallInputDeltaEvent | ResponseCustomToolCallInputDoneEvent | ResponseErrorEvent, AiError>; readonly streamRequest: <A, I, R>(request: HttpClientRequest, schema: any) => Stream<A, AiError, R>;}StreamCompletionRequest type
Signature
type StreamCompletionRequest = Omit<typeof Generated.CreateChatCompletionRequest.Encoded, "stream">Schemas
Signature
declare class LogProbs extends { readonly logprob: number; readonly token: string; readonly top_logprobs: readonly Array<{ readonly logprob: number; readonly token: string; }>;} { constructor(...args: [props: { readonly logprob: number; readonly token: string; readonly top_logprobs: readonly Array<{ readonly logprob: number; readonly token: string; }>; }, options?: MakeOptions]);}ResponseCodeInterpreterCallCodeDeltaEvent
Emitted when a partial code snippet is streamed by the code interpreter.
Signature
declare class ResponseCodeInterpreterCallCodeDeltaEvent extends { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call_code.delta";} { constructor(...args: [props: { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call_code.delta"; }, options?: MakeOptions]);}ResponseCodeInterpreterCallCodeDoneEvent
Emitted when the code snippet is finalized by the code interpreter.
Signature
declare class ResponseCodeInterpreterCallCodeDoneEvent extends { readonly code: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call_code.done";} { constructor(...args: [props: { readonly code: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call_code.done"; }, options?: MakeOptions]);}ResponseCodeInterpreterCallCompletedEvent
Emitted when the code interpreter call is completed.
Signature
declare class ResponseCodeInterpreterCallCompletedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call.completed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call.completed"; }, options?: MakeOptions]);}ResponseCodeInterpreterCallInProgressEvent
Emitted when a code interpreter call is in progress.
Signature
declare class ResponseCodeInterpreterCallInProgressEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call.in_progress";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call.in_progress"; }, options?: MakeOptions]);}ResponseCodeInterpreterCallInterpretingEvent
Emitted when the code interpreter is actively interpreting the code snippet.
Signature
declare class ResponseCodeInterpreterCallInterpretingEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call.interpreting";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.code_interpreter_call.interpreting"; }, options?: MakeOptions]);}ResponseCompletedEvent
Emitted when the model response is complete.
Signature
declare class ResponseCompletedEvent extends { readonly response: Response; readonly sequence_number: number; readonly type: "response.completed";} { constructor(...args: [props: { readonly response: Response; readonly sequence_number: number; readonly type: "response.completed"; }, options?: MakeOptions]);}ResponseContentPartAddedEvent
Emitted when a new content part is added.
Signature
declare class ResponseContentPartAddedEvent extends { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly part: unknown; readonly sequence_number: number; readonly type: "response.content_part.added";} { constructor(...args: [props: { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly part: unknown; readonly sequence_number: number; readonly type: "response.content_part.added"; }, options?: MakeOptions]);}ResponseContentPartDoneEvent
Emitted when a content part is done.
Signature
declare class ResponseContentPartDoneEvent extends { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly part: unknown; readonly sequence_number: number; readonly type: "response.content_part.done";} { constructor(...args: [props: { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly part: unknown; readonly sequence_number: number; readonly type: "response.content_part.done"; }, options?: MakeOptions]);}ResponseCreatedEvent
An event that is emitted when a response is created.
Signature
declare class ResponseCreatedEvent extends { readonly response: Response; readonly sequence_number: number; readonly type: "response.created";} { constructor(...args: [props: { readonly response: Response; readonly sequence_number: number; readonly type: "response.created"; }, options?: MakeOptions]);}ResponseCustomToolCallInputDeltaEvent
Event representing a delta (partial update) to the input of a custom tool call.
Signature
declare class ResponseCustomToolCallInputDeltaEvent extends { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.custom_tool_call_input.delta";} { constructor(...args: [props: { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.custom_tool_call_input.delta"; }, options?: MakeOptions]);}ResponseCustomToolCallInputDoneEvent
Event indicating that input for a custom tool call is complete.
Signature
declare class ResponseCustomToolCallInputDoneEvent extends { readonly input: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.custom_tool_call_input.done";} { constructor(...args: [props: { readonly input: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.custom_tool_call_input.done"; }, options?: MakeOptions]);}ResponseErrorEvent
Emitted when an error occurs.
Signature
declare class ResponseErrorEvent extends { readonly code?: string | null; readonly message: string; readonly param?: string | null; readonly sequence_number: number; readonly type: "error";} { constructor(...args: [props: { readonly code?: string | null; readonly message: string; readonly param?: string | null; readonly sequence_number: number; readonly type: "error"; }, options?: MakeOptions]);}ResponseFailedEvent
An event that is emitted when a response fails.
Signature
declare class ResponseFailedEvent extends { readonly response: Response; readonly sequence_number: number; readonly type: "response.failed";} { constructor(...args: [props: { readonly response: Response; readonly sequence_number: number; readonly type: "response.failed"; }, options?: MakeOptions]);}ResponseFileSearchCallCompletedEvent
Emitted when a file search call is completed (results found).
Signature
declare class ResponseFileSearchCallCompletedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.file_search_call.completed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.file_search_call.completed"; }, options?: MakeOptions]);}ResponseFileSearchCallInProgressEvent
Emitted when a file search call is initiated.
Signature
declare class ResponseFileSearchCallInProgressEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.file_search_call.in_progress";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.file_search_call.in_progress"; }, options?: MakeOptions]);}ResponseFileSearchCallSearchingEvent
Emitted when a file search is currently searching.
Signature
declare class ResponseFileSearchCallSearchingEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.file_search_call.searching";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.file_search_call.searching"; }, options?: MakeOptions]);}ResponseFunctionCallArgumentsDeltaEvent
Emitted when there is a partial function-call arguments delta.
Signature
declare class ResponseFunctionCallArgumentsDeltaEvent extends { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.function_call_arguments.delta";} { constructor(...args: [props: { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.function_call_arguments.delta"; }, options?: MakeOptions]);}ResponseFunctionCallArgumentsDoneEvent
Emitted when function-call arguments are finalized.
Signature
declare class ResponseFunctionCallArgumentsDoneEvent extends { readonly arguments: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.function_call_arguments.done";} { constructor(...args: [props: { readonly arguments: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.function_call_arguments.done"; }, options?: MakeOptions]);}ResponseImageGenerationCallCompletedEvent
Emitted when an image generation tool call has completed and the final image is available.
Signature
declare class ResponseImageGenerationCallCompletedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.completed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.completed"; }, options?: MakeOptions]);}ResponseImageGenerationCallGeneratingEvent
Emitted when an image generation tool call is actively generating an image (intermediate state).
Signature
declare class ResponseImageGenerationCallGeneratingEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.generating";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.generating"; }, options?: MakeOptions]);}ResponseImageGenerationCallInProgressEvent
Emitted when an image generation tool call is in progress.
Signature
declare class ResponseImageGenerationCallInProgressEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.in_progress";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.in_progress"; }, options?: MakeOptions]);}ResponseImageGenerationCallPartialImageEvent
Emitted when a partial image is available during image generation streaming.
Signature
declare class ResponseImageGenerationCallPartialImageEvent extends { readonly item_id: string; readonly output_index: number; readonly partial_image_b64: string; readonly partial_image_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.partial_image";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly partial_image_b64: string; readonly partial_image_index: number; readonly sequence_number: number; readonly type: "response.image_generation_call.partial_image"; }, options?: MakeOptions]);}ResponseIncompleteEvent
An event that is emitted when a response finishes as incomplete.
Signature
declare class ResponseIncompleteEvent extends { readonly response: Response; readonly sequence_number: number; readonly type: "response.incomplete";} { constructor(...args: [props: { readonly response: Response; readonly sequence_number: number; readonly type: "response.incomplete"; }, options?: MakeOptions]);}ResponseInProgressEvent
Emitted when the response is in progress.
Signature
declare class ResponseInProgressEvent extends { readonly response: Response; readonly sequence_number: number; readonly type: "response.in_progress";} { constructor(...args: [props: { readonly response: Response; readonly sequence_number: number; readonly type: "response.in_progress"; }, options?: MakeOptions]);}ResponseMcpCallArgumentsDeltaEvent
Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
Signature
declare class ResponseMcpCallArgumentsDeltaEvent extends { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call_arguments.delta";} { constructor(...args: [props: { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call_arguments.delta"; }, options?: MakeOptions]);}ResponseMcpCallArgumentsDoneEvent
Emitted when the arguments for an MCP tool call are finalized.
Signature
declare class ResponseMcpCallArgumentsDoneEvent extends { readonly arguments: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call_arguments.done";} { constructor(...args: [props: { readonly arguments: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call_arguments.done"; }, options?: MakeOptions]);}ResponseMcpCallCompletedEvent
Emitted when an MCP tool call has completed successfully.
Signature
declare class ResponseMcpCallCompletedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call.completed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call.completed"; }, options?: MakeOptions]);}ResponseMcpCallFailedEvent
Emitted when an MCP tool call has failed.
Signature
declare class ResponseMcpCallFailedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call.failed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call.failed"; }, options?: MakeOptions]);}ResponseMcpCallInProgressEvent
Emitted when an MCP tool call is in progress.
Signature
declare class ResponseMcpCallInProgressEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call.in_progress";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_call.in_progress"; }, options?: MakeOptions]);}ResponseMcpListToolsCompletedEvent
Emitted when the list of available MCP tools has been successfully retrieved.
Signature
declare class ResponseMcpListToolsCompletedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_list_tools.completed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_list_tools.completed"; }, options?: MakeOptions]);}ResponseMcpListToolsFailedEvent
Emitted when the attempt to list available MCP tools has failed.
Signature
declare class ResponseMcpListToolsFailedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_list_tools.failed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_list_tools.failed"; }, options?: MakeOptions]);}ResponseMcpListToolsInProgressEvent
Emitted when the system is in the process of retrieving the list of available MCP tools.
Signature
declare class ResponseMcpListToolsInProgressEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_list_tools.in_progress";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.mcp_list_tools.in_progress"; }, options?: MakeOptions]);}ResponseOutputItemAddedEvent
Emitted when a new output item is added.
Signature
declare class ResponseOutputItemAddedEvent extends { readonly item: unknown; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_item.added";} { constructor(...args: [props: { readonly item: unknown; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_item.added"; }, options?: MakeOptions]);}ResponseOutputItemDoneEvent
Emitted when an output item is marked done.
Signature
declare class ResponseOutputItemDoneEvent extends { readonly item: unknown; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_item.done";} { constructor(...args: [props: { readonly item: unknown; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_item.done"; }, options?: MakeOptions]);}ResponseOutputTextAnnotationAddedEvent
Emitted when an annotation is added to output text content.
Signature
declare class ResponseOutputTextAnnotationAddedEvent extends { readonly annotation: unknown; readonly annotation_index: number; readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_text.annotation.added";} { constructor(...args: [props: { readonly annotation: unknown; readonly annotation_index: number; readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_text.annotation.added"; }, options?: MakeOptions]);}ResponseOutputTextDeltaEvent
Emitted when there is an additional text delta.
Signature
declare class ResponseOutputTextDeltaEvent extends { readonly content_index: number; readonly delta: string; readonly item_id: string; readonly logprobs?: readonly Array<LogProbs> | null; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_text.delta";} { constructor(...args: [props: { readonly content_index: number; readonly delta: string; readonly item_id: string; readonly logprobs?: readonly Array<LogProbs> | null; readonly output_index: number; readonly sequence_number: number; readonly type: "response.output_text.delta"; }, options?: MakeOptions]);}ResponseOutputTextDoneEvent
Emitted when text content is finalized.
Signature
declare class ResponseOutputTextDoneEvent extends { readonly content_index: number; readonly item_id: string; readonly logprobs?: readonly Array<LogProbs> | null; readonly output_index: number; readonly sequence_number: number; readonly text: string; readonly type: "response.output_text.done";} { constructor(...args: [props: { readonly content_index: number; readonly item_id: string; readonly logprobs?: readonly Array<LogProbs> | null; readonly output_index: number; readonly sequence_number: number; readonly text: string; readonly type: "response.output_text.done"; }, options?: MakeOptions]);}ResponseQueuedEvent
Emitted when a response is queued and waiting to be processed.
Signature
declare class ResponseQueuedEvent extends { readonly response: Response; readonly sequence_number: number; readonly type: "response.queued";} { constructor(...args: [props: { readonly response: Response; readonly sequence_number: number; readonly type: "response.queued"; }, options?: MakeOptions]);}ResponseReasoningSummaryPartAddedEvent
Emitted when a reasoning summary part is completed.
Signature
declare class ResponseReasoningSummaryPartAddedEvent extends { readonly item_id: string; readonly output_index: number; readonly part: SummaryPart; readonly sequence_number: number; readonly summary_index: number; readonly type: "response.reasoning_summary_part.added";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly part: SummaryPart; readonly sequence_number: number; readonly summary_index: number; readonly type: "response.reasoning_summary_part.added"; }, options?: MakeOptions]);}ResponseReasoningSummaryPartDoneEvent
Emitted when a new reasoning summary part is added.
Signature
declare class ResponseReasoningSummaryPartDoneEvent extends { readonly item_id: string; readonly output_index: number; readonly part: SummaryPart; readonly sequence_number: number; readonly summary_index: number; readonly type: "response.reasoning_summary_part.done";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly part: SummaryPart; readonly sequence_number: number; readonly summary_index: number; readonly type: "response.reasoning_summary_part.done"; }, options?: MakeOptions]);}ResponseReasoningSummaryTextDeltaEvent
Emitted when a delta is added to a reasoning summary text.
Signature
declare class ResponseReasoningSummaryTextDeltaEvent extends { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly summary_index: number; readonly type: "response.reasoning_summary_text.delta";} { constructor(...args: [props: { readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly summary_index: number; readonly type: "response.reasoning_summary_text.delta"; }, options?: MakeOptions]);}ResponseReasoningSummaryTextDoneEvent
Emitted when a reasoning summary text is completed.
Signature
declare class ResponseReasoningSummaryTextDoneEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly summary_index: number; readonly text: string; readonly type: "response.reasoning_summary_text.done";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly summary_index: number; readonly text: string; readonly type: "response.reasoning_summary_text.done"; }, options?: MakeOptions]);}ResponseReasoningTextDeltaEvent
Emitted when a delta is added to a reasoning text.
Signature
declare class ResponseReasoningTextDeltaEvent extends { readonly content_index: number; readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.reasoning_text.delta";} { constructor(...args: [props: { readonly content_index: number; readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.reasoning_text.delta"; }, options?: MakeOptions]);}ResponseReasoningTextDoneEvent
Emitted when a reasoning text is completed.
Signature
declare class ResponseReasoningTextDoneEvent extends { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly text: string; readonly type: "response.reasoning_text.done";} { constructor(...args: [props: { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly text: string; readonly type: "response.reasoning_text.done"; }, options?: MakeOptions]);}ResponseRefusalDeltaEvent
Emitted when there is a partial refusal text.
Signature
declare class ResponseRefusalDeltaEvent extends { readonly content_index: number; readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.refusal.delta";} { constructor(...args: [props: { readonly content_index: number; readonly delta: string; readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.refusal.delta"; }, options?: MakeOptions]);}ResponseRefusalDoneEvent
Emitted when refusal text is finalized.
Signature
declare class ResponseRefusalDoneEvent extends { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly refusal: string; readonly sequence_number: number; readonly type: "response.refusal.done";} { constructor(...args: [props: { readonly content_index: number; readonly item_id: string; readonly output_index: number; readonly refusal: string; readonly sequence_number: number; readonly type: "response.refusal.done"; }, options?: MakeOptions]);}ResponseStreamEvent
Represents the events that can be emitted during a streaming response.
Signature
declare const ResponseStreamEvent: Schema.Union<[typeof ResponseCreatedEvent, typeof ResponseQueuedEvent, typeof ResponseInProgressEvent, typeof ResponseCompletedEvent, typeof ResponseIncompleteEvent, typeof ResponseFailedEvent, typeof ResponseOutputItemAddedEvent, typeof ResponseOutputItemDoneEvent, typeof ResponseContentPartAddedEvent, typeof ResponseContentPartDoneEvent, typeof ResponseOutputTextDeltaEvent, typeof ResponseOutputTextDoneEvent, typeof ResponseOutputTextAnnotationAddedEvent, typeof ResponseRefusalDeltaEvent, typeof ResponseRefusalDoneEvent, typeof ResponseFunctionCallArgumentsDeltaEvent, typeof ResponseFunctionCallArgumentsDoneEvent, typeof ResponseFileSearchCallInProgressEvent, typeof ResponseFileSearchCallSearchingEvent, typeof ResponseFileSearchCallCompletedEvent, typeof ResponseWebSearchCallInProgressEvent, typeof ResponseWebSearchCallSearchingEvent, typeof ResponseWebSearchCallCompletedEvent, typeof ResponseReasoningSummaryPartAddedEvent, typeof ResponseReasoningSummaryPartDoneEvent, typeof ResponseReasoningSummaryTextDeltaEvent, typeof ResponseReasoningSummaryTextDoneEvent, typeof ResponseReasoningTextDeltaEvent, typeof ResponseReasoningTextDoneEvent, typeof ResponseImageGenerationCallInProgressEvent, typeof ResponseImageGenerationCallGeneratingEvent, typeof ResponseImageGenerationCallPartialImageEvent, typeof ResponseImageGenerationCallCompletedEvent, typeof ResponseMcpCallArgumentsDeltaEvent, typeof ResponseMcpCallArgumentsDoneEvent, typeof ResponseMcpCallInProgressEvent, typeof ResponseMcpCallCompletedEvent, typeof ResponseMcpCallFailedEvent, typeof ResponseMcpListToolsInProgressEvent, typeof ResponseMcpListToolsCompletedEvent, typeof ResponseMcpListToolsFailedEvent, typeof ResponseCodeInterpreterCallInProgressEvent, typeof ResponseCodeInterpreterCallInterpretingEvent, typeof ResponseCodeInterpreterCallCompletedEvent, typeof ResponseCodeInterpreterCallCodeDeltaEvent, typeof ResponseCodeInterpreterCallCodeDoneEvent, typeof ResponseCustomToolCallInputDeltaEvent, typeof ResponseCustomToolCallInputDoneEvent, typeof ResponseErrorEvent]>ResponseWebSearchCallCompletedEvent
Emitted when a web search call is completed.
Signature
declare class ResponseWebSearchCallCompletedEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.web_search_call.completed";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.web_search_call.completed"; }, options?: MakeOptions]);}ResponseWebSearchCallInProgressEvent
Emitted when a web search call is initiated.
Signature
declare class ResponseWebSearchCallInProgressEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.web_search_call.in_progress";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.web_search_call.in_progress"; }, options?: MakeOptions]);}ResponseWebSearchCallSearchingEvent
Emitted when a web search call is executing.
Signature
declare class ResponseWebSearchCallSearchingEvent extends { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.web_search_call.searching";} { constructor(...args: [props: { readonly item_id: string; readonly output_index: number; readonly sequence_number: number; readonly type: "response.web_search_call.searching"; }, options?: MakeOptions]);}SummaryPart
Signature
declare class SummaryPart extends { readonly text: string; readonly type: "summary_text";} { constructor(...args: [props: { readonly text: string; readonly type: "summary_text"; }, options?: MakeOptions]);}