Skip to main content

agora.common.toolformers.camel

CamelConversation Objects

class CamelConversation(Conversation)

Handles conversations using the Camel AI Toolformer.

__init__

def __init__(toolformer: 'CamelToolformer',
agent: 'camel.agents.ChatAgent',
category: Optional[str] = None) -> None

Initialize the CamelConversation with a Toolformer and ChatAgent.

Arguments:

  • toolformer CamelToolformer - The CamelToolformer instance managing the conversation.
  • agent ChatAgent - The ChatAgent handling the conversation logic.
  • category Optional[str], optional - The category of the conversation. Defaults to None.

Raises:

  • ImportError - If camel-ai is not available.

__call__

def __call__(message: str, print_output: bool = True) -> str

Process a message within the conversation and return the response.

Arguments:

  • message str - The message to process.
  • print_output bool, optional - Whether to print the response. Defaults to True.

Returns:

  • str - The response from the conversation.

CamelToolformer Objects

class CamelToolformer(Toolformer)

Toolformer implementation using the Camel AI framework.

__init__

def __init__(model_platform: 'camel.types.ModelPlatformType',
model_type: 'camel.types.ModelType',
model_config_dict: Optional[dict] = None,
name: Optional[str] = None) -> None

Initialize the CamelToolformer with model details.

Arguments:

  • model_platform ModelPlatformType - The platform of the model (e.g. "openai").
  • model_type ModelPlatformType - The type of the model (e.g. "gpt-4o").
  • model_config_dict dict, optional - Configuration dictionary for the model. Defaults to None (empty dict).
  • name Optional[str], optional - Optional name for the Toolformer. Defaults to None.

Raises:

  • ImportError - If camel-ai is not available.

name

@property
def name() -> str

Get the name of the Toolformer.

Returns:

  • str - The name of the Toolformer.

new_conversation

def new_conversation(prompt: str,
tools: List[ToolLike],
category: Optional[str] = None) -> Conversation

Start a new conversation with the given prompt and tools.

Arguments:

  • prompt str - The initial prompt for the conversation.
  • tools List[ToolLike] - A list of tools to be available in the conversation.
  • category Optional[str], optional - The category of the conversation. Defaults to None.

Returns:

  • Conversation - A Conversation instance managing the interaction.