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:
toolformerCamelToolformer - The CamelToolformer instance managing the conversation.agentChatAgent - The ChatAgent handling the conversation logic.categoryOptional[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:
messagestr - The message to process.print_outputbool, 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_platformModelPlatformType - The platform of the model (e.g. "openai").model_typeModelPlatformType - The type of the model (e.g. "gpt-4o").model_config_dictdict, optional - Configuration dictionary for the model. Defaults to None (empty dict).nameOptional[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:
promptstr - The initial prompt for the conversation.toolsList[ToolLike] - A list of tools to be available in the conversation.categoryOptional[str], optional - The category of the conversation. Defaults to None.
Returns:
Conversation- A Conversation instance managing the interaction.