agents.simple.factoryΒΆ
Utility functions for creating and using SimpleAgent.
This module provides helper functions for easily creating SimpleAgent instances with various configurations.
FunctionsΒΆ
|
Create a SimpleAgent with the specified configuration. |
Module ContentsΒΆ
- agents.simple.factory.create_simple_agent(name='simple_agent', engine=None, state_schema=SimpleAgentState, system_prompt='You are a helpful assistant.', prompt_template=None, input_mapping=None, output_mapping=None, model='gpt-4o', debug=False, preserve_model=True)ΒΆ
Create a SimpleAgent with the specified configuration.
- Parameters:
name (str) β Name of the agent
engine (haive.core.engine.aug_llm.AugLLMConfig | None) β LLM engine to use (created if not provided)
state_schema (type[pydantic.BaseModel]) β Schema for agent state (default: SimpleAgentState)
system_prompt (str) β System prompt for the LLM
prompt_template (str | langchain_core.prompts.ChatPromptTemplate | None) β Custom prompt template (string or ChatPromptTemplate)
input_mapping (dict[str, str] | None) β Mapping from state to engine inputs
output_mapping (dict[str, str] | None) β Mapping from engine outputs to state
model (str) β Model to use if creating engine
debug (bool) β Enable debug mode
preserve_model (bool) β Whether to preserve BaseModel instances
- Returns:
Configured SimpleAgent instance
- Return type:
haive.agents.simple.agent.SimpleAgent