Skip to content

tinker_cookbook.tool_use.AgentToolMessageEnv

class tinker_cookbook.tool_use.AgentToolMessageEnv(MessageEnv)

Generic tool-use MessageEnv for agents.

Fields:

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