mistral_common.protocol.base
BaseCompletionRequest(**data)
Bases: MistralBase
Base class for completion requests.
Attributes:
Name | Type | Description |
---|---|---|
temperature |
float
|
Sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. |
top_p |
float
|
Nucleus sampling parameter, top-p probability mass, between 0 and 1. |
max_tokens |
Optional[int]
|
Maximum number of tokens to generate. |
random_seed |
Optional[int]
|
Random seed for reproducibility. |
Examples:
Source code in .venv/lib/python3.13/site-packages/pydantic/main.py
UsageInfo(**data)
Bases: MistralBase
Usage statistics for a completion request.
Attributes:
Name | Type | Description |
---|---|---|
prompt_tokens |
int
|
Number of tokens in the prompt. |
completion_tokens |
Optional[int]
|
Number of tokens in the generated completion. |
total_tokens |
int
|
Total number of tokens used in the request (prompt + completion). |
Examples: