tinker_cookbook.tool_use.AgentToolMessageEnv
class tinker_cookbook.tool_use.AgentToolMessageEnv(MessageEnv)
Generic tool-use MessageEnv for agents.
Fields:
- tools (list[Tool])
- initial_messages (list[Message])
- max_turns (int)
- reward_fn (RewardFn)
- history (list[Message], default:
field(default_factory=list))
step(message)
Execute any tools and return next messages.
The episode ends when:
- no tool calls in message (model decided to stop)
- a tool returns should_stop=True
- max_turns reached
reward_fn is called once at episode end to grade the full trajectory.
Parameters:
Returns: MessageStepResult