agentscope package
Subpackages
- agentscope.agents package
- Submodules
- Module contents
- agentscope.environment package
- agentscope.manager package
- Module contents
FileManager
FileManager.__init__()
FileManager.initialize()
FileManager.embedding_cache_dir
FileManager.file_dir
FileManager.code_dir
FileManager.invoke_dir
FileManager.get_instance()
FileManager.save_api_invocation()
FileManager.save_python_code()
FileManager.save_image()
FileManager.save_file()
FileManager.save_runtime_information()
FileManager.cache_text_embedding()
FileManager.fetch_cached_text_embedding()
FileManager.state_dict()
FileManager.load_dict()
FileManager.is_initialized()
FileManager.flush()
ModelManager
ModelManager.get_instance()
ModelManager.__init__()
ModelManager.model_configs
ModelManager.initialize()
ModelManager.clear_model_configs()
ModelManager.load_model_configs()
ModelManager.get_model_by_config_name()
ModelManager.get_config_by_name()
ModelManager.state_dict()
ModelManager.load_dict()
ModelManager.flush()
MonitorManager
MonitorManager.path_db
MonitorManager.__init__()
MonitorManager.initialize()
MonitorManager.get_instance()
MonitorManager.update_image_tokens()
MonitorManager.update_text_and_embedding_tokens()
MonitorManager.print_llm_usage()
MonitorManager.show_image_tokens()
MonitorManager.show_text_and_embedding_tokens()
MonitorManager.rm_database()
MonitorManager.state_dict()
MonitorManager.load_dict()
MonitorManager.flush()
ASManager
- Module contents
- agentscope.memory package
- agentscope.message package
- agentscope.models package
- Submodules
- agentscope.models.dashscope_model module
- agentscope.models.gemini_model module
- agentscope.models.litellm_model module
- agentscope.models.model module
- agentscope.models.ollama_model module
- agentscope.models.openai_model module
- agentscope.models.post_model module
- agentscope.models.response module
- agentscope.models.yi_model module
- agentscope.models.zhipu_model module
- Module contents
ModelWrapperBase
ModelResponse
PostAPIModelWrapperBase
PostAPIChatWrapper
OpenAIWrapperBase
OpenAIChatWrapper
OpenAIDALLEWrapper
OpenAIEmbeddingWrapper
DashScopeChatWrapper
DashScopeImageSynthesisWrapper
DashScopeTextEmbeddingWrapper
DashScopeMultiModalWrapper
OllamaChatWrapper
OllamaEmbeddingWrapper
OllamaGenerationWrapper
GeminiChatWrapper
GeminiEmbeddingWrapper
ZhipuAIChatWrapper
ZhipuAIEmbeddingWrapper
LiteLLMChatWrapper
YiChatWrapper
- Submodules
- agentscope.parsers package
- Submodules
- Module contents
- agentscope.pipelines package
- agentscope.prompt package
- agentscope.rag package
- agentscope.rpc package
- Submodules
- Module contents
RpcMeta
RpcClient
RpcClient.__init__()
RpcClient.call_agent_func()
RpcClient.is_alive()
RpcClient.stop()
RpcClient.create_agent()
RpcClient.delete_agent()
RpcClient.delete_all_agent()
RpcClient.update_result()
RpcClient.get_agent_list()
RpcClient.get_server_info()
RpcClient.set_model_configs()
RpcClient.get_agent_memory()
RpcClient.download_file()
RpcObject
async_func()
sync_func()
AsyncResult
DistConf
- agentscope.server package
- agentscope.service package
- Subpackages
- Submodules
- Module contents
ServiceResponse
ServiceExecStatus
ServiceToolkit
get_help()
execute_python_code()
execute_shell_command()
create_file()
delete_file()
move_file()
create_directory()
delete_directory()
move_directory()
list_directory_content()
get_current_directory()
read_text_file()
write_text_file()
read_json_file()
write_json_file()
bing_search()
google_search()
arxiv_search()
wikipedia_search()
wikipedia_search_categories()
query_mysql()
query_sqlite()
query_mongodb()
cos_sim()
summarization()
retrieve_from_list()
digest_webpage()
load_web()
parse_html_to_text()
download_from_url()
dblp_search_publications()
dblp_search_authors()
dblp_search_venues()
NoteBookExecutor
dashscope_image_to_text()
dashscope_text_to_image()
dashscope_text_to_audio()
openai_audio_to_text()
openai_text_to_audio()
openai_text_to_image()
openai_image_to_text()
openai_edit_image()
openai_create_image_variation()
tripadvisor_search()
tripadvisor_search_location_photos()
tripadvisor_search_location_details()
WebBrowser
WebBrowser.__init__()
WebBrowser.url
WebBrowser.page_html
WebBrowser.page_title
WebBrowser.page_markdown
WebBrowser.page_screenshot
WebBrowser.action_click()
WebBrowser.action_type()
WebBrowser.action_scroll_up()
WebBrowser.action_scroll_down()
WebBrowser.action_press_key()
WebBrowser.action_visit_url()
WebBrowser.get_action_functions()
WebBrowser.set_interactive_marks()
WebBrowser.remove_interactive_marks()
WebBrowser.close()
WebElementInfo
WebElementInfo.html
WebElementInfo.tag_name
WebElementInfo.node_name
WebElementInfo.node_value
WebElementInfo.type
WebElementInfo.aria_label
WebElementInfo.is_clickable
WebElementInfo.meta_data
WebElementInfo.inner_text
WebElementInfo.origin_x
WebElementInfo.origin_y
WebElementInfo.width
WebElementInfo.height
WebElementInfo.model_computed_fields
WebElementInfo.model_config
WebElementInfo.model_fields
ServiceFactory
- agentscope.strategy package
- agentscope.studio package
- agentscope.utils package
- agentscope.web package
Submodules
- agentscope.constants module
- agentscope.exception module
ResponseParsingError
JsonParsingError
JsonDictValidationError
JsonTypeError
RequiredFieldNotFoundError
TagNotFoundError
FunctionCallError
FunctionCallFormatError
FunctionNotFoundError
ArgumentNotFoundError
ArgumentTypeError
StudioError
StudioRegisterError
AgentServerError
AgentServerNotAliveError
AgentCreationError
AgentCallError
AgentServerUnsupportedMethodError
QuotaExceededError
EnvError
EnvNotFoundError
EnvAlreadyExistError
EnvUnsupportedFunctionError
EnvTypeError
EnvListenerError
- agentscope.logging module
- agentscope.msghub module
- agentscope.serialize module
- agentscope.tokens module
Module contents
Import all modules in the package.
- agentscope.init(model_configs: dict | str | list | None = None, project: str | None = None, name: str | None = None, disable_saving: bool = False, save_dir: str = './runs', save_log: bool = True, save_code: bool = True, save_api_invoke: bool = False, cache_dir: str = '/home/runner/.cache/agentscope', use_monitor: bool = True, logger_level: Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO', runtime_id: str | None = None, agent_configs: dict | str | list | None = None, studio_url: str | None = None) Sequence[AgentBase] [源代码]
A unified entry to initialize the package, including model configs, runtime names, saving directories and logging settings.
- 参数:
model_configs (Optional[Union[dict, str, list]], defaults to None) – A dict, a list of dicts, or a path to a json file containing model configs.
project (Optional[str], defaults to None) – The project name, which is used to identify the project.
name (Optional[str], defaults to None) – The name for runtime, which is used to identify this runtime.
disable_saving (bool, defaults to False) – Whether to disable saving files. If True, this will override the save_log, save_code, and save_api_invoke parameters.
runtime_id (Optional[str], defaults to None) – The id for runtime, which is used to identify this runtime. Use None will generate a random id.
save_dir (str, defaults to ./runs) – The directory to save logs, files, codes, and api invocations. If dir is None, when saving logs, files, codes, and api invocations, the default directory ./runs will be created.
save_log (bool, defaults to False) – Whether to save logs locally.
save_code (bool, defaults to False) – Whether to save codes locally.
save_api_invoke (bool, defaults to False) – Whether to save api invocations locally, including model and web search invocation.
cache_dir (str) – The directory to cache files. In Linux/Mac, the dir defaults to
Windows ( In)
to (the dir defaults)
`C –
users<username>.cacheagentscope`.
use_monitor (bool, defaults to True) – Whether to activate the monitor.
logger_level (LOG_LEVEL, defaults to “INFO”) – The logging level of logger.
agent_configs (Optional[Union[str, list, dict]], defaults to None) – The config dict(s) of agents or the path to the config file, which can be loaded by json.loads(). One agent config should cover the required arguments to initialize a specific agent object, otherwise the default values will be used.
studio_url (Optional[str], defaults to None) – The url of the agentscope studio.
- agentscope.msghub(participants: Sequence[AgentBase], announcement: Sequence[Msg] | Msg | None = None) MsgHubManager [源代码]
msghub is used to share messages among a group of agents.
- 参数:
participants (Sequence[AgentBase]) – A Sequence of participated agents in the msghub.
announcement (Optional[Union[list[Msg], Msg]], defaults to None) – The message that will be broadcast to all participants at the very beginning without requiring response.
示例
In the following code, we create a msghub with three agents, and each message output by agent1, agent2, agent3 will be passed to all other agents, that’s what we mean msghub.
with msghub(participant=[agent1, agent2, agent3]): agent1() agent2()
Actually, it has the same effect as the following code, but much more easy and elegant!
x1 = agent1() agent2.observe(x1) agent3.observe(x1) x2 = agent2() agent1.observe(x2) agent3.observe(x2)