Skip to main content

module aixplain.factories.agent_factory


class AgentFactory


classmethod create

create(
name: str,
description: str,
llm_id: str = '669a63646eb56306647e1091',
tools: List[Tool] = [],
api_key: str = 'd0d1ea8a13cfe80dbb34378c3941e5df13d724e1059fa065d1a802dacd4ade15',
supplier: Union[Dict, str, Supplier, int] = 'aiXplain',
version: Optional[str] = None
) → Agent

Create a new agent in the platform.

Args:

  • name (Text): name of the agent
  • description (Text): description of the agent role.
  • llm_id (Text, optional): aiXplain ID of the large language model to be used as agent. Defaults to "669a63646eb56306647e1091" (GPT-4o mini).
  • tools (List[Tool], optional): list of tool for the agent. Defaults to [].
  • api_key (Text, optional): team/user API key. Defaults to config.TEAM_API_KEY.
  • supplier (Union[Dict, Text, Supplier, int], optional): owner of the agent. Defaults to "aiXplain".
  • version (Optional[Text], optional): version of the agent. Defaults to None.

Returns:

  • Agent: created Agent

classmethod create_model_tool

create_model_tool(
model: Optional[str, Model] = None,
function: Optional[Function, str] = None,
supplier: Optional[Supplier, str] = None,
description: str = ''
) → ModelTool

Create a new model tool.


classmethod create_pipeline_tool

create_pipeline_tool(
description: str,
pipeline: Union[Pipeline, str]
) → PipelineTool

Create a new pipeline tool.


classmethod get

get(agent_id: str, api_key: Optional[str] = None) → Agent

Get agent by id.


classmethod list

list() → Dict

List all agents available in the platform.