Skip to main content

module aixplain.modules.team_agent


class TeamAgent

Advanced AI system capable of using multiple agents to perform a variety of tasks.

Attributes:

  • id (Text): ID of the Team Agent
  • name (Text): Name of the Team Agent
  • agents (List[Agent]): List of Agents that the Team Agent uses.
  • description (Text, optional): description of the Team Agent. Defaults to "".
  • llm_id (Text, optional): large language model. Defaults to GPT-4o (6646261c6eb563165658bbb1).
  • supplier (Text): Supplier of the Team Agent.
  • version (Text): Version of the Team Agent.
  • backend_url (str): URL of the backend.
  • api_key (str): The TEAM API key used for authentication.
  • cost (Dict, optional): model price. Defaults to None.
  • use_mentalist_and_inspector (bool): Use Mentalist and Inspector tools. Defaults to True.

method __init__

__init__(
id: str,
name: str,
agents: List[Agent] = [],
description: str = '',
llm_id: str = '6646261c6eb563165658bbb1',
api_key: Optional[str] = 'd0d1ea8a13cfe80dbb34378c3941e5df13d724e1059fa065d1a802dacd4ade15',
supplier: Union[Dict, str, Supplier, int] = 'aiXplain',
version: Optional[str] = None,
cost: Optional[Dict] = None,
use_mentalist_and_inspector: bool = True,
status: AssetStatus = <AssetStatus.ONBOARDING: 'onboarding'>,
**additional_info
)None

Create a FineTune with the necessary information.

Args:

  • id (Text): ID of the Team Agent
  • name (Text): Name of the Team Agent
  • agents (List[Agent]): List of agents that the Team Agent uses.
  • description (Text, optional): description of the Team Agent. Defaults to "".
  • llm_id (Text, optional): large language model. Defaults to GPT-4o (6646261c6eb563165658bbb1).
  • supplier (Text): Supplier of the Team Agent.
  • version (Text): Version of the Team Agent.
  • backend_url (str): URL of the backend.
  • api_key (str): The TEAM API key used for authentication.
  • cost (Dict, optional): model price. Defaults to None.
  • use_mentalist_and_inspector (bool): Use Mentalist and Inspector tools. Defaults to True.

method delete

delete()None

Delete Corpus service


method deploy

deploy()None

Deploy the Team Agent.


method run

run(
data: Optional[Dict, str] = None,
query: Optional[str] = None,
session_id: Optional[str] = None,
history: Optional[List[Dict]] = None,
name: str = 'model_process',
timeout: float = 300,
parameters: Dict = {},
wait_time: float = 0.5,
content: Optional[Dict[str, str], List[str]] = None,
max_tokens: int = 2048,
max_iterations: int = 30,
output_format: OutputFormat = <OutputFormat.TEXT: 'text'>
) → Dict

Runs a team agent call.

Args:

  • data (Optional[Union[Dict, Text]], optional): data to be processed by the team agent. Defaults to None.
  • query (Optional[Text], optional): query to be processed by the team agent. Defaults to None.
  • session_id (Optional[Text], optional): conversation Session ID. Defaults to None.
  • history (Optional[List[Dict]], optional): chat history (in case session ID is None). Defaults to None.
  • name (Text, optional): ID given to a call. Defaults to "model_process".
  • timeout (float, optional): total polling time. Defaults to 300.
  • parameters (Dict, optional): optional parameters to the model. Defaults to "".
  • wait_time (float, optional): wait time in seconds between polling calls. Defaults to 0.5.
  • content (Union[Dict[Text, Text], List[Text]], optional): Content inputs to be processed according to the query. Defaults to None.
  • max_tokens (int, optional): maximum number of tokens which can be generated by the agents. Defaults to 2048.
  • max_iterations (int, optional): maximum number of iterations between the agents. Defaults to 30.
  • output_format (ResponseFormat, optional): response format. Defaults to TEXT.

Returns:

  • Dict: parsed output from model

method run_async

run_async(
data: Optional[Dict, str] = None,
query: Optional[str] = None,
session_id: Optional[str] = None,
history: Optional[List[Dict]] = None,
name: str = 'model_process',
parameters: Dict = {},
content: Optional[Dict[str, str], List[str]] = None,
max_tokens: int = 2048,
max_iterations: int = 30,
output_format: OutputFormat = <OutputFormat.TEXT: 'text'>
) → Dict

Runs asynchronously a Team Agent call.

Args:

  • data (Optional[Union[Dict, Text]], optional): data to be processed by the Team Agent. Defaults to None.
  • query (Optional[Text], optional): query to be processed by the Team Agent. Defaults to None.
  • session_id (Optional[Text], optional): conversation Session ID. Defaults to None.
  • history (Optional[List[Dict]], optional): chat history (in case session ID is None). Defaults to None.
  • name (Text, optional): ID given to a call. Defaults to "model_process".
  • parameters (Dict, optional): optional parameters to the model. Defaults to "".
  • content (Union[Dict[Text, Text], List[Text]], optional): Content inputs to be processed according to the query. Defaults to None.
  • max_tokens (int, optional): maximum number of tokens which can be generated by the agents. Defaults to 2048.
  • max_iterations (int, optional): maximum number of iterations between the agents. Defaults to 30.
  • output_format (ResponseFormat, optional): response format. Defaults to TEXT.

Returns:

  • dict: polling URL in response

method to_dict

to_dict() → Dict

method update

update()None

Update the Team Agent.


method validate

validate()None

Validate the Team.