Table of Contents

Class ResponseService

OpenAI's most advanced interface for generating model responses. Supports text and image inputs, and text outputs. Create stateful interactions with the model, using the output of previous responses as input. Extend the model's capabilities with built-in tools for file search, web search, computer use, and more. Allow the model access to external systems and data using function calling. https://platform.openai.com/docs/api-reference/responses

public class ResponseService : CrudServiceBase<OpenAIClient>
Inheritance
object
ResponseService

Constructors

ResponseService(OpenAIClient)

public ResponseService(OpenAIClient client)

Parameters

client OpenAIClient

Methods

CancelAsync(string, RESTOptions)

public UniTask<Response> CancelAsync(string responseId, RESTOptions options = null)

Parameters

responseId string
options RESTOptions

Returns

UniTask<Response>

CreateAsync(ResponseRequest, RESTOptions)

public UniTask<Response> CreateAsync(ResponseRequest request, RESTOptions options = null)

Parameters

request ResponseRequest
options RESTOptions

Returns

UniTask<Response>

DeleteAsync(string, RESTOptions)

public UniTask<Response> DeleteAsync(string responseId, RESTOptions options = null)

Parameters

responseId string
options RESTOptions

Returns

UniTask<Response>

ListInputItemsAsync(string, CursorQuery, RESTOptions)

public UniTask<QueryResponse<ConversationItem>> ListInputItemsAsync(string responseId, CursorQuery query = null, RESTOptions options = null)

Parameters

responseId string
query CursorQuery
options RESTOptions

Returns

UniTask<QueryResponse<ConversationItem>>

RetrieveAsync(string, ResponseQuery, RESTOptions)

public UniTask<Response> RetrieveAsync(string responseId, ResponseQuery request, RESTOptions options = null)

Parameters

responseId string
request ResponseQuery
options RESTOptions

Returns

UniTask<Response>

StreamAsync(ResponseRequest, IResponsesApiListener, RESTOptions)

public UniTask StreamAsync(ResponseRequest request, IResponsesApiListener eventListener, RESTOptions options = null)

Parameters

request ResponseRequest
eventListener IResponsesApiListener
options RESTOptions

Returns

UniTask