Class CohereChatRequest
Details for the chat request for Cohere models.
Inherited Members
Namespace: Oci.GenerativeaiinferenceService.Models
Assembly: OCI.DotNetSDK.Generativeaiinference.dll
Syntax
public class CohereChatRequest : BaseChatRequest
Properties
ChatHistory
Declaration
[JsonProperty(PropertyName = "chatHistory")]
public List<CohereMessage> ChatHistory { get; set; }
Property Value
Type | Description |
---|---|
List<CohereMessage> | The list of previous messages between the user and the model. The chat history gives the model context for responding to the user's inputs. |
CitationQuality
Declaration
[JsonProperty(PropertyName = "citationQuality")]
[JsonConverter(typeof(StringEnumConverter))]
public CohereChatRequest.CitationQualityEnum? CitationQuality { get; set; }
Property Value
Type | Description |
---|---|
CohereChatRequest.CitationQualityEnum? | When FAST is selected, citations are generated at the same time as the text output and the request will be completed sooner. May result in less accurate citations. |
Documents
Declaration
[JsonProperty(PropertyName = "documents")]
public List<object> Documents { get; set; }
Property Value
Type | Description |
---|---|
List<object> | A list of relevant documents that the model can refer to for generating grounded responses to the user's requests.
Some example keys that you can add to the dictionary are "text", "author", and "date". Keep the total word count of the strings in the dictionary to 300 words or less.
|
FrequencyPenalty
Declaration
[JsonProperty(PropertyName = "frequencyPenalty")]
public double FrequencyPenalty { get; set; }
Property Value
Type | Description |
---|---|
double | To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens. Set to 0 to disable. |
IsEcho
Declaration
[JsonProperty(PropertyName = "isEcho")]
public bool? IsEcho { get; set; }
Property Value
Type | Description |
---|---|
bool? | Returns the full prompt that was sent to the model when True. |
IsForceSingleStep
Declaration
[JsonProperty(PropertyName = "isForceSingleStep")]
public bool? IsForceSingleStep { get; set; }
Property Value
Type | Description |
---|---|
bool? | When enabled, the model will issue (potentially multiple) tool calls in a single step, before it receives the tool responses and directly answers the user's original message. |
IsRawPrompting
Declaration
[JsonProperty(PropertyName = "isRawPrompting")]
public bool? IsRawPrompting { get; set; }
Property Value
Type | Description |
---|---|
bool? | When enabled, the user\u2019s |
IsSearchQueriesOnly
Declaration
[JsonProperty(PropertyName = "isSearchQueriesOnly")]
public bool? IsSearchQueriesOnly { get; set; }
Property Value
Type | Description |
---|---|
bool? | When set to true, the response contains only a list of generated search queries without the search results and the model will not respond to the user's message. |
IsStream
Declaration
[JsonProperty(PropertyName = "isStream")]
public bool? IsStream { get; set; }
Property Value
Type | Description |
---|---|
bool? | Whether to stream the partial progress of the model's response. When set to true, as tokens become available, they are sent as data-only server-sent events. |
MaxTokens
Declaration
[JsonProperty(PropertyName = "maxTokens")]
public int? MaxTokens { get; set; }
Property Value
Type | Description |
---|---|
int? | The maximum number of output tokens that the model will generate for the response. |
Message
Declaration
[Required(ErrorMessage = "Message is required.")]
[JsonProperty(PropertyName = "message")]
public string Message { get; set; }
Property Value
Type | Description |
---|---|
string | The text that the user inputs for the model to respond to. |
Remarks
Required
PreambleOverride
Declaration
[JsonProperty(PropertyName = "preambleOverride")]
public string PreambleOverride { get; set; }
Property Value
Type | Description |
---|---|
string | If specified, the default Cohere preamble is replaced with the provided preamble. A preamble is an initial guideline message that can change the model's overall chat behavior and conversation style. Default preambles vary for different models.
|
PresencePenalty
Declaration
[JsonProperty(PropertyName = "presencePenalty")]
public double PresencePenalty { get; set; }
Property Value
Type | Description |
---|---|
double | To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens.
|
PromptTruncation
Declaration
[JsonProperty(PropertyName = "promptTruncation")]
[JsonConverter(typeof(StringEnumConverter))]
public CohereChatRequest.PromptTruncationEnum? PromptTruncation { get; set; }
Property Value
Type | Description |
---|---|
CohereChatRequest.PromptTruncationEnum? | Defaults to OFF. Dictates how the prompt will be constructed. With |
Seed
Declaration
[JsonProperty(PropertyName = "seed")]
public int? Seed { get; set; }
Property Value
Type | Description |
---|---|
int? | If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinism cannot be totally guaranteed. |
StopSequences
Declaration
[JsonProperty(PropertyName = "stopSequences")]
public List<string> StopSequences { get; set; }
Property Value
Type | Description |
---|---|
List<string> | Stop the model generation when it reaches a stop sequence defined in this parameter. |
Temperature
Declaration
[JsonProperty(PropertyName = "temperature")]
public double Temperature { get; set; }
Property Value
Type | Description |
---|---|
double | A number that sets the randomness of the generated output. A lower temperature means less random generations. Use lower numbers for tasks such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs. |
ToolResults
Declaration
[JsonProperty(PropertyName = "toolResults")]
public List<CohereToolResult> ToolResults { get; set; }
Property Value
Type | Description |
---|---|
List<CohereToolResult> | A list of results from invoking tools recommended by the model in the previous chat turn. |
Tools
Declaration
[JsonProperty(PropertyName = "tools")]
public List<CohereTool> Tools { get; set; }
Property Value
Type | Description |
---|---|
List<CohereTool> | A list of available tools (functions) that the model may suggest invoking before producing a text response. |
TopK
Declaration
[JsonProperty(PropertyName = "topK")]
public int? TopK { get; set; }
Property Value
Type | Description |
---|---|
int? | A sampling method in which the model chooses the next token randomly from the top k most likely tokens. A higher value for k generates more random output, which makes the output text sound more natural. The default value for k is 0 which disables this method and considers all tokens. To set a number for the likely tokens, choose an integer between 1 and 500.
|
TopP
Declaration
[JsonProperty(PropertyName = "topP")]
public double TopP { get; set; }
Property Value
Type | Description |
---|---|
double |