/** * Generative AI Service Inference API * OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings. Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to {@link #eNGenerative-ai-inferenceLatestChatResultChat(ENGenerative-ai-inferenceLatestChatResultChatRequest) eNGenerative-ai-inferenceLatestChatResultChat}, {@link #eNGenerative-ai-inferenceLatestGenerateTextResultGenerateText(ENGenerative-ai-inferenceLatestGenerateTextResultGenerateTextRequest) eNGenerative-ai-inferenceLatestGenerateTextResultGenerateText}, {@link #eNGenerative-ai-inferenceLatestSummarizeTextResultSummarizeText(ENGenerative-ai-inferenceLatestSummarizeTextResultSummarizeTextRequest) eNGenerative-ai-inferenceLatestSummarizeTextResultSummarizeText}, and {@link #eNGenerative-ai-inferenceLatestEmbedTextResultEmbedText(ENGenerative-ai-inferenceLatestEmbedTextResultEmbedTextRequest) eNGenerative-ai-inferenceLatestEmbedTextResultEmbedText}. To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the {@link #eNGenerative-aiLatest(ENGenerative-aiLatestRequest) eNGenerative-aiLatest} to {@link #eNGenerative-aiLatestModel(ENGenerative-aiLatestModelRequest) eNGenerative-aiLatestModel} by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a {@link #eNGenerative-aiLatestDedicatedAiCluster(ENGenerative-aiLatestDedicatedAiClusterRequest) eNGenerative-aiLatestDedicatedAiCluster}. Then, create a {@link #eNGenerative-aiLatestDedicatedAiCluster(ENGenerative-aiLatestDedicatedAiClusterRequest) eNGenerative-aiLatestDedicatedAiCluster} with an {@link Endpoint} to host your custom model. For resource management in the Generative AI service, use the {@link #eNGenerative-aiLatest(ENGenerative-aiLatestRequest) eNGenerative-aiLatest}. To learn more about the service, see the [Generative AI documentation](https://docs.oracle.com/iaas/Content/generative-ai/home.htm). **Important:** The IP addresses behind each DNS endpoint might change over time. Always use the DNS hostname listed under the following **API Endpoints** section and avoid using hard-coded fixed IP addresses. * OpenAPI spec version: 20231130 * * * NOTE: This class is auto generated by OracleSDKGenerator. * Do not edit the class manually. * * Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved. * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. */ import * as model from "../model"; /** * Details for the chat request for Cohere models. */ export interface CohereChatRequest extends model.BaseChatRequest { /** * The text that the user inputs for the model to respond to. */ "message": string; /** * 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. */ "chatHistory"?: Array; /** * 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. *

Example: * {@code [ * { \"title\": \"Tall penguins\", \"snippet\": \"Emperor penguins are the tallest.\" }, * { \"title\": \"Penguin habitats\", \"snippet\": \"Emperor penguins only live in Antarctica.\" } * ]} * */ "documents"?: Array; "responseFormat"?: model.CohereResponseTextFormat | model.CohereResponseJsonFormat; /** * 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. * */ "isSearchQueriesOnly"?: boolean; /** * 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. *

Example: {@code You are a travel advisor. Answer with a pirate tone.} * */ "preambleOverride"?: string; /** * 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. */ "isStream"?: boolean; "streamOptions"?: model.StreamOptions; /** * The maximum number of output tokens that the model will generate for the response. The token count of your prompt plus maxTokens must not exceed the model's context length. For on-demand inferencing, the response length is capped at 4,000 tokens for each run. * Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "maxTokens"?: number; /** * The maximum number of input tokens to send to the model. If not specified, max_input_tokens is the model's context length limit minus a small buffer. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "maxInputTokens"?: number; /** * 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. * Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "temperature"?: number; /** * 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. *

If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20 but only the probabilities of the top 10 add up to the value of p, then only the top 10 tokens are chosen. * Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "topK"?: number; /** * If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. *

To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1.0 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k. * Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "topP"?: number; /** * Defaults to OFF. Dictates how the prompt will be constructed. With {@code promptTruncation} set to AUTO_PRESERVE_ORDER, some elements from {@code chatHistory} and {@code documents} will be dropped to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved. With {@code prompt_truncation} set to OFF, no elements will be dropped. * */ "promptTruncation"?: CohereChatRequest.PromptTruncation; /** * 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. * Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "frequencyPenalty"?: number; /** * 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. *

Similar to frequency penalty, a penalty is applied to previously present tokens, except that this penalty is applied equally to all tokens that have already appeared, regardless of how many times they've appeared. Set to 0 to disable. * Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "presencePenalty"?: number; /** * If specified, the backend will make a best effort to sample tokens deterministically, so that repeated requests with the same seed and parameters yield the same result. However, determinism cannot be fully guaranteed. * Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues. */ "seed"?: number; /** * Returns the full prompt that was sent to the model when True. */ "isEcho"?: boolean; /** * A list of available tools (functions) that the model may suggest invoking before producing a text response. */ "tools"?: Array; /** * A list of results from invoking tools recommended by the model in the previous chat turn. */ "toolResults"?: Array; /** * 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. * */ "isForceSingleStep"?: boolean; /** * Stop the model generation when it reaches a stop sequence defined in this parameter. */ "stopSequences"?: Array; /** * When enabled, the user\u2019s {@code message} will be sent to the model without any preprocessing. */ "isRawPrompting"?: boolean; /** * 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. * */ "citationQuality"?: CohereChatRequest.CitationQuality; /** * Safety mode: Adds a safety instruction for the model to use when generating responses. * Contextual: (Default) Puts fewer constraints on the output. It maintains core protections by aiming to reject harmful or illegal suggestions, but it allows profanity and some toxic content, sexually explicit and violent content, and content that contains medical, financial, or legal information. Contextual mode is suited for entertainment, creative, or academic use. * Strict: Aims to avoid sensitive topics, such as violent or sexual acts and profanity. This mode aims to provide a safer experience by prohibiting responses or recommendations that it finds inappropriate. Strict mode is suited for corporate use, such as for corporate communications and customer service. * Off: No safety mode is applied. * Note: This parameter is only compatible with models cohere.command-r-08-2024, cohere.command-r-plus-08-2024 and Cohere models released after these models. See [release dates](https://docs.oracle.com/iaas/Content/generative-ai/deprecating.htm). * */ "safetyMode"?: CohereChatRequest.SafetyMode; "apiFormat": string; } export declare namespace CohereChatRequest { enum PromptTruncation { Off = "OFF", AutoPreserveOrder = "AUTO_PRESERVE_ORDER" } enum CitationQuality { Accurate = "ACCURATE", Fast = "FAST" } enum SafetyMode { Contextual = "CONTEXTUAL", Strict = "STRICT", Off = "OFF" } function getJsonObj(obj: CohereChatRequest, isParentJsonObj?: boolean): object; const apiFormat = "COHERE"; function getDeserializedJsonObj(obj: CohereChatRequest, isParentJsonObj?: boolean): object; }