agents.react_class.react_v2.configΒΆ

Configuration for the ReactAgent.

ClassesΒΆ

ReactAgentConfig

Configuration for a React agent that can use tools and follow ReAct reasoning pattern.

Module ContentsΒΆ

class agents.react_class.react_v2.config.ReactAgentConfigΒΆ

Bases: haive.agents.simple.config.SimpleAgentConfig

Configuration for a React agent that can use tools and follow ReAct reasoning pattern.

classmethod from_tools(tools, model='gpt-4o', system_prompt=None, name=None, temperature=0.7, parallel_tool_execution=False, max_iterations=10, max_retries=3, **kwargs)ΒΆ

Create a ReactAgentConfig with tools from scratch.

Parameters:
  • tools (ToolsInput) – Tools to use (list or dict)

  • model (str) – Model name to use

  • system_prompt (str | None) – Optional system prompt

  • name (str | None) – Optional agent name

  • temperature (float) – Temperature for generation

  • parallel_tool_execution (bool) – Whether to execute tools in parallel

  • max_iterations (int) – Maximum number of reasoning iterations

  • max_retries (int) – Maximum number of retries for tool failures

  • **kwargs – Additional kwargs for the config

Returns:

ReactAgentConfig instance

Return type:

ReactAgentConfig

classmethod validate_tools(v)ΒΆ

Validate that tools are properly configured.

Return type:

Any

classmethod with_structured_output(model_class, tools, system_prompt=None, name=None, parallel_tool_execution=False, **kwargs)ΒΆ

Create a ReactAgentConfig with structured output and tools.

Parameters:
  • model_class (type[pydantic.BaseModel]) – Pydantic model class for structured output

  • tools (ToolsInput) – Tools to use (list or dict)

  • system_prompt (str | None) – Optional system prompt

  • name (str | None) – Optional agent name

  • parallel_tool_execution (bool) – Whether to execute tools in parallel

  • **kwargs – Additional kwargs for the config

Returns:

ReactAgentConfig instance

Return type:

ReactAgentConfig