agents.react_class.react_v2.configΒΆ
Configuration for the ReactAgent.
ClassesΒΆ
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:
- 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: