Interface IGenerativeRequest
public interface IGenerativeRequest : ISequentialRequest
- Inherited Members
- Extension Methods
Properties
Api
The cloud service provider associated with this task. Automatically resolved from the selected model if not explicitly set.
Api Api { get; }
Property Value
ArchiveHistory
If true, the prompt and output history will be archived (hidden) after saving.
bool ArchiveHistory { get; }
Property Value
- bool
IsWrapperTask
Indicates if this task is a wrapper around other tasks. This prevents recording prompt history for wrapper tasks to avoid duplicate prompt records.
bool IsWrapperTask { get; }
Property Value
- bool
LogLevel
If true, logs related to this task will be ignored.
TraceLevel? LogLevel { get; }
Property Value
- TraceLevel?
MeasureLatency
If true, the system will measure the elapsed time from when the request is sent until the response is received.
bool MeasureLatency { get; }
Property Value
- bool
Model
The identifier of the model to use for this task. Matches the model deployment name or model ID provided by the API.
string Model { get; set; }
Property Value
- string
N
The number of outputs to generate.
This used to be called 'outputCount', but 'n' is more familiar to me and matches OpenAI's API.
NCount N { get; }
Property Value
OnLatencyMeasured
Action<double> OnLatencyMeasured { get; }
Property Value
- Action<double>
OnRecordCreated
Action<AIRequestRecord> OnRecordCreated { get; set; }
Property Value
- Action<AIRequestRecord>
OutputPath
The local path where generated content will be saved.
string OutputPath { get; }
Property Value
- string
RecordHistory
Whether prompt history should be recorded for this task. Default is controlled by SavePromptHistoryOnRuntime.
bool RecordHistory { get; }
Property Value
- bool
RecordId
A fixed seed value to make generation deterministic and repeatable.
string RecordId { get; set; }
Property Value
- string
RecordMergeOptions
RecordMergeOptions RecordMergeOptions { get; }
Property Value
RequestMimeType
MimeType RequestMimeType { get; }
Property Value
- MimeType
RequestedAt
The timestamp when the request was initiated.
Only set when CountdownTimer is true.
DateTime RequestedAt { get; }
Property Value
- DateTime
ResponseMimeType
MimeType ResponseMimeType { get; }
Property Value
- MimeType
SafetyIdentifier
SafetyIdentifier SafetyIdentifier { get; }
Property Value
SaveOutputs
Whether generated outputs should be saved to disk.
bool SaveOutputs { get; }
Property Value
- bool
Sender
string Sender { get; set; }
Property Value
- string
ServiceTier
ServiceTier? ServiceTier { get; }
Property Value
Stream
Whether this request should be executed as a streaming task.
bool Stream { get; set; }
Property Value
- bool
Type
FluentApiRequestType Type { get; }
Property Value
Methods
Cancel()
void Cancel()
ExecuteAsyncT<T>(CancellationToken)
UniTask<T> ExecuteAsyncT<T>(CancellationToken ct = default) where T : IGeneratedOutput
Parameters
ctCancellationToken
Returns
- UniTask<T>
Type Parameters
T
GetPromptToRecord()
IPrompt GetPromptToRecord()
Returns
GetRequestParameters()
Dictionary<string, object> GetRequestParameters()
Returns
- Dictionary<string, object>
ProcessPostRequestTasks(IGeneratedOutput)
void ProcessPostRequestTasks(IGeneratedOutput output)
Parameters
outputIGeneratedOutput
SetGeneratorWindowSettings(string, string, bool, Action<double>)
void SetGeneratorWindowSettings(string sender, string outputPath, bool measureLatency = true, Action<double> onLatencyMeasured = null)
Parameters
senderstringoutputPathstringmeasureLatencyboolonLatencyMeasuredAction<double>
ShouldMeasureLatency()
bool ShouldMeasureLatency()
Returns
- bool
ShouldRecordHistory()
bool ShouldRecordHistory()
Returns
- bool