build_agent_tool_env - Tinker Documentation

tinker_cookbook.tool_use.build_agent_tool_env

tinker_cookbook.tool_use.build_agent_tool_env( renderer, tools, initial_messages, reward_fn, rollout_config, model_name, max_turns, failed_parse_reward, terminate_on_parse_error, max_tool_calls, max_trajectory_tokens, max_generation_tokens, context_overflow_reward, terminate_on_length, parse_error_policy)

Convenience method to build an EnvFromMessageEnv for tool-using agents.

The primary configuration surface is rollout_config: one composite ~tinker_cookbook.rl.rollout_presets.RolloutConfig (e.g. from ~tinker_cookbook.rl.rollout_presets.simple or ~tinker_cookbook.rl.rollout_presets.agentic) that drives the env-side knobs here, the runner-side budgets when the same config is passed to run_rollout, and the reward semantics when its termination is passed to do_group_rollout. The individual keyword arguments below remain supported; where both are given, the explicit keyword wins.

Parameters:

Returns: An EnvFromMessageEnv ready for RL training.