camel package#
Subpackages#
- camel.agents package
- Subpackages
- Submodules
- camel.agents.base module
- camel.agents.chat_agent module
ChatAgent
ChatAgent.get_info()
ChatAgent.get_usage_dict()
ChatAgent.handle_batch_response()
ChatAgent.handle_stream_response()
ChatAgent.init_messages()
ChatAgent.is_tools_added()
ChatAgent.record_message()
ChatAgent.reset()
ChatAgent.set_output_language()
ChatAgent.step()
ChatAgent.step_async()
ChatAgent.step_tool_call()
ChatAgent.step_tool_call_async()
ChatAgent.system_message
ChatAgent.update_memory()
FunctionCallingRecord
FunctionCallingRecord.func_name
FunctionCallingRecord.args
FunctionCallingRecord.result
FunctionCallingRecord.args
FunctionCallingRecord.as_dict()
FunctionCallingRecord.func_name
FunctionCallingRecord.model_computed_fields
FunctionCallingRecord.model_config
FunctionCallingRecord.model_fields
FunctionCallingRecord.result
- camel.agents.critic_agent module
- camel.agents.deductive_reasoner_agent module
- camel.agents.embodied_agent module
- camel.agents.knowledge_graph_agent module
- camel.agents.role_assignment_agent module
- camel.agents.search_agent module
- camel.agents.task_agent module
- Module contents
BaseAgent
BaseToolAgent
ChatAgent
ChatAgent.get_info()
ChatAgent.get_usage_dict()
ChatAgent.handle_batch_response()
ChatAgent.handle_stream_response()
ChatAgent.init_messages()
ChatAgent.is_tools_added()
ChatAgent.record_message()
ChatAgent.reset()
ChatAgent.set_output_language()
ChatAgent.step()
ChatAgent.step_async()
ChatAgent.step_tool_call()
ChatAgent.step_tool_call_async()
ChatAgent.system_message
ChatAgent.update_memory()
CriticAgent
EmbodiedAgent
HuggingFaceToolAgent
KnowledgeGraphAgent
RoleAssignmentAgent
SearchAgent
TaskCreationAgent
TaskPlannerAgent
TaskPrioritizationAgent
TaskSpecifyAgent
TaskSpecifyAgent.DEFAULT_WORD_LIMIT
TaskSpecifyAgent.task_specify_prompt
TaskSpecifyAgent.DEFAULT_WORD_LIMIT
TaskSpecifyAgent.memory
TaskSpecifyAgent.model_backend
TaskSpecifyAgent.orig_sys_message
TaskSpecifyAgent.output_language
TaskSpecifyAgent.role_name
TaskSpecifyAgent.role_type
TaskSpecifyAgent.run()
TaskSpecifyAgent.task_specify_prompt
TaskSpecifyAgent.terminated
- camel.configs package
- Submodules
- camel.configs.anthropic_config module
- camel.configs.base_config module
- camel.configs.gemini_config module
GeminiConfig
GeminiConfig.candidate_count
GeminiConfig.max_output_tokens
GeminiConfig.model_computed_fields
GeminiConfig.model_config
GeminiConfig.model_fields
GeminiConfig.model_type_checking()
GeminiConfig.request_options
GeminiConfig.response_mime_type
GeminiConfig.response_schema
GeminiConfig.safety_settings
GeminiConfig.stop_sequences
GeminiConfig.temperature
GeminiConfig.tool_config
GeminiConfig.top_k
GeminiConfig.top_p
- camel.configs.groq_config module
GroqConfig
GroqConfig.frequency_penalty
GroqConfig.max_tokens
GroqConfig.model_computed_fields
GroqConfig.model_config
GroqConfig.model_fields
GroqConfig.n
GroqConfig.presence_penalty
GroqConfig.response_format
GroqConfig.stop
GroqConfig.stream
GroqConfig.temperature
GroqConfig.tool_choice
GroqConfig.top_p
GroqConfig.user
- camel.configs.litellm_config module
LiteLLMConfig
LiteLLMConfig.api_version
LiteLLMConfig.custom_llm_provider
LiteLLMConfig.deployment_id
LiteLLMConfig.extra_headers
LiteLLMConfig.frequency_penalty
LiteLLMConfig.logit_bias
LiteLLMConfig.logprobs
LiteLLMConfig.max_retries
LiteLLMConfig.max_tokens
LiteLLMConfig.mock_response
LiteLLMConfig.model_computed_fields
LiteLLMConfig.model_config
LiteLLMConfig.model_fields
LiteLLMConfig.n
LiteLLMConfig.presence_penalty
LiteLLMConfig.response_format
LiteLLMConfig.seed
LiteLLMConfig.stop
LiteLLMConfig.stream
LiteLLMConfig.stream_options
LiteLLMConfig.temperature
LiteLLMConfig.timeout
LiteLLMConfig.tool_choice
LiteLLMConfig.top_logprobs
LiteLLMConfig.top_p
LiteLLMConfig.user
- camel.configs.mistral_config module
MistralConfig
MistralConfig.fields_type_checking()
MistralConfig.max_tokens
MistralConfig.min_tokens
MistralConfig.model_computed_fields
MistralConfig.model_config
MistralConfig.model_fields
MistralConfig.random_seed
MistralConfig.response_format
MistralConfig.safe_prompt
MistralConfig.stop
MistralConfig.temperature
MistralConfig.tool_choice
MistralConfig.top_p
- camel.configs.ollama_config module
- camel.configs.openai_config module
ChatGPTConfig
ChatGPTConfig.frequency_penalty
ChatGPTConfig.logit_bias
ChatGPTConfig.max_tokens
ChatGPTConfig.model_computed_fields
ChatGPTConfig.model_config
ChatGPTConfig.model_fields
ChatGPTConfig.n
ChatGPTConfig.presence_penalty
ChatGPTConfig.response_format
ChatGPTConfig.stop
ChatGPTConfig.stream
ChatGPTConfig.temperature
ChatGPTConfig.tool_choice
ChatGPTConfig.top_p
ChatGPTConfig.user
- camel.configs.reka_config module
- camel.configs.samba_config module
SambaCloudAPIConfig
SambaCloudAPIConfig.frequency_penalty
SambaCloudAPIConfig.logit_bias
SambaCloudAPIConfig.max_tokens
SambaCloudAPIConfig.model_computed_fields
SambaCloudAPIConfig.model_config
SambaCloudAPIConfig.model_fields
SambaCloudAPIConfig.n
SambaCloudAPIConfig.presence_penalty
SambaCloudAPIConfig.response_format
SambaCloudAPIConfig.stop
SambaCloudAPIConfig.stream
SambaCloudAPIConfig.temperature
SambaCloudAPIConfig.tool_choice
SambaCloudAPIConfig.top_p
SambaCloudAPIConfig.user
SambaVerseAPIConfig
SambaVerseAPIConfig.as_dict()
SambaVerseAPIConfig.max_tokens
SambaVerseAPIConfig.model_computed_fields
SambaVerseAPIConfig.model_config
SambaVerseAPIConfig.model_fields
SambaVerseAPIConfig.repetition_penalty
SambaVerseAPIConfig.stop
SambaVerseAPIConfig.stream
SambaVerseAPIConfig.temperature
SambaVerseAPIConfig.top_k
SambaVerseAPIConfig.top_p
- camel.configs.togetherai_config module
TogetherAIConfig
TogetherAIConfig.as_dict()
TogetherAIConfig.frequency_penalty
TogetherAIConfig.logit_bias
TogetherAIConfig.max_tokens
TogetherAIConfig.model_computed_fields
TogetherAIConfig.model_config
TogetherAIConfig.model_fields
TogetherAIConfig.n
TogetherAIConfig.presence_penalty
TogetherAIConfig.response_format
TogetherAIConfig.stop
TogetherAIConfig.stream
TogetherAIConfig.temperature
TogetherAIConfig.top_p
TogetherAIConfig.user
- camel.configs.vllm_config module
VLLMConfig
VLLMConfig.frequency_penalty
VLLMConfig.logit_bias
VLLMConfig.max_tokens
VLLMConfig.model_computed_fields
VLLMConfig.model_config
VLLMConfig.model_fields
VLLMConfig.n
VLLMConfig.presence_penalty
VLLMConfig.response_format
VLLMConfig.stop
VLLMConfig.stream
VLLMConfig.temperature
VLLMConfig.top_p
VLLMConfig.user
- camel.configs.zhipuai_config module
- Module contents
AnthropicConfig
BaseConfig
ChatGPTConfig
ChatGPTConfig.frequency_penalty
ChatGPTConfig.logit_bias
ChatGPTConfig.max_tokens
ChatGPTConfig.model_computed_fields
ChatGPTConfig.model_config
ChatGPTConfig.model_fields
ChatGPTConfig.n
ChatGPTConfig.presence_penalty
ChatGPTConfig.response_format
ChatGPTConfig.stop
ChatGPTConfig.stream
ChatGPTConfig.temperature
ChatGPTConfig.tool_choice
ChatGPTConfig.tools
ChatGPTConfig.top_p
ChatGPTConfig.user
GeminiConfig
GeminiConfig.candidate_count
GeminiConfig.max_output_tokens
GeminiConfig.model_computed_fields
GeminiConfig.model_config
GeminiConfig.model_fields
GeminiConfig.model_type_checking()
GeminiConfig.request_options
GeminiConfig.response_mime_type
GeminiConfig.response_schema
GeminiConfig.safety_settings
GeminiConfig.stop_sequences
GeminiConfig.temperature
GeminiConfig.tool_config
GeminiConfig.tools
GeminiConfig.top_k
GeminiConfig.top_p
GroqConfig
GroqConfig.frequency_penalty
GroqConfig.max_tokens
GroqConfig.model_computed_fields
GroqConfig.model_config
GroqConfig.model_fields
GroqConfig.n
GroqConfig.presence_penalty
GroqConfig.response_format
GroqConfig.stop
GroqConfig.stream
GroqConfig.temperature
GroqConfig.tool_choice
GroqConfig.tools
GroqConfig.top_p
GroqConfig.user
LiteLLMConfig
LiteLLMConfig.api_version
LiteLLMConfig.custom_llm_provider
LiteLLMConfig.deployment_id
LiteLLMConfig.extra_headers
LiteLLMConfig.frequency_penalty
LiteLLMConfig.logit_bias
LiteLLMConfig.logprobs
LiteLLMConfig.max_retries
LiteLLMConfig.max_tokens
LiteLLMConfig.mock_response
LiteLLMConfig.model_computed_fields
LiteLLMConfig.model_config
LiteLLMConfig.model_fields
LiteLLMConfig.n
LiteLLMConfig.presence_penalty
LiteLLMConfig.response_format
LiteLLMConfig.seed
LiteLLMConfig.stop
LiteLLMConfig.stream
LiteLLMConfig.stream_options
LiteLLMConfig.temperature
LiteLLMConfig.timeout
LiteLLMConfig.tool_choice
LiteLLMConfig.tools
LiteLLMConfig.top_logprobs
LiteLLMConfig.top_p
LiteLLMConfig.user
MistralConfig
MistralConfig.fields_type_checking()
MistralConfig.max_tokens
MistralConfig.min_tokens
MistralConfig.model_computed_fields
MistralConfig.model_config
MistralConfig.model_fields
MistralConfig.random_seed
MistralConfig.response_format
MistralConfig.safe_prompt
MistralConfig.stop
MistralConfig.temperature
MistralConfig.tool_choice
MistralConfig.tools
MistralConfig.top_p
OllamaConfig
OllamaConfig.frequency_penalty
OllamaConfig.max_tokens
OllamaConfig.model_computed_fields
OllamaConfig.model_config
OllamaConfig.model_fields
OllamaConfig.presence_penalty
OllamaConfig.response_format
OllamaConfig.stop
OllamaConfig.stream
OllamaConfig.temperature
OllamaConfig.tools
OllamaConfig.top_p
QwenConfig
RekaConfig
RekaConfig.as_dict()
RekaConfig.frequency_penalty
RekaConfig.max_tokens
RekaConfig.model_computed_fields
RekaConfig.model_config
RekaConfig.model_fields
RekaConfig.presence_penalty
RekaConfig.seed
RekaConfig.stop
RekaConfig.temperature
RekaConfig.tools
RekaConfig.top_k
RekaConfig.top_p
RekaConfig.use_search_engine
SambaCloudAPIConfig
SambaCloudAPIConfig.frequency_penalty
SambaCloudAPIConfig.logit_bias
SambaCloudAPIConfig.max_tokens
SambaCloudAPIConfig.model_computed_fields
SambaCloudAPIConfig.model_config
SambaCloudAPIConfig.model_fields
SambaCloudAPIConfig.n
SambaCloudAPIConfig.presence_penalty
SambaCloudAPIConfig.response_format
SambaCloudAPIConfig.stop
SambaCloudAPIConfig.stream
SambaCloudAPIConfig.temperature
SambaCloudAPIConfig.tool_choice
SambaCloudAPIConfig.tools
SambaCloudAPIConfig.top_p
SambaCloudAPIConfig.user
SambaVerseAPIConfig
SambaVerseAPIConfig.as_dict()
SambaVerseAPIConfig.max_tokens
SambaVerseAPIConfig.model_computed_fields
SambaVerseAPIConfig.model_config
SambaVerseAPIConfig.model_fields
SambaVerseAPIConfig.repetition_penalty
SambaVerseAPIConfig.stop
SambaVerseAPIConfig.stream
SambaVerseAPIConfig.temperature
SambaVerseAPIConfig.tools
SambaVerseAPIConfig.top_k
SambaVerseAPIConfig.top_p
TogetherAIConfig
TogetherAIConfig.as_dict()
TogetherAIConfig.frequency_penalty
TogetherAIConfig.logit_bias
TogetherAIConfig.max_tokens
TogetherAIConfig.model_computed_fields
TogetherAIConfig.model_config
TogetherAIConfig.model_fields
TogetherAIConfig.n
TogetherAIConfig.presence_penalty
TogetherAIConfig.response_format
TogetherAIConfig.stop
TogetherAIConfig.stream
TogetherAIConfig.temperature
TogetherAIConfig.tools
TogetherAIConfig.top_p
TogetherAIConfig.user
VLLMConfig
VLLMConfig.frequency_penalty
VLLMConfig.logit_bias
VLLMConfig.max_tokens
VLLMConfig.model_computed_fields
VLLMConfig.model_config
VLLMConfig.model_fields
VLLMConfig.n
VLLMConfig.presence_penalty
VLLMConfig.response_format
VLLMConfig.stop
VLLMConfig.stream
VLLMConfig.temperature
VLLMConfig.tools
VLLMConfig.top_p
VLLMConfig.user
YiConfig
ZhipuAIConfig
- camel.embeddings package
- Submodules
- camel.embeddings.base module
- camel.embeddings.mistral_embedding module
- camel.embeddings.openai_embedding module
- camel.embeddings.sentence_transformers_embeddings module
- camel.embeddings.vlm_embedding module
- Module contents
- camel.interpreters package
- Submodules
- camel.interpreters.base module
- camel.interpreters.docker_interpreter module
- camel.interpreters.internal_python_interpreter module
- camel.interpreters.interpreter_error module
- camel.interpreters.ipython_interpreter module
- camel.interpreters.subprocess_interpreter module
- Module contents
- camel.loaders package
- camel.memories package
- Subpackages
- Submodules
- camel.memories.agent_memories module
- camel.memories.base module
- camel.memories.records module
ContextRecord
MemoryRecord
MemoryRecord.message
MemoryRecord.role_at_backend
MemoryRecord.uuid
MemoryRecord.extra_info
MemoryRecord.extra_info
MemoryRecord.from_dict()
MemoryRecord.message
MemoryRecord.model_computed_fields
MemoryRecord.model_config
MemoryRecord.model_fields
MemoryRecord.role_at_backend
MemoryRecord.to_dict()
MemoryRecord.to_openai_message()
MemoryRecord.uuid
- Module contents
AgentMemory
BaseContextCreator
ChatHistoryBlock
ChatHistoryMemory
ContextRecord
LongtermAgentMemory
MemoryBlock
MemoryRecord
MemoryRecord.message
MemoryRecord.role_at_backend
MemoryRecord.uuid
MemoryRecord.extra_info
MemoryRecord.extra_info
MemoryRecord.from_dict()
MemoryRecord.message
MemoryRecord.model_computed_fields
MemoryRecord.model_config
MemoryRecord.model_fields
MemoryRecord.role_at_backend
MemoryRecord.to_dict()
MemoryRecord.to_openai_message()
MemoryRecord.uuid
ScoreBasedContextCreator
VectorDBBlock
VectorDBMemory
- camel.messages package
- Submodules
- camel.messages.base module
BaseMessage
BaseMessage.content
BaseMessage.create_new_instance()
BaseMessage.extract_text_and_code_prompts()
BaseMessage.image_detail
BaseMessage.image_list
BaseMessage.make_assistant_message()
BaseMessage.make_user_message()
BaseMessage.meta_dict
BaseMessage.role_name
BaseMessage.role_type
BaseMessage.to_dict()
BaseMessage.to_openai_assistant_message()
BaseMessage.to_openai_message()
BaseMessage.to_openai_system_message()
BaseMessage.to_openai_user_message()
BaseMessage.video_bytes
BaseMessage.video_detail
- camel.messages.func_message module
- Module contents
BaseMessage
BaseMessage.content
BaseMessage.create_new_instance()
BaseMessage.extract_text_and_code_prompts()
BaseMessage.image_detail
BaseMessage.image_list
BaseMessage.make_assistant_message()
BaseMessage.make_user_message()
BaseMessage.meta_dict
BaseMessage.role_name
BaseMessage.role_type
BaseMessage.to_dict()
BaseMessage.to_openai_assistant_message()
BaseMessage.to_openai_message()
BaseMessage.to_openai_system_message()
BaseMessage.to_openai_user_message()
BaseMessage.video_bytes
BaseMessage.video_detail
FunctionCallingMessage
FunctionCallingMessage.args
FunctionCallingMessage.content
FunctionCallingMessage.func_name
FunctionCallingMessage.meta_dict
FunctionCallingMessage.result
FunctionCallingMessage.role_name
FunctionCallingMessage.role_type
FunctionCallingMessage.to_openai_assistant_message()
FunctionCallingMessage.to_openai_function_message()
FunctionCallingMessage.to_openai_message()
OpenAIAssistantMessage
OpenAIFunctionMessage
OpenAISystemMessage
OpenAIUserMessage
- camel.models package
- Submodules
- camel.models.anthropic_model module
- camel.models.azure_openai_model module
- camel.models.base_model module
- camel.models.gemini_model module
- camel.models.groq_model module
- camel.models.litellm_model module
- camel.models.mistral_model module
- camel.models.model_factory module
- camel.models.nemotron_model module
- camel.models.ollama_model module
- camel.models.open_source_model module
- camel.models.openai_compatible_model module
- camel.models.openai_model module
- camel.models.reka_model module
- camel.models.samba_model module
- camel.models.stub_model module
- camel.models.togetherai_model module
- camel.models.vllm_model module
- camel.models.zhipuai_model module
- Module contents
- camel.prompts package
- Submodules
- camel.prompts.ai_society module
AISocietyPromptTemplateDict
AISocietyPromptTemplateDict.GENERATE_ASSISTANTS
AISocietyPromptTemplateDict.GENERATE_USERS
AISocietyPromptTemplateDict.GENERATE_TASKS
AISocietyPromptTemplateDict.TASK_SPECIFY_PROMPT
AISocietyPromptTemplateDict.ASSISTANT_PROMPT
AISocietyPromptTemplateDict.USER_PROMPT
AISocietyPromptTemplateDict.ASSISTANT_PROMPT
AISocietyPromptTemplateDict.CRITIC_PROMPT
AISocietyPromptTemplateDict.GENERATE_ASSISTANTS
AISocietyPromptTemplateDict.GENERATE_TASKS
AISocietyPromptTemplateDict.GENERATE_USERS
AISocietyPromptTemplateDict.TASK_SPECIFY_PROMPT
AISocietyPromptTemplateDict.USER_PROMPT
- camel.prompts.base module
CodePrompt
CodePrompt.code_type
CodePrompt.capitalize()
CodePrompt.casefold()
CodePrompt.center()
CodePrompt.code_type
CodePrompt.count()
CodePrompt.encode()
CodePrompt.endswith()
CodePrompt.execute()
CodePrompt.expandtabs()
CodePrompt.find()
CodePrompt.format()
CodePrompt.format_map()
CodePrompt.index()
CodePrompt.isalnum()
CodePrompt.isalpha()
CodePrompt.isascii()
CodePrompt.isdecimal()
CodePrompt.isdigit()
CodePrompt.isidentifier()
CodePrompt.islower()
CodePrompt.isnumeric()
CodePrompt.isprintable()
CodePrompt.isspace()
CodePrompt.istitle()
CodePrompt.isupper()
CodePrompt.join()
CodePrompt.ljust()
CodePrompt.lower()
CodePrompt.lstrip()
CodePrompt.maketrans()
CodePrompt.partition()
CodePrompt.removeprefix()
CodePrompt.removesuffix()
CodePrompt.replace()
CodePrompt.rfind()
CodePrompt.rindex()
CodePrompt.rjust()
CodePrompt.rpartition()
CodePrompt.rsplit()
CodePrompt.rstrip()
CodePrompt.set_code_type()
CodePrompt.split()
CodePrompt.splitlines()
CodePrompt.startswith()
CodePrompt.strip()
CodePrompt.swapcase()
CodePrompt.title()
CodePrompt.translate()
CodePrompt.upper()
CodePrompt.zfill()
TextPrompt
TextPrompt.key_words
TextPrompt.capitalize()
TextPrompt.casefold()
TextPrompt.center()
TextPrompt.count()
TextPrompt.encode()
TextPrompt.endswith()
TextPrompt.expandtabs()
TextPrompt.find()
TextPrompt.format()
TextPrompt.format_map()
TextPrompt.index()
TextPrompt.isalnum()
TextPrompt.isalpha()
TextPrompt.isascii()
TextPrompt.isdecimal()
TextPrompt.isdigit()
TextPrompt.isidentifier()
TextPrompt.islower()
TextPrompt.isnumeric()
TextPrompt.isprintable()
TextPrompt.isspace()
TextPrompt.istitle()
TextPrompt.isupper()
TextPrompt.join()
TextPrompt.key_words
TextPrompt.ljust()
TextPrompt.lower()
TextPrompt.lstrip()
TextPrompt.maketrans()
TextPrompt.partition()
TextPrompt.removeprefix()
TextPrompt.removesuffix()
TextPrompt.replace()
TextPrompt.rfind()
TextPrompt.rindex()
TextPrompt.rjust()
TextPrompt.rpartition()
TextPrompt.rsplit()
TextPrompt.rstrip()
TextPrompt.split()
TextPrompt.splitlines()
TextPrompt.startswith()
TextPrompt.strip()
TextPrompt.swapcase()
TextPrompt.title()
TextPrompt.translate()
TextPrompt.upper()
TextPrompt.zfill()
TextPromptDict
return_prompt_wrapper()
wrap_prompt_functions()
- camel.prompts.code module
CodePromptTemplateDict
CodePromptTemplateDict.GENERATE_LANGUAGES
CodePromptTemplateDict.GENERATE_DOMAINS
CodePromptTemplateDict.GENERATE_TASKS
CodePromptTemplateDict.TASK_SPECIFY_PROMPT
CodePromptTemplateDict.ASSISTANT_PROMPT
CodePromptTemplateDict.USER_PROMPT
CodePromptTemplateDict.ASSISTANT_PROMPT
CodePromptTemplateDict.GENERATE_DOMAINS
CodePromptTemplateDict.GENERATE_LANGUAGES
CodePromptTemplateDict.GENERATE_TASKS
CodePromptTemplateDict.TASK_SPECIFY_PROMPT
CodePromptTemplateDict.USER_PROMPT
- camel.prompts.evaluation module
- camel.prompts.generate_text_embedding_data module
- camel.prompts.image_craft module
- camel.prompts.misalignment module
MisalignmentPromptTemplateDict
MisalignmentPromptTemplateDict.DAN_PROMPT
MisalignmentPromptTemplateDict.GENERATE_TASKS
MisalignmentPromptTemplateDict.TASK_SPECIFY_PROMPT
MisalignmentPromptTemplateDict.ASSISTANT_PROMPT
MisalignmentPromptTemplateDict.USER_PROMPT
MisalignmentPromptTemplateDict.ASSISTANT_PROMPT
MisalignmentPromptTemplateDict.DAN_PROMPT
MisalignmentPromptTemplateDict.GENERATE_TASKS
MisalignmentPromptTemplateDict.TASK_SPECIFY_PROMPT
MisalignmentPromptTemplateDict.USER_PROMPT
- camel.prompts.multi_condition_image_craft module
- camel.prompts.object_recognition module
- camel.prompts.prompt_templates module
- camel.prompts.role_description_prompt_template module
RoleDescriptionPromptTemplateDict
RoleDescriptionPromptTemplateDict.ROLE_DESCRIPTION_PROMPT
RoleDescriptionPromptTemplateDict.ASSISTANT_PROMPT
RoleDescriptionPromptTemplateDict.USER_PROMPT
RoleDescriptionPromptTemplateDict.ASSISTANT_PROMPT
RoleDescriptionPromptTemplateDict.ROLE_DESCRIPTION_PROMPT
RoleDescriptionPromptTemplateDict.USER_PROMPT
- camel.prompts.solution_extraction module
- camel.prompts.task_prompt_template module
- camel.prompts.translation module
- camel.prompts.video_description_prompt module
- Module contents
AISocietyPromptTemplateDict
AISocietyPromptTemplateDict.GENERATE_ASSISTANTS
AISocietyPromptTemplateDict.GENERATE_USERS
AISocietyPromptTemplateDict.GENERATE_TASKS
AISocietyPromptTemplateDict.TASK_SPECIFY_PROMPT
AISocietyPromptTemplateDict.ASSISTANT_PROMPT
AISocietyPromptTemplateDict.USER_PROMPT
AISocietyPromptTemplateDict.ASSISTANT_PROMPT
AISocietyPromptTemplateDict.CRITIC_PROMPT
AISocietyPromptTemplateDict.GENERATE_ASSISTANTS
AISocietyPromptTemplateDict.GENERATE_TASKS
AISocietyPromptTemplateDict.GENERATE_USERS
AISocietyPromptTemplateDict.TASK_SPECIFY_PROMPT
AISocietyPromptTemplateDict.USER_PROMPT
CodePrompt
CodePrompt.code_type
CodePrompt.capitalize()
CodePrompt.casefold()
CodePrompt.center()
CodePrompt.code_type
CodePrompt.count()
CodePrompt.encode()
CodePrompt.endswith()
CodePrompt.execute()
CodePrompt.expandtabs()
CodePrompt.find()
CodePrompt.format()
CodePrompt.format_map()
CodePrompt.index()
CodePrompt.isalnum()
CodePrompt.isalpha()
CodePrompt.isascii()
CodePrompt.isdecimal()
CodePrompt.isdigit()
CodePrompt.isidentifier()
CodePrompt.islower()
CodePrompt.isnumeric()
CodePrompt.isprintable()
CodePrompt.isspace()
CodePrompt.istitle()
CodePrompt.isupper()
CodePrompt.join()
CodePrompt.ljust()
CodePrompt.lower()
CodePrompt.lstrip()
CodePrompt.maketrans()
CodePrompt.partition()
CodePrompt.removeprefix()
CodePrompt.removesuffix()
CodePrompt.replace()
CodePrompt.rfind()
CodePrompt.rindex()
CodePrompt.rjust()
CodePrompt.rpartition()
CodePrompt.rsplit()
CodePrompt.rstrip()
CodePrompt.set_code_type()
CodePrompt.split()
CodePrompt.splitlines()
CodePrompt.startswith()
CodePrompt.strip()
CodePrompt.swapcase()
CodePrompt.title()
CodePrompt.translate()
CodePrompt.upper()
CodePrompt.zfill()
CodePromptTemplateDict
CodePromptTemplateDict.GENERATE_LANGUAGES
CodePromptTemplateDict.GENERATE_DOMAINS
CodePromptTemplateDict.GENERATE_TASKS
CodePromptTemplateDict.TASK_SPECIFY_PROMPT
CodePromptTemplateDict.ASSISTANT_PROMPT
CodePromptTemplateDict.USER_PROMPT
CodePromptTemplateDict.ASSISTANT_PROMPT
CodePromptTemplateDict.GENERATE_DOMAINS
CodePromptTemplateDict.GENERATE_LANGUAGES
CodePromptTemplateDict.GENERATE_TASKS
CodePromptTemplateDict.TASK_SPECIFY_PROMPT
CodePromptTemplateDict.USER_PROMPT
EvaluationPromptTemplateDict
GenerateTextEmbeddingDataPromptTemplateDict
ImageCraftPromptTemplateDict
MisalignmentPromptTemplateDict
MisalignmentPromptTemplateDict.DAN_PROMPT
MisalignmentPromptTemplateDict.GENERATE_TASKS
MisalignmentPromptTemplateDict.TASK_SPECIFY_PROMPT
MisalignmentPromptTemplateDict.ASSISTANT_PROMPT
MisalignmentPromptTemplateDict.USER_PROMPT
MisalignmentPromptTemplateDict.ASSISTANT_PROMPT
MisalignmentPromptTemplateDict.DAN_PROMPT
MisalignmentPromptTemplateDict.GENERATE_TASKS
MisalignmentPromptTemplateDict.TASK_SPECIFY_PROMPT
MisalignmentPromptTemplateDict.USER_PROMPT
MultiConditionImageCraftPromptTemplateDict
ObjectRecognitionPromptTemplateDict
PromptTemplateGenerator
RoleDescriptionPromptTemplateDict
RoleDescriptionPromptTemplateDict.ROLE_DESCRIPTION_PROMPT
RoleDescriptionPromptTemplateDict.ASSISTANT_PROMPT
RoleDescriptionPromptTemplateDict.USER_PROMPT
RoleDescriptionPromptTemplateDict.ASSISTANT_PROMPT
RoleDescriptionPromptTemplateDict.ROLE_DESCRIPTION_PROMPT
RoleDescriptionPromptTemplateDict.USER_PROMPT
SolutionExtractionPromptTemplateDict
TaskPromptTemplateDict
TextPrompt
TextPrompt.key_words
TextPrompt.capitalize()
TextPrompt.casefold()
TextPrompt.center()
TextPrompt.count()
TextPrompt.encode()
TextPrompt.endswith()
TextPrompt.expandtabs()
TextPrompt.find()
TextPrompt.format()
TextPrompt.format_map()
TextPrompt.index()
TextPrompt.isalnum()
TextPrompt.isalpha()
TextPrompt.isascii()
TextPrompt.isdecimal()
TextPrompt.isdigit()
TextPrompt.isidentifier()
TextPrompt.islower()
TextPrompt.isnumeric()
TextPrompt.isprintable()
TextPrompt.isspace()
TextPrompt.istitle()
TextPrompt.isupper()
TextPrompt.join()
TextPrompt.key_words
TextPrompt.ljust()
TextPrompt.lower()
TextPrompt.lstrip()
TextPrompt.maketrans()
TextPrompt.partition()
TextPrompt.removeprefix()
TextPrompt.removesuffix()
TextPrompt.replace()
TextPrompt.rfind()
TextPrompt.rindex()
TextPrompt.rjust()
TextPrompt.rpartition()
TextPrompt.rsplit()
TextPrompt.rstrip()
TextPrompt.split()
TextPrompt.splitlines()
TextPrompt.startswith()
TextPrompt.strip()
TextPrompt.swapcase()
TextPrompt.title()
TextPrompt.translate()
TextPrompt.upper()
TextPrompt.zfill()
TextPromptDict
TranslationPromptTemplateDict
VideoDescriptionPromptTemplateDict
- camel.responses package
- camel.retrievers package
- Submodules
- camel.retrievers.auto_retriever module
- camel.retrievers.base module
- camel.retrievers.bm25_retriever module
- camel.retrievers.cohere_rerank_retriever module
- camel.retrievers.vector_retriever module
- Module contents
- camel.societies package
- Submodules
- camel.societies.babyagi_playing module
- camel.societies.role_playing module
- Subpackages
- camel.societies.workforce package
- Submodules
- camel.societies.workforce.base module
- camel.societies.workforce.prompts module
- camel.societies.workforce.role_playing_worker module
- camel.societies.workforce.single_agent_worker module
- camel.societies.workforce.task_channel module
- camel.societies.workforce.utils module
- camel.societies.workforce.worker module
- camel.societies.workforce.workforce module
- Module contents
- camel.societies.workforce package
- Module contents
- camel.storages package
- Subpackages
- Module contents
BaseGraphStorage
BaseKeyValueStorage
BaseVectorStorage
InMemoryKeyValueStorage
JsonStorage
MilvusStorage
NebulaGraph
NebulaGraph.add_graph_elements()
NebulaGraph.add_node()
NebulaGraph.add_triplet()
NebulaGraph.delete_entity()
NebulaGraph.delete_triplet()
NebulaGraph.ensure_edge_type_exists()
NebulaGraph.ensure_tag_exists()
NebulaGraph.get_client
NebulaGraph.get_indexes()
NebulaGraph.get_node_properties()
NebulaGraph.get_relationship_properties()
NebulaGraph.get_relationship_types()
NebulaGraph.get_schema()
NebulaGraph.get_structured_schema
NebulaGraph.query()
NebulaGraph.refresh_schema()
Neo4jGraph
QdrantStorage
RedisStorage
VectorDBQuery
VectorDBQueryResult
VectorRecord
- camel.tasks package
- Submodules
- camel.tasks.task module
Task
Task.content
Task.id
Task.state
Task.type
Task.parent
Task.subtasks
Task.result
Task.add_subtask()
Task.additional_info
Task.compose()
Task.content
Task.decompose()
Task.failure_count
Task.from_message()
Task.get_depth()
Task.get_result()
Task.get_running_task()
Task.id
Task.model_computed_fields
Task.model_config
Task.model_fields
Task.parent
Task.remove_subtask()
Task.reset()
Task.result
Task.set_id()
Task.set_state()
Task.state
Task.subtasks
Task.to_message()
Task.to_string()
Task.type
Task.update_result()
TaskManager
TaskState
parse_response()
- camel.tasks.task_prompt module
- Module contents
Task
Task.content
Task.id
Task.state
Task.type
Task.parent
Task.subtasks
Task.result
Task.add_subtask()
Task.additional_info
Task.compose()
Task.content
Task.decompose()
Task.failure_count
Task.from_message()
Task.get_depth()
Task.get_result()
Task.get_running_task()
Task.id
Task.model_computed_fields
Task.model_config
Task.model_fields
Task.parent
Task.remove_subtask()
Task.reset()
Task.result
Task.set_id()
Task.set_state()
Task.state
Task.subtasks
Task.to_message()
Task.to_string()
Task.type
Task.update_result()
TaskManager
- camel.terminators package
- camel.toolkits package
- Submodules
- camel.toolkits.base module
- camel.toolkits.code_execution module
- camel.toolkits.dalle_toolkit module
- camel.toolkits.github_toolkit module
GithubToolkit
GithubToolkit.create_pull_request()
GithubToolkit.get_all_file_paths()
GithubToolkit.get_github_access_token()
GithubToolkit.get_issue_content()
GithubToolkit.get_issue_list()
GithubToolkit.get_pull_request_code()
GithubToolkit.get_pull_request_comments()
GithubToolkit.get_pull_request_list()
GithubToolkit.get_tools()
GithubToolkit.retrieve_file_content()
- camel.toolkits.google_maps_toolkit module
- camel.toolkits.linkedin_toolkit module
- camel.toolkits.math_toolkit module
- camel.toolkits.open_api_toolkit module
- camel.toolkits.openai_function module
FunctionTool
FunctionTool.generate_openai_tool_schema()
FunctionTool.get_function_description()
FunctionTool.get_function_name()
FunctionTool.get_openai_function_schema()
FunctionTool.get_openai_tool_schema()
FunctionTool.get_parameter()
FunctionTool.get_paramter_description()
FunctionTool.parameters
FunctionTool.set_function_description()
FunctionTool.set_function_name()
FunctionTool.set_openai_function_schema()
FunctionTool.set_openai_tool_schema()
FunctionTool.set_parameter()
FunctionTool.set_paramter_description()
FunctionTool.validate_openai_tool_schema()
OpenAIFunction
generate_docstring()
get_openai_function_schema()
get_openai_tool_schema()
- camel.toolkits.reddit_toolkit module
- camel.toolkits.retrieval_toolkit module
- camel.toolkits.search_toolkit module
- camel.toolkits.slack_toolkit module
- camel.toolkits.twitter_toolkit module
- camel.toolkits.weather_toolkit module
- Module contents
ArxivToolkit
AskNewsToolkit
AsyncAskNewsToolkit
BaseToolkit
CodeExecutionToolkit
DalleToolkit
FunctionTool
FunctionTool.generate_openai_tool_schema()
FunctionTool.get_function_description()
FunctionTool.get_function_name()
FunctionTool.get_openai_function_schema()
FunctionTool.get_openai_tool_schema()
FunctionTool.get_parameter()
FunctionTool.get_paramter_description()
FunctionTool.parameters
FunctionTool.set_function_description()
FunctionTool.set_function_name()
FunctionTool.set_openai_function_schema()
FunctionTool.set_openai_tool_schema()
FunctionTool.set_parameter()
FunctionTool.set_paramter_description()
FunctionTool.validate_openai_tool_schema()
GithubToolkit
GithubToolkit.create_pull_request()
GithubToolkit.get_all_file_paths()
GithubToolkit.get_github_access_token()
GithubToolkit.get_issue_content()
GithubToolkit.get_issue_list()
GithubToolkit.get_pull_request_code()
GithubToolkit.get_pull_request_comments()
GithubToolkit.get_pull_request_list()
GithubToolkit.get_tools()
GithubToolkit.retrieve_file_content()
GoogleMapsToolkit
GoogleScholarToolkit
GoogleScholarToolkit.author_identifier
GoogleScholarToolkit.is_author_name
GoogleScholarToolkit.scholarly
GoogleScholarToolkit.author
GoogleScholarToolkit.author
GoogleScholarToolkit.get_author_detailed_info()
GoogleScholarToolkit.get_author_publications()
GoogleScholarToolkit.get_full_paper_content_by_link()
GoogleScholarToolkit.get_publication_by_title()
GoogleScholarToolkit.get_tools()
LinkedInToolkit
MathToolkit
NotionToolkit
OpenAIFunction
OpenAPIToolkit
RedditToolkit
RetrievalToolkit
SearchToolkit
SlackToolkit
TwitterToolkit
WeatherToolkit
generate_docstring()
get_openai_function_schema()
get_openai_tool_schema()
- camel.types package
- Submodules
- camel.types.enums module
AudioModelType
EmbeddingModelType
JinaReturnFormat
ModelPlatformType
ModelPlatformType.ANTHROPIC
ModelPlatformType.AZURE
ModelPlatformType.DEFAULT
ModelPlatformType.GEMINI
ModelPlatformType.GROQ
ModelPlatformType.LITELLM
ModelPlatformType.MISTRAL
ModelPlatformType.OLLAMA
ModelPlatformType.OPENAI
ModelPlatformType.OPENAI_COMPATIBLE_MODEL
ModelPlatformType.QWEN
ModelPlatformType.REKA
ModelPlatformType.SAMBA
ModelPlatformType.TOGETHER
ModelPlatformType.VLLM
ModelPlatformType.YI
ModelPlatformType.ZHIPU
ModelPlatformType.is_anthropic
ModelPlatformType.is_azure
ModelPlatformType.is_gemini
ModelPlatformType.is_groq
ModelPlatformType.is_litellm
ModelPlatformType.is_mistral
ModelPlatformType.is_ollama
ModelPlatformType.is_openai
ModelPlatformType.is_openai_compatible_model
ModelPlatformType.is_qwen
ModelPlatformType.is_reka
ModelPlatformType.is_samba
ModelPlatformType.is_together
ModelPlatformType.is_vllm
ModelPlatformType.is_yi
ModelPlatformType.is_zhipuai
OpenAIBackendRole
OpenAIImageType
OpenAIImageTypeMeta
OpenAIVisionDetailType
OpenAPIName
RoleType
StorageType
TaskType
TaskType.AI_SOCIETY
TaskType.CODE
TaskType.DEFAULT
TaskType.EVALUATION
TaskType.GENERATE_TEXT_EMBEDDING_DATA
TaskType.IMAGE_CRAFT
TaskType.MISALIGNMENT
TaskType.MULTI_CONDITION_IMAGE_CRAFT
TaskType.OBJECT_RECOGNITION
TaskType.ROLE_DESCRIPTION
TaskType.SOLUTION_EXTRACTION
TaskType.TRANSLATION
TaskType.VIDEO_DESCRIPTION
TerminationMode
VectorDistance
VoiceType
- camel.types.openai_types module
- Module contents
AudioModelType
ChatCompletion
ChatCompletionAssistantMessageParam
ChatCompletionAssistantMessageParam.audio
ChatCompletionAssistantMessageParam.content
ChatCompletionAssistantMessageParam.function_call
ChatCompletionAssistantMessageParam.name
ChatCompletionAssistantMessageParam.refusal
ChatCompletionAssistantMessageParam.role
ChatCompletionAssistantMessageParam.tool_calls
ChatCompletionChunk
ChatCompletionChunk.choices
ChatCompletionChunk.created
ChatCompletionChunk.id
ChatCompletionChunk.model
ChatCompletionChunk.model_computed_fields
ChatCompletionChunk.model_config
ChatCompletionChunk.model_fields
ChatCompletionChunk.object
ChatCompletionChunk.service_tier
ChatCompletionChunk.system_fingerprint
ChatCompletionChunk.usage
ChatCompletionFunctionMessageParam
ChatCompletionMessage
ChatCompletionSystemMessageParam
ChatCompletionUserMessageParam
Choice
CompletionUsage
EmbeddingModelType
ModelPlatformType
ModelPlatformType.ANTHROPIC
ModelPlatformType.AZURE
ModelPlatformType.DEFAULT
ModelPlatformType.GEMINI
ModelPlatformType.GROQ
ModelPlatformType.LITELLM
ModelPlatformType.MISTRAL
ModelPlatformType.OLLAMA
ModelPlatformType.OPENAI
ModelPlatformType.OPENAI_COMPATIBLE_MODEL
ModelPlatformType.QWEN
ModelPlatformType.REKA
ModelPlatformType.SAMBA
ModelPlatformType.TOGETHER
ModelPlatformType.VLLM
ModelPlatformType.YI
ModelPlatformType.ZHIPU
ModelPlatformType.is_anthropic
ModelPlatformType.is_azure
ModelPlatformType.is_gemini
ModelPlatformType.is_groq
ModelPlatformType.is_litellm
ModelPlatformType.is_mistral
ModelPlatformType.is_ollama
ModelPlatformType.is_openai
ModelPlatformType.is_openai_compatible_model
ModelPlatformType.is_qwen
ModelPlatformType.is_reka
ModelPlatformType.is_samba
ModelPlatformType.is_together
ModelPlatformType.is_vllm
ModelPlatformType.is_yi
ModelPlatformType.is_zhipuai
ModelType
ModelType.CLAUDE_2_0
ModelType.CLAUDE_2_1
ModelType.CLAUDE_3_5_SONNET
ModelType.CLAUDE_3_HAIKU
ModelType.CLAUDE_3_OPUS
ModelType.CLAUDE_3_SONNET
ModelType.CLAUDE_INSTANT_1_2
ModelType.DEFAULT
ModelType.GEMINI_1_5_FLASH
ModelType.GEMINI_1_5_PRO
ModelType.GLM_3_TURBO
ModelType.GLM_4
ModelType.GLM_4V
ModelType.GPT_3_5_TURBO
ModelType.GPT_4
ModelType.GPT_4O
ModelType.GPT_4O_MINI
ModelType.GPT_4_TURBO
ModelType.GROQ_GEMMA_2_9B_IT
ModelType.GROQ_GEMMA_7B_IT
ModelType.GROQ_LLAMA_3_1_405B
ModelType.GROQ_LLAMA_3_1_70B
ModelType.GROQ_LLAMA_3_1_8B
ModelType.GROQ_LLAMA_3_70B
ModelType.GROQ_LLAMA_3_8B
ModelType.GROQ_MIXTRAL_8_7B
ModelType.MISTRAL_3B
ModelType.MISTRAL_7B
ModelType.MISTRAL_8B
ModelType.MISTRAL_CODESTRAL
ModelType.MISTRAL_CODESTRAL_MAMBA
ModelType.MISTRAL_LARGE
ModelType.MISTRAL_MIXTRAL_8x22B
ModelType.MISTRAL_MIXTRAL_8x7B
ModelType.MISTRAL_NEMO
ModelType.MISTRAL_PIXTRAL_12B
ModelType.NEMOTRON_4_REWARD
ModelType.O1_MINI
ModelType.O1_PREVIEW
ModelType.QWEN_CODER_TURBO
ModelType.QWEN_LONG
ModelType.QWEN_MATH_PLUS
ModelType.QWEN_MATH_TURBO
ModelType.QWEN_MAX
ModelType.QWEN_PLUS
ModelType.QWEN_TURBO
ModelType.QWEN_VL_MAX
ModelType.QWEN_VL_PLUS
ModelType.REKA_CORE
ModelType.REKA_EDGE
ModelType.REKA_FLASH
ModelType.STUB
ModelType.YI_LARGE
ModelType.YI_LARGE_FC
ModelType.YI_LARGE_RAG
ModelType.YI_LARGE_TURBO
ModelType.YI_LIGHTNING
ModelType.YI_MEDIUM
ModelType.YI_MEDIUM_200K
ModelType.YI_SPARK
ModelType.YI_VISION
ModelType.is_anthropic
ModelType.is_azure_openai
ModelType.is_gemini
ModelType.is_groq
ModelType.is_mistral
ModelType.is_nvidia
ModelType.is_openai
ModelType.is_qwen
ModelType.is_reka
ModelType.is_yi
ModelType.is_zhipuai
ModelType.support_native_tool_calling
ModelType.token_limit
ModelType.value_for_tiktoken
NotGiven
OpenAIBackendRole
OpenAIImageType
OpenAIVisionDetailType
OpenAPIName
RoleType
StorageType
TaskType
TaskType.AI_SOCIETY
TaskType.CODE
TaskType.DEFAULT
TaskType.EVALUATION
TaskType.GENERATE_TEXT_EMBEDDING_DATA
TaskType.IMAGE_CRAFT
TaskType.MISALIGNMENT
TaskType.MULTI_CONDITION_IMAGE_CRAFT
TaskType.OBJECT_RECOGNITION
TaskType.ROLE_DESCRIPTION
TaskType.SOLUTION_EXTRACTION
TaskType.TRANSLATION
TaskType.VIDEO_DESCRIPTION
TerminationMode
UnifiedModelType
UnifiedModelType.is_anthropic
UnifiedModelType.is_azure_openai
UnifiedModelType.is_gemini
UnifiedModelType.is_groq
UnifiedModelType.is_mistral
UnifiedModelType.is_openai
UnifiedModelType.is_qwen
UnifiedModelType.is_reka
UnifiedModelType.is_yi
UnifiedModelType.is_zhipuai
UnifiedModelType.support_native_tool_calling
UnifiedModelType.token_limit
UnifiedModelType.value_for_tiktoken
VectorDistance
VoiceType
- camel.utils package
- Submodules
- camel.utils.async_func module
- camel.utils.commons module
AgentOpsMeta
agentops_decorator()
api_keys_required()
check_server_running()
create_chunks()
dependencies_required()
download_tasks()
func_string_to_callable()
get_first_int()
get_prompt_template_key_words()
get_pydantic_major_version()
get_pydantic_object_schema()
get_system_information()
get_task_list()
handle_http_error()
is_docker_running()
is_module_available()
json_to_function_code()
print_text_animated()
retry_request()
text_extract_from_web()
to_pascal()
track_agent()
- camel.utils.constants module
- camel.utils.token_counting module
- Module contents
AgentOpsMeta
AnthropicTokenCounter
BaseTokenCounter
Constants
GeminiTokenCounter
LiteLLMTokenCounter
MistralTokenCounter
OpenAITokenCounter
agentops_decorator()
api_keys_required()
check_server_running()
create_chunks()
dependencies_required()
download_tasks()
func_string_to_callable()
get_first_int()
get_model_encoding()
get_prompt_template_key_words()
get_pydantic_major_version()
get_pydantic_object_schema()
get_system_information()
get_task_list()
handle_http_error()
is_docker_running()
json_to_function_code()
print_text_animated()
text_extract_from_web()
to_pascal()
track_agent()
Submodules#
camel.generators module#
- class camel.generators.AISocietyTaskPromptGenerator(num_tasks: int = 10)[source]#
Bases:
object
Task prompt generator for AI society tasks.
- Parameters:
num_tasks (int, optional) – The number of tasks to generate. (default:
10
)
- from_role_files(assistant_role_names_path: str = 'data/ai_society/assistant_roles.txt', user_role_names_path: str = 'data/ai_society/user_roles.txt') Generator[Tuple[str, Tuple[str, str]], None, None] [source]#
Generate tasks from role files.
- Parameters:
assistant_role_names_path (str, optional) – The path to the file containing the assistant role names. (default:
"data/ai_society/assistant_roles.txt"
)user_role_names_path (str, optional) – The path to the file containing the user role names. (default:
"data/ai_society/user_roles.txt"
)
- Returns:
- A generator
that yields tuples of task prompts and role names.
- Return type:
Generator[Tuple[str, Tuple[str, str]], None, None]
- from_role_generator(role_generator: Generator[Tuple, None, None]) Generator[Tuple[str, Tuple[str, str]], None, None] [source]#
Generate tasks from a role generator.
- Parameters:
role_generator (Generator[Tuple, None, None]) – A generator that yields tuples of role names.
- Returns:
- A generator
that yields tuples of task prompts and role names.
- Return type:
Generator[Tuple[str, Tuple[str, str]], None, None]
- class camel.generators.CodeTaskPromptGenerator(num_tasks: int = 50)[source]#
Bases:
object
Code task prompt generator for code tasks.
- Parameters:
num_tasks (int, optional) – The number of tasks to generate. (default:
50
)
- from_role_files(languages_path: str = 'data/code/languages.txt', domains_path: str = 'data/code/domains.txt') Generator[Tuple[TextPrompt, str, str], None, None] [source]#
Generate tasks from role files.
- Parameters:
languages_path (str, optional) – The path to the file containing the language names. (default:
"data/code/languages.txt"
)domains_path (str, optional) – The path to the file containing the domain names. (default:
"data/code/domains.txt"
)
- Returns:
- A generator
that yields tuples of task prompts, language names, and domain names.
- Return type:
Generator[Tuple[TextPrompt, str, str], None, None]
- from_role_generator(role_generator: Generator[Tuple, None, None]) Generator[str, None, None] [source]#
Generate tasks from a role generator.
- Parameters:
role_generator (Generator[Tuple, None, None]) – A generator that yields tuples of role names.
- Returns:
- A generator that yields the task
prompts.
- Return type:
Generator[str, None, None]
- class camel.generators.RoleNameGenerator(assistant_role_names_path: str = 'data/ai_society/assistant_roles.txt', user_role_names_path: str = 'data/ai_society/user_roles.txt', assistant_role_names: List[str] | None = None, user_role_names: List[str] | None = None)[source]#
Bases:
object
Role name generator for role-playing workers.
- Parameters:
assistant_role_names_path (str, optional) – The path to the file containing the assistant role names. (default:
"data/ai_society/assistant_roles.txt"
)user_role_names_path (str, optional) – The path to the file containing the user role names. (default:
"data/ai_society/user_roles.txt"
)assistant_role_names (Optional[List[str]], optional) – The list of assistant role names. (default:
None
)user_role_names (Optional[List[str]], optional) – The list of user role names. (default:
None
)
- class camel.generators.SingleTxtGenerator(text_file_path: str)[source]#
Bases:
object
Single text generator for role-playing workers.
- Parameters:
text_file_path (str) – The path to the file containing the text data.
- class camel.generators.SystemMessageGenerator(task_type: TaskType = TaskType.AI_SOCIETY, sys_prompts: Dict[RoleType, str] | None = None, sys_msg_meta_dict_keys: Set[str] | None = None)[source]#
Bases:
object
System message generator for agents.
- Parameters:
task_type (TaskType, optional) – The task type. (default:
TaskType.AI_SOCIETY
)sys_prompts (Optional[Dict[RoleType, str]], optional) – The prompts of the system messages for each role type. (default:
None
)sys_msg_meta_dict_keys (Optional[Set[str]], optional) – The set of keys of the meta dictionary used to fill the prompts. (default:
None
)
- from_dict(meta_dict: Dict[str, str], role_tuple: Tuple[str, RoleType] = ('', RoleType.DEFAULT)) BaseMessage [source]#
Generates a system message from a dictionary.
- Parameters:
meta_dict (Dict[str, str]) – The dictionary containing the information to generate the system message.
role_tuple (Tuple[str, RoleType], optional) – The tuple containing the role name and role type. (default: (“”, RoleType.DEFAULT))
- Returns:
The generated system message.
- Return type:
- from_dicts(meta_dicts: List[Dict[str, str]], role_tuples: List[Tuple[str, RoleType]]) List[BaseMessage] [source]#
Generates a list of system messages from a list of dictionaries.
- Parameters:
meta_dicts (List[Dict[str, str]]) – A list of dictionaries containing the information to generate the system messages.
role_tuples (List[Tuple[str, RoleType]]) – A list of tuples containing the role name and role type for each system message.
- Returns:
A list of generated system messages.
- Return type:
List[BaseMessage]
- Raises:
ValueError – If the number of meta_dicts and role_tuples are different.
camel.human module#
- class camel.human.Human(name: str = 'Kill Switch Engineer', logger_color: Any = '\x1b[35m')[source]#
Bases:
object
A class representing a human user.
- Parameters:
name (str) – The name of the human user. (default:
"Kill Switch Engineer"
).logger_color (Any) – The color of the menu options displayed to the user. (default:
Fore.MAGENTA
)
- name#
The name of the human user.
- Type:
str
- logger_color#
The color of the menu options displayed to the user.
- Type:
Any
- input_button#
The text displayed for the input button.
- Type:
str
- kill_button#
The text displayed for the kill button.
- Type:
str
- options_dict#
A dictionary containing the options displayed to the user.
- Type:
Dict[str, str]
- display_options(messages: Sequence[BaseMessage]) None [source]#
Displays the options to the user.
- Parameters:
messages (Sequence[BaseMessage]) – A list of BaseMessage objects.
- Returns:
None
- parse_input(human_input: str) str [source]#
Parses the user’s input and returns a BaseMessage object.
- Parameters:
human_input (str) – The user’s input.
- Returns:
A str object representing the user’s input.
- Return type:
content
- reduce_step(messages: Sequence[BaseMessage]) ChatAgentResponse [source]#
Performs one step of the conversation by displaying options to the user, getting their input, and parsing their choice.
- Parameters:
messages (Sequence[BaseMessage]) – A list of BaseMessage objects.
- Returns:
- A ChatAgentResponse object representing the
user’s choice.
- Return type: