Search Results for

    Show / Hide Table of Contents

    Class CohereChatRequest

    Inheritance
    object
    CohereChatRequest
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Cohere
    Assembly: Glitch9.AIDevKit.Provider.Cohere.dll
    Syntax
    public sealed class CohereChatRequest

    Properties

    | Edit this page View Source

    CitationOptions

    Optional. Options for controlling citation generation.

    Declaration
    [JsonProperty("citation_options")]
    public CitationOptions CitationOptions { get; set; }
    Property Value
    Type Description
    CitationOptions
    | Edit this page View Source

    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[]
    | Edit this page View Source

    FrequencyPenalty

    Optional. Used to reduce repetitiveness of generated tokens.

    Declaration
    [JsonProperty("frequency_penalty")]
    public double? FrequencyPenalty { get; set; }
    Property Value
    Type Description
    double?
    | Edit this page View Source

    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?
    | Edit this page View Source

    LogProbs

    Optional. When true, includes the log probabilities of generated tokens.

    Declaration
    [JsonProperty("logprobs")]
    public bool? LogProbs { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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[]
    | Edit this page View Source

    Model

    Required. The name of a compatible Cohere model.

    Declaration
    [JsonProperty("model")]
    public string Model { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    Priority

    Optional. Controls request processing priority.

    Declaration
    [JsonProperty("priority")]
    public int? Priority { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    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
    | Edit this page View Source

    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
    | Edit this page View Source

    Seed

    Optional. If specified, will attempt deterministic sampling.

    Declaration
    [JsonProperty("seed")]
    public long? Seed { get; set; }
    Property Value
    Type Description
    long?
    | Edit this page View Source

    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[]
    | Edit this page View Source

    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
    | Edit this page View Source

    StrictTools

    Optional. When true, enforces strict adherence to tool definitions.

    Declaration
    [JsonProperty("strict_tools")]
    public bool? StrictTools { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    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?
    | Edit this page View Source

    Thinking

    Optional. Configuration for reasoning features.

    Declaration
    [JsonProperty("thinking")]
    public ThinkingConfig Thinking { get; set; }
    Property Value
    Type Description
    ThinkingConfig
    | Edit this page View Source

    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
    | Edit this page View Source

    Tools

    Optional. A list of tools (functions) available to the model.

    Declaration
    [JsonProperty("tools")]
    public Tool[] Tools { get; set; }
    Property Value
    Type Description
    Tool[]

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation