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_simple_agent([name, engine, state_schema, ...])

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