Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 20.2 KB

agentscompletionstreamrequest.md

File metadata and controls

35 lines (30 loc) · 20.2 KB

AgentsCompletionStreamRequest

Example Usage

import { AgentsCompletionStreamRequest } from "@mistralai/mistralai/models/components";

let value: AgentsCompletionStreamRequest = {
  messages: [
    {
      content: "Who is the best French painter? Answer in one short sentence.",
      role: "user",
    },
  ],
  agentId: "<id>",
};

Fields

Field Type Required Description Example
maxTokens number The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length.
stream boolean N/A
stop components.AgentsCompletionStreamRequestStop Stop generation if this token is detected. Or if one of these tokens is detected when providing an array
randomSeed number The seed to use for random sampling. If set, different calls will generate deterministic results.
messages components.AgentsCompletionStreamRequestMessages[] ✔️ The prompt(s) to generate completions for, encoded as a list of dict with role and content. [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
]
responseFormat components.ResponseFormat N/A
tools components.Tool[] N/A
toolChoice components.AgentsCompletionStreamRequestToolChoice N/A
presencePenalty number presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.
frequencyPenalty number frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.
n number Number of completions to return for each request, input tokens are only billed once.
prediction components.Prediction N/A
agentId string ✔️ The ID of the agent to use for this completion.