AssistantTurn
AssistantTurn(
contents,
*,
tokens=None,
finish_reason=None,
completion=None,
**kwargs,
)Assistant turn - represents model response with additional metadata
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| contents | str | Sequence[Content | str] | A list of Content objects. |
required |
| tokens | Optional[tuple[int, int, int] | list[int]] | A numeric vector of length 3 representing the number of input, output, and cached tokens (respectively) used in this turn. | None |
| finish_reason | Optional[str] | A string indicating the reason why the conversation ended. | None |
| completion | Optional[CompletionT] |
The completion object returned by the provider. This is useful if there’s information returned by the provider that chatlas doesn’t otherwise expose. | None |
See Also
Turn: The base class for all turn types.
Methods
| Name | Description |
|---|---|
| validate_tokens | Convert list to tuple for JSON deserialization compatibility. |
validate_tokens
AssistantTurn.validate_tokens(v)Convert list to tuple for JSON deserialization compatibility.