MicrosoftExtensionsAIResponsesExtensions.AsChatResponse Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a Microsoft.Extensions.AI ChatResponse from an OpenAIResponse.
public static Microsoft.Extensions.AI.ChatResponse AsChatResponse(this OpenAI.Responses.OpenAIResponse response, OpenAI.Responses.ResponseCreationOptions? options = default);
static member AsChatResponse : OpenAI.Responses.OpenAIResponse * OpenAI.Responses.ResponseCreationOptions -> Microsoft.Extensions.AI.ChatResponse
<Extension()>
Public Function AsChatResponse (response As OpenAIResponse, Optional options As ResponseCreationOptions = Nothing) As ChatResponse
Parameters
- response
- OpenAIResponse
The OpenAIResponse to convert to a ChatResponse.
- options
- ResponseCreationOptions
The options employed in the creation of the response.
Returns
A converted ChatResponse.
Exceptions
response is null.