Class CohereChatRequest
Inherited Members
Namespace: Glitch9.AIDevKit.Cohere
Assembly: Glitch9.AIDevKit.Provider.Cohere.dll
Syntax
public sealed class CohereChatRequest
Properties
| Edit this page View SourceCitationOptions
Optional. Options for controlling citation generation.
Declaration
[JsonProperty("citation_options")]
public CitationOptions CitationOptions { get; set; }
Property Value
| Type | Description |
|---|---|
| CitationOptions |
Documents
Optional. A list of relevant documents that the model can cite to generate a more accurate reply.
Declaration
[JsonProperty("documents")]
public CohereDocument[] Documents { get; set; }
Property Value
| Type | Description |
|---|---|
| CohereDocument[] |
FrequencyPenalty
Optional. Used to reduce repetitiveness of generated tokens.
Declaration
[JsonProperty("frequency_penalty")]
public double? FrequencyPenalty { get; set; }
Property Value
| Type | Description |
|---|---|
| double? |
K
Optional. Ensures that only the top k most likely tokens are considered.
Declaration
[JsonProperty("k")]
public int? K { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
LogProbs
Optional. When true, includes the log probabilities of generated tokens.
Declaration
[JsonProperty("logprobs")]
public bool? LogProbs { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
MaxTokens
Optional. The maximum number of output tokens the model will generate in the response.
Declaration
[JsonProperty("max_tokens")]
public int? MaxTokens { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Messages
Required. A list of chat messages in chronological order, representing a conversation between the user and the model.
Declaration
[JsonProperty("messages")]
public Message[] Messages { get; set; }
Property Value
| Type | Description |
|---|---|
| Message[] |
Model
Required. The name of a compatible Cohere model.
Declaration
[JsonProperty("model")]
public string Model { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
P
Optional. Ensures that only tokens with total probability mass of p are considered.
Declaration
[JsonProperty("p")]
public double? P { get; set; }
Property Value
| Type | Description |
|---|---|
| double? |
PresencePenalty
Optional. Similar to frequency_penalty but applies equally to all seen tokens.
Declaration
[JsonProperty("presence_penalty")]
public double? PresencePenalty { get; set; }
Property Value
| Type | Description |
|---|---|
| double? |
Priority
Optional. Controls request processing priority.
Declaration
[JsonProperty("priority")]
public int? Priority { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
ResponseFormat
Optional. Configuration for forcing the model output to adhere to the specified format.
Declaration
[JsonProperty("response_format")]
public ResponseFormat ResponseFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| ResponseFormat |
SafetyMode
Optional. Used to select the safety instruction inserted into the prompt.
Defaults to CONTEXTUAL. When OFF is specified, the safety instruction will be omitted.
Safety modes are not yet configurable in combination with tools and documents parameters.
Note: This parameter is only compatible newer Cohere models, starting with Command R 08-2024 and Command R+ 08-2024.
Allowed values: CONTEXTUAL, STRICT, OFF
Declaration
[JsonProperty("safety_mode")]
public string SafetyMode { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Seed
Optional. If specified, will attempt deterministic sampling.
Declaration
[JsonProperty("seed")]
public long? Seed { get; set; }
Property Value
| Type | Description |
|---|---|
| long? |
StopSequences
Optional. A list of up to 5 strings that the model will use to stop generation.
Declaration
[JsonProperty("stop_sequences")]
public string[] StopSequences { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
Stream
Required. Defaults to false. When true, the response will be a SSE stream of events.
Declaration
[JsonProperty("stream")]
public bool Stream { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
StrictTools
Optional. When true, enforces strict adherence to tool definitions.
Declaration
[JsonProperty("strict_tools")]
public bool? StrictTools { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Temperature
Optional. A float that tunes the degree of randomness in generation.
Declaration
[JsonProperty("temperature")]
public double? Temperature { get; set; }
Property Value
| Type | Description |
|---|---|
| double? |
Thinking
Optional. Configuration for reasoning features.
Declaration
[JsonProperty("thinking")]
public ThinkingConfig Thinking { get; set; }
Property Value
| Type | Description |
|---|---|
| ThinkingConfig |
ToolChoice
Used to control whether or not the model will be forced to use a tool when answering. When REQUIRED is specified, the model will be forced to use at least one of the user-defined tools, and the tools parameter must be passed in the request. When NONE is specified, the model will be forced not to use one of the specified tools, and give a direct response. If tool_choice isn???specified, then the model is free to choose whether to use the specified tools or not. Note: This parameter is only compatible with models Command-r7b and newer. Allowed values: REQUIRED, NONE
Declaration
[JsonProperty("tool_choice")]
public string ToolChoice { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Tools
Optional. A list of tools (functions) available to the model.
Declaration
[JsonProperty("tools")]
public Tool[] Tools { get; set; }
Property Value
| Type | Description |
|---|---|
| Tool[] |