Class CompletionRequest
Inheritance
object
RESTRequestBody
CompletionRequest
Assembly: .dll
Syntax
public class CompletionRequest : OpenAIRequest
Properties
AttachedFiles
Declaration
public List<IFile> AttachedFiles { get; set; }
Property Value
Type |
Description |
List<IFile> |
|
MaxTokens
Declaration
public int? MaxTokens { get; set; }
Property Value
Options
Declaration
public ICompletionOptions Options { get; set; }
Property Value
Prompt
Required if using OpenAI legacy models.
Required for OpenRouter completion requests.
The text prompt to complete
Declaration
public string Prompt { get; set; }
Property Value
An object specifying the format that the model must output.
Setting to { "type": "json_schema", "json_schema": { ...} }
enables Structured Outputs which ensures the model will match your supplied JSON schema.Learn more in the Structured Outputs guide.
Setting to { "type": "json_object" }
enables the older JSON mode, which ensures the message the model generates is valid JSON.Using json_schema is preferred for models that support it.
Declaration
public ResponseFormat ResponseFormat { get; set; }
Property Value
Seed
Declaration
public uint? Seed { get; set; }
Property Value
Stop
Declaration
public List<string> Stop { get; set; }
Property Value
Type |
Description |
List<string> |
|
Stream
Optional. Enable streaming of results.
Defaults to false
Declaration
public bool? Stream { get; set; }
Property Value
StreamOptions
Optional. Whether to include usage information in the response
Declaration
public StreamOptions StreamOptions { get; set; }
Property Value
SystemInstruction
Optional. The system message to use for the model.
Declaration
public string SystemInstruction { get; set; }
Property Value
Temperature
Declaration
public float? Temperature { get; set; }
Property Value
Extension Methods