Freigeben über


CreateResponse Class

Definition

The CreateResponse.

public class CreateResponse : System.ClientModel.Primitives.IJsonModel<Azure.AI.AgentServer.Responses.Models.CreateResponse>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.AgentServer.Responses.Models.CreateResponse>
type CreateResponse = class
    interface IJsonModel<CreateResponse>
    interface IPersistableModel<CreateResponse>
Public Class CreateResponse
Implements IJsonModel(Of CreateResponse), IPersistableModel(Of CreateResponse)
Inheritance
CreateResponse
Implements

Constructors

Name Description
CreateResponse()

Initializes a new instance of CreateResponse.

Properties

Name Description
Agent

(Deprecated) Use agent_reference instead. The agent to use for generating the response.

AgentReference

The agent to use for generating the response.

AgentSessionId

Optional session identifier for sandbox affinity. Currently only relevant for hosted agents. When provided, the request is routed to the same sandbox. When omitted, auto-derived from conversation_id/prev_response_id or a new UUID is generated.

Background

Gets or sets the Background.

ContextManagement

Context management configuration for this request.

Conversation

Gets or sets the Conversation.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

<remarks> Supported types:

</remarks>

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Include

Gets or sets the Include.

Input

Gets or sets the Input.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

<remarks> Supported types:

</remarks>

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Instructions

Gets or sets the Instructions.

MaxOutputTokens

Gets or sets the MaxOutputTokens.

MaxToolCalls

Gets or sets the MaxToolCalls.

Metadata

Gets or sets the Metadata.

Model

The model deployment to use for the creation of this response.

ParallelToolCalls

Gets or sets the ParallelToolCalls.

PreviousResponseId

Gets or sets the PreviousResponseId.

Prompt

Gets or sets the Prompt.

PromptCacheKey

Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.

PromptCacheRetention

Gets or sets the PromptCacheRetention.

Reasoning

Gets or sets the Reasoning.

SafetyIdentifier

A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.

ServiceTier

Gets or sets the ServiceTier.

Store

Gets or sets the Store.

Stream

Gets or sets the Stream.

StreamOptions

Gets or sets the StreamOptions.

StructuredInputs

The structured inputs to the response that can participate in prompt template substitution or tool argument bindings.

To assign an object to the value of this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Temperature

Gets or sets the Temperature.

Text

Gets or sets the Text.

ToolChoice

Gets or sets the ToolChoice.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

<remarks> Supported types:

</remarks>

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Tools

Gets the Tools.

TopLogprobs

Gets or sets the TopLogprobs.

TopP

Gets or sets the TopP.

Truncation

Gets or sets the Truncation.

User

This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Operators

Name Description
Implicit(CreateResponse to BinaryContent)

Explicit Interface Implementations

Name Description
IJsonModel<CreateResponse>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<CreateResponse>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IPersistableModel<CreateResponse>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<CreateResponse>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<CreateResponse>.Write(ModelReaderWriterOptions)

Extension Methods

Name Description
GetConversationExpanded(CreateResponse)

Expands the Conversation BinaryData into a typed ConversationParam. A plain string is treated as the conversation ID.

GetConversationId(CreateResponse)

Extracts the conversation ID from the Conversation field, which may be a plain string ID or a JSON object with an id property. Returns null if no conversation context is present.

GetInputExpanded(CreateResponse)

Expands the Input BinaryData into a typed list of Item objects. A plain string input is wrapped as a single ItemMessage with User role and text content. Array elements without a "type" discriminator default to ItemMessage deserialization.

GetInstructionsBinaryData(CreateResponse)

Converts the Instructions string into a BinaryData suitable for assigning to Instructions.

This method properly JSON-encodes the string so it can be round-tripped through Utf8JsonWriter.WriteRawValue. Use this instead of FromString(String), which would produce invalid JSON.

GetToolChoiceExpanded(CreateResponse)

Expands the ToolChoice BinaryData into a typed ToolChoiceParam. String shorthands ("auto", "required") are expanded to ToolChoiceAllowed with the corresponding mode. "none" returns null.

Applies to