aixplain.modules.agent.utils
process_variables
def process_variables(query: Union[Text, Dict], data: Union[Dict, Text],
parameters: Dict,
agent_description: Union[Text, None]) -> Text
Process variables in an agent's description and input data.
This function validates and processes variables in an agent's description and input data, ensuring that all required variables are present and properly formatted.
Arguments:
queryUnion[Text, Dict] - The input data provided to the agent.dataUnion[Dict, Text] - The data to be processed.parametersDict - The parameters available to the agent.agent_descriptionUnion[Text, None] - The description of the agent.
Returns:
Text- The processed input data with all required variables included.
Raises:
AssertionError- If a required variable is not found in the data or parameters.
validate_history
def validate_history(history)
Validates that history is a list of dicts, each with 'role' and 'content' keys.
Raises a ValueError if validation fails.