Class ResponseRequest
Inheritance
ResponseRequest
Assembly: Glitch9.AIDevKit.dll
Syntax
[JsonConverter(typeof(ResponseRequestConverter))]
public class ResponseRequest : GenerativeTextRequest<ResponseRequest, ConversationItem, ConversationItem, ResponseEventBase>, IStreamingGenerativeRequest<ResponseEventBase, ConversationItem>, IGenerativeTextRequest, IGenerativeRequest
Constructors
|
Edit this page
View Source
ResponseRequest()
Declaration
|
Edit this page
View Source
ResponseRequest(ConversationItem)
Declaration
public ResponseRequest(ConversationItem prompt)
Parameters
Properties
|
Edit this page
View Source
ConversationId
Optional. Defaults to null
The conversation that this response belongs to. Items from this conversation are
prepended to input_items for this response request. Input items and output items
from this response are automatically added to this conversation after this response completes.
Declaration
public string ConversationId { get; set; }
Property Value
|
Edit this page
View Source
Include
Optional. Specify additional output data to include in the model response.
Declaration
public string[] Include { get; set; }
Property Value
|
Edit this page
View Source
IncludeObfuscation
Declaration
public bool? IncludeObfuscation { get; set; }
Property Value
|
Edit this page
View Source
Optional. Text, image, or file inputs to the model, used to generate a response.
Declaration
public StringOrArray<ConversationItem> Input { get; set; }
Property Value
|
Edit this page
View Source
Optional. The maximum number of total calls to built-in tools that can be processed in a response.
Declaration
public int? MaxToolCalls { get; set; }
Property Value
|
Edit this page
View Source
PreviousResponseId
Optional. The unique ID of the previous response to the model.
Declaration
public string PreviousResponseId { get; set; }
Property Value
|
Edit this page
View Source
PromptCacheKey
Optional. Used by OpenAI to cache responses for similar requests to optimize your cache hit rates.
Declaration
public string PromptCacheKey { get; set; }
Property Value
|
Edit this page
View Source
PromptReference
Optional. Reference to a prompt template and its variables.
Declaration
public PromptTemplate PromptReference { get; set; }
Property Value
|
Edit this page
View Source
RequestType
The endpoint type for this
Declaration
public override RequestType RequestType { get; }
Property Value
Overrides
|
Edit this page
View Source
Defines how the response should be formatted (e.g., text, JSON).
Declaration
public override ResponseFormat ResponseFormat { get; }
Property Value
Overrides
|
Edit this page
View Source
Store
Optional. Defaults to true
Whether to store the generated model response for later retrieval via API.
Declaration
public bool? Store { get; set; }
Property Value
|
Edit this page
View Source
TextResponseOptions
Optional. Configuration options for a text response from the model.
Declaration
public TextResponseOptions TextResponseOptions { get; set; }
Property Value
|
Edit this page
View Source
Truncation
Optional. Defaults to disabled
The truncation strategy to use for the model response.
Declaration
public TruncationStrategy Truncation { get; set; }
Property Value
Methods
|
Edit this page
View Source
Declaration
public ResponseRequest AddInput(ConversationItem item)
Parameters
Returns
|
Edit this page
View Source
Declaration
public ResponseRequest AddInputRange(IEnumerable<ConversationItem> items)
Parameters
Returns
|
Edit this page
View Source
AddMessageRange(IEnumerable<Message>)
Declaration
public override ResponseRequest AddMessageRange(IEnumerable<Message> messages)
Parameters
Returns
Overrides
|
Edit this page
View Source
ExecuteAsyncInternal()
Executes the actual task logic. Must be implemented in derived classes.
Declaration
protected override UniTask<Generated<ConversationItem>> ExecuteAsyncInternal()
Returns
Overrides
|
Edit this page
View Source
GetMessages()
Declaration
public override List<Message> GetMessages()
Returns
Overrides
|
Edit this page
View Source
SetConversationId(string)
Sets the conversation ID that this response belongs to. Items from the conversation are prepended to the input.
Declaration
public ResponseRequest SetConversationId(string conversationId)
Parameters
| Type |
Name |
Description |
| string |
conversationId |
|
Returns
|
Edit this page
View Source
SetIncludeObfuscation(bool)
Sets whether to include obfuscation in the response.
Declaration
public ResponseRequest SetIncludeObfuscation(bool includeObfuscation)
Parameters
| Type |
Name |
Description |
| bool |
includeObfuscation |
|
Returns
|
Edit this page
View Source
Sets the maximum number of tool calls that can be processed in a single response.
Declaration
public ResponseRequest SetMaxToolCalls(int maxToolCalls)
Parameters
| Type |
Name |
Description |
| int |
maxToolCalls |
|
Returns
|
Edit this page
View Source
SetPreviousResponseId(string)
Sets the ID of the previous response to reference for context continuation.
Declaration
public ResponseRequest SetPreviousResponseId(string responseId)
Parameters
| Type |
Name |
Description |
| string |
responseId |
|
Returns
|
Edit this page
View Source
SetPromptCacheKey(string)
Sets a cache key used by the model to cache responses for similar requests.
Declaration
public ResponseRequest SetPromptCacheKey(string promptCacheKey)
Parameters
| Type |
Name |
Description |
| string |
promptCacheKey |
|
Returns
|
Edit this page
View Source
SetPromptReference(PromptTemplate)
Sets a reference to a prompt template and its variables.
Declaration
public ResponseRequest SetPromptReference(PromptTemplate promptReference)
Parameters
Returns
|
Edit this page
View Source
SetStore(bool)
Sets whether to store the generated model response for later retrieval.
Declaration
public ResponseRequest SetStore(bool store)
Parameters
| Type |
Name |
Description |
| bool |
store |
|
Returns
|
Edit this page
View Source
SetTextResponseOptions(TextResponseOptions)
Sets the configuration options for the text response format from the model.
Declaration
public ResponseRequest SetTextResponseOptions(TextResponseOptions textResponseOptions)
Parameters
Returns
|
Edit this page
View Source
SetTruncation(TruncationStrategy)
Sets the truncation strategy to use for the model response.
Declaration
public ResponseRequest SetTruncation(TruncationStrategy truncation)
Parameters
Returns
|
Edit this page
View Source
StreamAsyncInternal()
Declaration
protected override IGenerativeStream<ResponseEventBase, ConversationItem> StreamAsyncInternal()
Returns
Overrides
Implements
Extension Methods