Optional contextIf specified, context will be inserted into messages. Depending on the model, context may be inserted
into the content with system role; or into the content of the last message of user role.
In the example, context "Today is Wednesday" is inserted as such
content of user becomes "Today is Wednesday. Who are you and which day is tomorrow?".
Optional frequencyPositive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
Optional headersThe id_or_name can be either the deployment_id that identifies the deployment or a serving_name that
allows a predefined URL to be used to post a prediction. The deployment must reference a prompt template with
input_mode chat.
The WML instance that is associated with the deployment will be used for limits and billing (if a paid plan).
Optional includeWhether to include reasoning_content in the response. Default is true.
Optional lengthExponential penalty to the length that is used with beam-based generation.
It is applied as an exponent to the sequence length, which in turn is used to divide the score of the sequence.
Since the score is the log likelihood of the sequence (i.e. negative), lengthPenalty > 0.0 promotes longer sequences,
while lengthPenalty < 0.0 encourages shorter sequences.
Optional logitIncreasing or decreasing probability of tokens being selected during generation; a positive bias makes a token more likely to appear, while a negative bias makes it less likely.
Optional logprobsWhether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
Optional maxThe maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. Set to 0 for the model's configured max generated tokens.
Optional maxThe maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. Set to 0 for the model's configured max generated tokens. This value is now deprecated in favor of maxCompletionTokens. If specified together with maxCompletionTokens, maxTokens will be ignored.
The messages for this chat session. You cannot specify system role in the messages. Depending on the
model, the content of system role may be from system_prompt of the prompt template, and will be
automatically inserted into messages.
As an example, depending on the model, if system_prompt of a prompt template is "You are Granite Chat, an AI
language model developed by IBM. You are a cautious assistant. You carefully follow instructions. You are
helpful and harmless and you follow ethical guidelines and promote positive behavior.", a message with system
role having content the same as system_prompt is inserted.
Optional nHow many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
Optional presencePositive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
Optional reasoningA lower reasoning effort can result in faster responses, fewer tokens used, and shorter reasoning_content in the responses. Supported values are low, medium, and high.
Optional repetitionRepresents the penalty for penalizing tokens that have already been generated or belong to the context.
Optional responseThe chat response format parameters.
Optional returnOptional seedRandom number generator seed to use in sampling mode for experimental repeatability.
Optional signalOptional stopStop sequences are one or more strings which will cause the text generation to stop if/when they are produced as part of the output. Stop sequences encountered prior to the minimum number of tokens being generated will be ignored.
Optional temperatureWhat sampling temperature to use,. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
We generally recommend altering this or top_p but not both.
Optional timeTime limit in milliseconds - if not completed within this time, generation will stop. The text generated so far will be returned along with the `TIME_LIMIT`` stop reason. Depending on the users plan, and on the model being used, there may be an enforced maximum time limit.
Optional toolSpecifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the
model to call that tool.
Only one of tool_choice_option or tool_choice must be present.
Optional toolUsing none means the model will not call any tool and instead generates a message.
The following options (auto and required) are not yet supported.
Using auto means the model can pick between generating a message or calling one or more tools. Using
required means the model must call one or more tools.
Only one of tool_choice_option or tool_choice must be present.
Optional toolsOptional topAn integer specifying the number of most likely tokens to return at each token position, each with an
associated log probability. The option logprobs must be set to true if this parameter is used.
Optional topPAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
Parameters for the
deploymentsTextChatStreamoperation.