AgentState
@Serializable
The state of a toolAgent: the conversation so far, oldest message first, and what it cost.
It is @Serializable, so a checkpointer that uses kotlinx.serialization can save it.
Constructors
Link copied to clipboard
Starts a conversation with question as the user's first message.
Properties
Link copied to clipboard
true when the model reached its output limit before it finished its last message, so answer is cut off.
Link copied to clipboard
Link copied to clipboard
the tokens of every answer of the model in this conversation, as far as the provider reported them. A conversation that continues with withUserMessage keeps counting. Use copy(tokens = TokenUsage()) to start the count again, for example for a budget per question.
Functions
Link copied to clipboard
Returns this state with text added as the user's next message, to continue the conversation.