diff --git a/en/.doctrees/agentscope.agents.agent.doctree b/en/.doctrees/agentscope.agents.agent.doctree new file mode 100644 index 000000000..bf30fe8c0 Binary files /dev/null and b/en/.doctrees/agentscope.agents.agent.doctree differ diff --git a/en/.doctrees/agentscope.agents.dialog_agent.doctree b/en/.doctrees/agentscope.agents.dialog_agent.doctree new file mode 100644 index 000000000..a9f2d8b73 Binary files /dev/null and b/en/.doctrees/agentscope.agents.dialog_agent.doctree differ diff --git a/en/.doctrees/agentscope.agents.dict_dialog_agent.doctree b/en/.doctrees/agentscope.agents.dict_dialog_agent.doctree new file mode 100644 index 000000000..575d07b2e Binary files /dev/null and b/en/.doctrees/agentscope.agents.dict_dialog_agent.doctree differ diff --git a/en/.doctrees/agentscope.agents.doctree b/en/.doctrees/agentscope.agents.doctree index fe80cffa4..f99c7bccc 100644 Binary files a/en/.doctrees/agentscope.agents.doctree and b/en/.doctrees/agentscope.agents.doctree differ diff --git a/en/.doctrees/agentscope.agents.operator.doctree b/en/.doctrees/agentscope.agents.operator.doctree new file mode 100644 index 000000000..a2c1405e6 Binary files /dev/null and b/en/.doctrees/agentscope.agents.operator.doctree differ diff --git a/en/.doctrees/agentscope.agents.react_agent.doctree b/en/.doctrees/agentscope.agents.react_agent.doctree new file mode 100644 index 000000000..15238ee14 Binary files /dev/null and b/en/.doctrees/agentscope.agents.react_agent.doctree differ diff --git a/en/.doctrees/agentscope.agents.rpc_agent.doctree b/en/.doctrees/agentscope.agents.rpc_agent.doctree new file mode 100644 index 000000000..6ffedc571 Binary files /dev/null and b/en/.doctrees/agentscope.agents.rpc_agent.doctree differ diff --git a/en/.doctrees/agentscope.agents.text_to_image_agent.doctree b/en/.doctrees/agentscope.agents.text_to_image_agent.doctree new file mode 100644 index 000000000..cd34a3c90 Binary files /dev/null and b/en/.doctrees/agentscope.agents.text_to_image_agent.doctree differ diff --git a/en/.doctrees/agentscope.agents.user_agent.doctree b/en/.doctrees/agentscope.agents.user_agent.doctree new file mode 100644 index 000000000..d5dfbf34f Binary files /dev/null and b/en/.doctrees/agentscope.agents.user_agent.doctree differ diff --git a/en/.doctrees/agentscope.constants.doctree b/en/.doctrees/agentscope.constants.doctree new file mode 100644 index 000000000..dfe4a7176 Binary files /dev/null and b/en/.doctrees/agentscope.constants.doctree differ diff --git a/en/.doctrees/agentscope.file_manager.doctree b/en/.doctrees/agentscope.file_manager.doctree new file mode 100644 index 000000000..1ef69024d Binary files /dev/null and b/en/.doctrees/agentscope.file_manager.doctree differ diff --git a/en/.doctrees/agentscope.memory.doctree b/en/.doctrees/agentscope.memory.doctree index 74d1e9588..e9fda6fd1 100644 Binary files a/en/.doctrees/agentscope.memory.doctree and b/en/.doctrees/agentscope.memory.doctree differ diff --git a/en/.doctrees/agentscope.memory.memory.doctree b/en/.doctrees/agentscope.memory.memory.doctree new file mode 100644 index 000000000..1a6e15c5a Binary files /dev/null and b/en/.doctrees/agentscope.memory.memory.doctree differ diff --git a/en/.doctrees/agentscope.memory.temporary_memory.doctree b/en/.doctrees/agentscope.memory.temporary_memory.doctree new file mode 100644 index 000000000..b0f93a67a Binary files /dev/null and b/en/.doctrees/agentscope.memory.temporary_memory.doctree differ diff --git a/en/.doctrees/agentscope.message.doctree b/en/.doctrees/agentscope.message.doctree new file mode 100644 index 000000000..3c6c33c62 Binary files /dev/null and b/en/.doctrees/agentscope.message.doctree differ diff --git a/en/.doctrees/agentscope.models.config.doctree b/en/.doctrees/agentscope.models.config.doctree new file mode 100644 index 000000000..5e84e6593 Binary files /dev/null and b/en/.doctrees/agentscope.models.config.doctree differ diff --git a/en/.doctrees/agentscope.models.dashscope_model.doctree b/en/.doctrees/agentscope.models.dashscope_model.doctree new file mode 100644 index 000000000..5c0f9edfe Binary files /dev/null and b/en/.doctrees/agentscope.models.dashscope_model.doctree differ diff --git a/en/.doctrees/agentscope.models.doctree b/en/.doctrees/agentscope.models.doctree index 0e0aaedf8..7a00e2e83 100644 Binary files a/en/.doctrees/agentscope.models.doctree and b/en/.doctrees/agentscope.models.doctree differ diff --git a/en/.doctrees/agentscope.models.gemini_model.doctree b/en/.doctrees/agentscope.models.gemini_model.doctree new file mode 100644 index 000000000..e09587847 Binary files /dev/null and b/en/.doctrees/agentscope.models.gemini_model.doctree differ diff --git a/en/.doctrees/agentscope.models.model.doctree b/en/.doctrees/agentscope.models.model.doctree new file mode 100644 index 000000000..78e1bda70 Binary files /dev/null and b/en/.doctrees/agentscope.models.model.doctree differ diff --git a/en/.doctrees/agentscope.models.ollama_model.doctree b/en/.doctrees/agentscope.models.ollama_model.doctree new file mode 100644 index 000000000..a7338b6b1 Binary files /dev/null and b/en/.doctrees/agentscope.models.ollama_model.doctree differ diff --git a/en/.doctrees/agentscope.models.openai_model.doctree b/en/.doctrees/agentscope.models.openai_model.doctree new file mode 100644 index 000000000..380bfd0de Binary files /dev/null and b/en/.doctrees/agentscope.models.openai_model.doctree differ diff --git a/en/.doctrees/agentscope.models.post_model.doctree b/en/.doctrees/agentscope.models.post_model.doctree new file mode 100644 index 000000000..761ebaca7 Binary files /dev/null and b/en/.doctrees/agentscope.models.post_model.doctree differ diff --git a/en/.doctrees/agentscope.models.response.doctree b/en/.doctrees/agentscope.models.response.doctree new file mode 100644 index 000000000..c290f5062 Binary files /dev/null and b/en/.doctrees/agentscope.models.response.doctree differ diff --git a/en/.doctrees/agentscope.msghub.doctree b/en/.doctrees/agentscope.msghub.doctree new file mode 100644 index 000000000..afcc45878 Binary files /dev/null and b/en/.doctrees/agentscope.msghub.doctree differ diff --git a/en/.doctrees/agentscope.pipelines.doctree b/en/.doctrees/agentscope.pipelines.doctree index 0f81b6850..6d840ffcd 100644 Binary files a/en/.doctrees/agentscope.pipelines.doctree and b/en/.doctrees/agentscope.pipelines.doctree differ diff --git a/en/.doctrees/agentscope.pipelines.functional.doctree b/en/.doctrees/agentscope.pipelines.functional.doctree new file mode 100644 index 000000000..a74ffecf8 Binary files /dev/null and b/en/.doctrees/agentscope.pipelines.functional.doctree differ diff --git a/en/.doctrees/agentscope.pipelines.pipeline.doctree b/en/.doctrees/agentscope.pipelines.pipeline.doctree new file mode 100644 index 000000000..a920ac674 Binary files /dev/null and b/en/.doctrees/agentscope.pipelines.pipeline.doctree differ diff --git a/en/.doctrees/agentscope.prompt.doctree b/en/.doctrees/agentscope.prompt.doctree new file mode 100644 index 000000000..6678bb50b Binary files /dev/null and b/en/.doctrees/agentscope.prompt.doctree differ diff --git a/en/.doctrees/agentscope.rpc.doctree b/en/.doctrees/agentscope.rpc.doctree index 56b79d851..acf74bdab 100644 Binary files a/en/.doctrees/agentscope.rpc.doctree and b/en/.doctrees/agentscope.rpc.doctree differ diff --git a/en/.doctrees/agentscope.rpc.rpc_agent_client.doctree b/en/.doctrees/agentscope.rpc.rpc_agent_client.doctree new file mode 100644 index 000000000..f7c733682 Binary files /dev/null and b/en/.doctrees/agentscope.rpc.rpc_agent_client.doctree differ diff --git a/en/.doctrees/agentscope.rpc.rpc_agent_pb2.doctree b/en/.doctrees/agentscope.rpc.rpc_agent_pb2.doctree new file mode 100644 index 000000000..6a2b43413 Binary files /dev/null and b/en/.doctrees/agentscope.rpc.rpc_agent_pb2.doctree differ diff --git a/en/.doctrees/agentscope.rpc.rpc_agent_pb2_grpc.doctree b/en/.doctrees/agentscope.rpc.rpc_agent_pb2_grpc.doctree new file mode 100644 index 000000000..6525b7216 Binary files /dev/null and b/en/.doctrees/agentscope.rpc.rpc_agent_pb2_grpc.doctree differ diff --git a/en/.doctrees/agentscope.service.doctree b/en/.doctrees/agentscope.service.doctree index 3c4f0fbee..a75eb0302 100644 Binary files a/en/.doctrees/agentscope.service.doctree and b/en/.doctrees/agentscope.service.doctree differ diff --git a/en/.doctrees/agentscope.service.execute_code.exec_python.doctree b/en/.doctrees/agentscope.service.execute_code.exec_python.doctree new file mode 100644 index 000000000..147073acb Binary files /dev/null and b/en/.doctrees/agentscope.service.execute_code.exec_python.doctree differ diff --git a/en/.doctrees/agentscope.service.execute_code.exec_shell.doctree b/en/.doctrees/agentscope.service.execute_code.exec_shell.doctree new file mode 100644 index 000000000..0ed8a8fc1 Binary files /dev/null and b/en/.doctrees/agentscope.service.execute_code.exec_shell.doctree differ diff --git a/en/.doctrees/agentscope.service.file.common.doctree b/en/.doctrees/agentscope.service.file.common.doctree new file mode 100644 index 000000000..1a305ad15 Binary files /dev/null and b/en/.doctrees/agentscope.service.file.common.doctree differ diff --git a/en/.doctrees/agentscope.service.file.json.doctree b/en/.doctrees/agentscope.service.file.json.doctree new file mode 100644 index 000000000..4ff32fd0f Binary files /dev/null and b/en/.doctrees/agentscope.service.file.json.doctree differ diff --git a/en/.doctrees/agentscope.service.file.text.doctree b/en/.doctrees/agentscope.service.file.text.doctree new file mode 100644 index 000000000..a0593ec6a Binary files /dev/null and b/en/.doctrees/agentscope.service.file.text.doctree differ diff --git a/en/.doctrees/agentscope.service.retrieval.retrieval_from_list.doctree b/en/.doctrees/agentscope.service.retrieval.retrieval_from_list.doctree new file mode 100644 index 000000000..26ee028bb Binary files /dev/null and b/en/.doctrees/agentscope.service.retrieval.retrieval_from_list.doctree differ diff --git a/en/.doctrees/agentscope.service.retrieval.similarity.doctree b/en/.doctrees/agentscope.service.retrieval.similarity.doctree new file mode 100644 index 000000000..31122abd9 Binary files /dev/null and b/en/.doctrees/agentscope.service.retrieval.similarity.doctree differ diff --git a/en/.doctrees/agentscope.service.service_factory.doctree b/en/.doctrees/agentscope.service.service_factory.doctree new file mode 100644 index 000000000..81a7070d6 Binary files /dev/null and b/en/.doctrees/agentscope.service.service_factory.doctree differ diff --git a/en/.doctrees/agentscope.service.service_response.doctree b/en/.doctrees/agentscope.service.service_response.doctree new file mode 100644 index 000000000..4b72f1092 Binary files /dev/null and b/en/.doctrees/agentscope.service.service_response.doctree differ diff --git a/en/.doctrees/agentscope.service.service_status.doctree b/en/.doctrees/agentscope.service.service_status.doctree new file mode 100644 index 000000000..50973bed7 Binary files /dev/null and b/en/.doctrees/agentscope.service.service_status.doctree differ diff --git a/en/.doctrees/agentscope.service.sql_query.mongodb.doctree b/en/.doctrees/agentscope.service.sql_query.mongodb.doctree new file mode 100644 index 000000000..fbf726d44 Binary files /dev/null and b/en/.doctrees/agentscope.service.sql_query.mongodb.doctree differ diff --git a/en/.doctrees/agentscope.service.sql_query.mysql.doctree b/en/.doctrees/agentscope.service.sql_query.mysql.doctree new file mode 100644 index 000000000..da0ee80cb Binary files /dev/null and b/en/.doctrees/agentscope.service.sql_query.mysql.doctree differ diff --git a/en/.doctrees/agentscope.service.sql_query.sqlite.doctree b/en/.doctrees/agentscope.service.sql_query.sqlite.doctree new file mode 100644 index 000000000..1d9884350 Binary files /dev/null and b/en/.doctrees/agentscope.service.sql_query.sqlite.doctree differ diff --git a/en/.doctrees/agentscope.service.text_processing.summarization.doctree b/en/.doctrees/agentscope.service.text_processing.summarization.doctree new file mode 100644 index 000000000..f739bcdf5 Binary files /dev/null and b/en/.doctrees/agentscope.service.text_processing.summarization.doctree differ diff --git a/en/.doctrees/agentscope.service.web.arxiv.doctree b/en/.doctrees/agentscope.service.web.arxiv.doctree new file mode 100644 index 000000000..956e03a02 Binary files /dev/null and b/en/.doctrees/agentscope.service.web.arxiv.doctree differ diff --git a/en/.doctrees/agentscope.service.web.download.doctree b/en/.doctrees/agentscope.service.web.download.doctree new file mode 100644 index 000000000..a63412215 Binary files /dev/null and b/en/.doctrees/agentscope.service.web.download.doctree differ diff --git a/en/.doctrees/agentscope.service.web.search.doctree b/en/.doctrees/agentscope.service.web.search.doctree new file mode 100644 index 000000000..6de771626 Binary files /dev/null and b/en/.doctrees/agentscope.service.web.search.doctree differ diff --git a/en/.doctrees/agentscope.service.web.web_digest.doctree b/en/.doctrees/agentscope.service.web.web_digest.doctree new file mode 100644 index 000000000..cf97dc518 Binary files /dev/null and b/en/.doctrees/agentscope.service.web.web_digest.doctree differ diff --git a/en/.doctrees/agentscope.utils.common.doctree b/en/.doctrees/agentscope.utils.common.doctree new file mode 100644 index 000000000..43581cdd5 Binary files /dev/null and b/en/.doctrees/agentscope.utils.common.doctree differ diff --git a/en/.doctrees/agentscope.utils.doctree b/en/.doctrees/agentscope.utils.doctree index 9ac308d2c..97abc2297 100644 Binary files a/en/.doctrees/agentscope.utils.doctree and b/en/.doctrees/agentscope.utils.doctree differ diff --git a/en/.doctrees/agentscope.utils.logging_utils.doctree b/en/.doctrees/agentscope.utils.logging_utils.doctree new file mode 100644 index 000000000..6616bff49 Binary files /dev/null and b/en/.doctrees/agentscope.utils.logging_utils.doctree differ diff --git a/en/.doctrees/agentscope.utils.monitor.doctree b/en/.doctrees/agentscope.utils.monitor.doctree new file mode 100644 index 000000000..36a1c24d0 Binary files /dev/null and b/en/.doctrees/agentscope.utils.monitor.doctree differ diff --git a/en/.doctrees/agentscope.utils.token_utils.doctree b/en/.doctrees/agentscope.utils.token_utils.doctree new file mode 100644 index 000000000..2c2d2615f Binary files /dev/null and b/en/.doctrees/agentscope.utils.token_utils.doctree differ diff --git a/en/.doctrees/agentscope.utils.tools.doctree b/en/.doctrees/agentscope.utils.tools.doctree new file mode 100644 index 000000000..dae4661ba Binary files /dev/null and b/en/.doctrees/agentscope.utils.tools.doctree differ diff --git a/en/.doctrees/agentscope.web.studio.constants.doctree b/en/.doctrees/agentscope.web.studio.constants.doctree new file mode 100644 index 000000000..a7fa9af0b Binary files /dev/null and b/en/.doctrees/agentscope.web.studio.constants.doctree differ diff --git a/en/.doctrees/agentscope.web.studio.studio.doctree b/en/.doctrees/agentscope.web.studio.studio.doctree new file mode 100644 index 000000000..659386382 Binary files /dev/null and b/en/.doctrees/agentscope.web.studio.studio.doctree differ diff --git a/en/.doctrees/agentscope.web.studio.utils.doctree b/en/.doctrees/agentscope.web.studio.utils.doctree new file mode 100644 index 000000000..1eaac289b Binary files /dev/null and b/en/.doctrees/agentscope.web.studio.utils.doctree differ diff --git a/en/.doctrees/agentscope.web.workstation.workflow.doctree b/en/.doctrees/agentscope.web.workstation.workflow.doctree new file mode 100644 index 000000000..5058828e8 Binary files /dev/null and b/en/.doctrees/agentscope.web.workstation.workflow.doctree differ diff --git a/en/.doctrees/agentscope.web.workstation.workflow_dag.doctree b/en/.doctrees/agentscope.web.workstation.workflow_dag.doctree new file mode 100644 index 000000000..9dd564cc7 Binary files /dev/null and b/en/.doctrees/agentscope.web.workstation.workflow_dag.doctree differ diff --git a/en/.doctrees/agentscope.web.workstation.workflow_node.doctree b/en/.doctrees/agentscope.web.workstation.workflow_node.doctree new file mode 100644 index 000000000..4fa3629c5 Binary files /dev/null and b/en/.doctrees/agentscope.web.workstation.workflow_node.doctree differ diff --git a/en/.doctrees/agentscope.web.workstation.workflow_utils.doctree b/en/.doctrees/agentscope.web.workstation.workflow_utils.doctree new file mode 100644 index 000000000..8b5d7177d Binary files /dev/null and b/en/.doctrees/agentscope.web.workstation.workflow_utils.doctree differ diff --git a/en/.doctrees/environment.pickle b/en/.doctrees/environment.pickle index 100193d4b..c478eb707 100644 Binary files a/en/.doctrees/environment.pickle and b/en/.doctrees/environment.pickle differ diff --git a/en/.doctrees/index.doctree b/en/.doctrees/index.doctree index a05d68930..8279c5e64 100644 Binary files a/en/.doctrees/index.doctree and b/en/.doctrees/index.doctree differ diff --git a/en/_modules/agentscope/_init.html b/en/_modules/agentscope/_init.html index 3a0970869..e6dae9034 100644 --- a/en/_modules/agentscope/_init.html +++ b/en/_modules/agentscope/_init.html @@ -57,15 +57,17 @@

AgentScope API Reference

diff --git a/en/_modules/agentscope/agents/agent.html b/en/_modules/agentscope/agents/agent.html index 3120567f5..75c89456c 100644 --- a/en/_modules/agentscope/agents/agent.html +++ b/en/_modules/agentscope/agents/agent.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -120,7 +122,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] class AgentBase(Operator, metaclass=_RecordInitSettingMeta): """Base class for all agents. @@ -130,6 +132,8 @@

Source code for agentscope.agents.agent

 
     _version: int = 1
 
+
+[docs] def __init__( self, name: str, @@ -174,10 +178,11 @@

Source code for agentscope.agents.agent

 
         # The audience of this agent, which means if this agent generates a
         # response, it will be passed to all agents in the audience.
-        self._audience = None
+        self._audience = None
+
-[docs] +[docs] @classmethod def generate_agent_id(cls) -> str: """Generate the agent_id of this agent instance""" @@ -186,7 +191,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def reply(self, x: dict = None) -> dict: """Define the actions taken by this agent. @@ -208,7 +213,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def load_from_config(self, config: dict) -> None: """Load configuration for this agent. @@ -218,7 +223,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def export_config(self) -> dict: """Return configuration of this agent. @@ -229,7 +234,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def load_memory(self, memory: Sequence[dict]) -> None: r"""Load input memory."""
@@ -246,7 +251,7 @@

Source code for agentscope.agents.agent

         return res
 
 
-[docs] +[docs] def speak( self, content: Union[str, dict], @@ -256,7 +261,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def observe(self, x: Union[dict, Sequence[dict]]) -> None: """Observe the input, store it in memory without response to it. @@ -269,7 +274,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def reset_audience(self, audience: Sequence[AgentBase]) -> None: """Set the audience of this agent, which means if this agent generates a response, it will be passed to all audiences. @@ -285,7 +290,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def clear_audience(self) -> None: """Remove the audience of this agent.""" # TODO: we leave the consideration of nested msghub for future. @@ -294,7 +299,7 @@

Source code for agentscope.agents.agent

 
 
 
-[docs] +[docs] def rm_audience( self, audience: Union[Sequence[AgentBase], AgentBase], @@ -328,7 +333,7 @@

Source code for agentscope.agents.agent

         return self._agent_id
 
 
-[docs] +[docs] def to_dist( self, host: str = "localhost", diff --git a/en/_modules/agentscope/agents/dialog_agent.html b/en/_modules/agentscope/agents/dialog_agent.html index 124b22581..d5e0ca853 100644 --- a/en/_modules/agentscope/agents/dialog_agent.html +++ b/en/_modules/agentscope/agents/dialog_agent.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -105,11 +107,13 @@

Source code for agentscope.agents.dialog_agent

-[docs] +[docs] class DialogAgent(AgentBase): """A simple agent used to perform a dialogue. Your can set its role by `sys_prompt`.""" +

+[docs] def __init__( self, name: str, @@ -151,11 +155,12 @@

Source code for agentscope.agents.dialog_agent

logger.warning( "The argument `prompt_type` is deprecated and " "will be removed in the future.", - ) + )

+ # TODO change typing from dict to MSG
-[docs] +[docs] def reply(self, x: dict = None) -> dict: """Reply function of the agent. Processes the input data, generates a prompt using the current dialogue memory and system diff --git a/en/_modules/agentscope/agents/dict_dialog_agent.html b/en/_modules/agentscope/agents/dict_dialog_agent.html index 6dfdd0581..346ae9e41 100644 --- a/en/_modules/agentscope/agents/dict_dialog_agent.html +++ b/en/_modules/agentscope/agents/dict_dialog_agent.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -107,6 +109,8 @@

Source code for agentscope.agents.dict_dialog_agent

from ..utils.tools import _convert_to_str +
+[docs] def parse_dict(response: ModelResponse) -> ModelResponse: """Parse function for DictDialogAgent""" try: @@ -123,16 +127,20 @@

Source code for agentscope.agents.dict_dialog_agent

# TODO: maybe using a more robust json library to handle this case response_dict = json.loads(response.text.replace("'", '"')) - return ModelResponse(raw=response_dict) + return ModelResponse(raw=response_dict)
+ +
+[docs] def default_response(response: ModelResponse) -> ModelResponse: """The default response of fault_handler""" - return ModelResponse(raw={"speak": response.text}) + return ModelResponse(raw={"speak": response.text})
+
-[docs] +[docs] class DictDialogAgent(AgentBase): """An agent that generates response in a dict format, where user can specify the required fields in the response via prompt, e.g. @@ -155,6 +163,8 @@

Source code for agentscope.agents.dict_dialog_agent

For usage example, please refer to the example of werewolf in `examples/game_werewolf`""" +
+[docs] def __init__( self, name: str, @@ -182,23 +192,20 @@

Source code for agentscope.agents.dict_dialog_agent

Whether the agent has memory. memory_config (`Optional[dict]`, defaults to `None`): The config of memory. - parse_func (`Optional[Callable[..., Any]]`, - defaults to `parse_dict`): + parse_func (`Optional[Callable[..., Any]]`, defaults to `parse_dict`): The function used to parse the model output, e.g. `json.loads`, which is used to extract json from the output. - fault_handler (`Optional[Callable[..., Any]]`, - defaults to `default_response`): + fault_handler (`Optional[Callable[..., Any]]`, defaults to `default_response`): The function used to handle the fault when parse_func fails to parse the model output. max_retries (`Optional[int]`, defaults to `None`): The maximum number of retries when failed to parse the model output. - prompt_type (`Optional[PromptType]`, defaults to - `PromptType.LIST`): + prompt_type (`Optional[PromptType]`, defaults to `PromptType.LIST`): The type of the prompt organization, chosen from `PromptType.LIST` or `PromptType.STRING`. - """ + """ # noqa super().__init__( name=name, sys_prompt=sys_prompt, @@ -216,11 +223,12 @@

Source code for agentscope.agents.dict_dialog_agent

logger.warning( "The argument `prompt_type` is deprecated and " "will be removed in the future.", - ) + )
+ # TODO change typing from dict to MSG
-[docs] +[docs] def reply(self, x: dict = None) -> dict: """Reply function of the agent. Processes the input data, generates a prompt using the current diff --git a/en/_modules/agentscope/agents/operator.html b/en/_modules/agentscope/agents/operator.html index 0fe7191d3..578821705 100644 --- a/en/_modules/agentscope/agents/operator.html +++ b/en/_modules/agentscope/agents/operator.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -101,7 +103,7 @@

Source code for agentscope.agents.operator

 
 
 
-[docs] +[docs] class Operator(ABC): """ Abstract base class `Operator` defines a protocol for classes that diff --git a/en/_modules/agentscope/agents/react_agent.html b/en/_modules/agentscope/agents/react_agent.html index 8aafa83c8..f4e6f655f 100644 --- a/en/_modules/agentscope/agents/react_agent.html +++ b/en/_modules/agentscope/agents/react_agent.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -162,7 +164,7 @@

Source code for agentscope.agents.react_agent

-[docs] +[docs] class ReActAgent(AgentBase): """An agent class that implements the ReAct algorithm. More details refer to https://arxiv.org/abs/2210.03629. @@ -173,6 +175,8 @@

Source code for agentscope.agents.react_agent

their own needs. """ +
+[docs] def __init__( self, name: str, @@ -224,10 +228,11 @@

Source code for agentscope.agents.react_agent

) # Put sys prompt into memory - self.memory.add(Msg("system", self.sys_prompt, role="system")) + self.memory.add(Msg("system", self.sys_prompt, role="system"))
+
-[docs] +[docs] def reply(self, x: dict = None) -> dict: """The reply function that achieves the ReAct algorithm. The more details please refer to https://arxiv.org/abs/2210.03629""" @@ -335,7 +340,7 @@

Source code for agentscope.agents.react_agent

-[docs] +[docs] def execute_func(self, index: int, func_call: dict) -> dict: """Execute the tool function and return the result. @@ -380,7 +385,7 @@

Source code for agentscope.agents.react_agent

-[docs] +[docs] def prepare_funcs_prompt(self, tools: List[Tuple]) -> Tuple[str, dict]: """Convert function descriptions from json schema format to string prompt format. diff --git a/en/_modules/agentscope/agents/rpc_agent.html b/en/_modules/agentscope/agents/rpc_agent.html index 8c80b5cae..c1d80a69f 100644 --- a/en/_modules/agentscope/agents/rpc_agent.html +++ b/en/_modules/agentscope/agents/rpc_agent.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -134,6 +136,8 @@

Source code for agentscope.agents.rpc_agent

 )
 
 
+
+[docs] def rpc_servicer_method( # type: ignore[no-untyped-def] func, ): @@ -149,14 +153,17 @@

Source code for agentscope.agents.rpc_agent

             raise RuntimeError(error_msg)
         return func(rpc_agent, msg)
 
-    return inner
+    return inner
+
-[docs] +[docs] class RpcAgent(AgentBase): """A wrapper to extend an AgentBase into a gRPC Client.""" +
+[docs] def __init__( self, name: str, @@ -237,7 +244,8 @@

Source code for agentscope.agents.rpc_agent

             )
             self.client.create_agent(
                 agent_configs if create_with_agent_configs else None,
-            )
+            )
+ def _launch_server(self) -> None: """Launch a rpc server and update the port and the client""" @@ -250,7 +258,7 @@

Source code for agentscope.agents.rpc_agent

         )
 
 
-[docs] +[docs] def reply(self, x: dict = None) -> dict: if self.client is None: self._launch_server() @@ -263,7 +271,7 @@

Source code for agentscope.agents.rpc_agent

 
 
 
-[docs] +[docs] def observe(self, x: Union[dict, Sequence[dict]]) -> None: if self.client is None: self._launch_server() @@ -274,7 +282,7 @@

Source code for agentscope.agents.rpc_agent

 
 
 
-[docs] +[docs] def clone_instances( self, num_instances: int, @@ -322,7 +330,7 @@

Source code for agentscope.agents.rpc_agent

 
 
 
-[docs] +[docs] def stop(self) -> None: """Stop the RpcAgent and the rpc server.""" if self.server_launcher is not None: @@ -334,6 +342,8 @@

Source code for agentscope.agents.rpc_agent

 
 
 
+
+[docs] def setup_rpc_agent_server( agent_class: Type[AgentBase], agent_args: tuple, @@ -430,16 +440,22 @@

Source code for agentscope.agents.rpc_agent

     logger.info(
         f"rpc server [{agent_class.__name__}] at port [{port}] stopped "
         "successfully",
-    )
+    )
+ +
+[docs] def find_available_port() -> int: """Get an unoccupied socket port number.""" with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind(("", 0)) - return s.getsockname()[1] + return s.getsockname()[1]
+ +
+[docs] def check_port(port: Optional[int] = None) -> int: """Check if the port is available. @@ -466,14 +482,17 @@

Source code for agentscope.agents.rpc_agent

                 f"Port [{port}] is occupied, use [{new_port}] instead",
             )
             return new_port
-    return port
+    return port
+
-[docs] +[docs] class RpcAgentServerLauncher: """Launcher of rpc agent server.""" +
+[docs] def __init__( self, agent_class: Type[AgentBase] = None, @@ -516,7 +535,8 @@

Source code for agentscope.agents.rpc_agent

         self.local_mode = local_mode
         self.server = None
         self.stop_event = None
-        self.parent_con = None
+        self.parent_con = None
+ def _launch_in_main(self) -> None: """Launch gRPC server in main-process""" @@ -572,7 +592,7 @@

Source code for agentscope.agents.rpc_agent

         )
 
 
-[docs] +[docs] def launch(self, in_subprocess: bool = True) -> None: """launch a rpc agent server. @@ -588,7 +608,7 @@

Source code for agentscope.agents.rpc_agent

 
 
 
-[docs] +[docs] def wait_until_terminate(self) -> None: """Wait for server process""" if self.server is not None: @@ -596,7 +616,7 @@

Source code for agentscope.agents.rpc_agent

 
 
 
-[docs] +[docs] def shutdown(self) -> None: """Shutdown the rpc agent server.""" if self.server is not None: @@ -615,9 +635,13 @@

Source code for agentscope.agents.rpc_agent

 
 
 
+
+[docs] class RpcServerSideWrapper(RpcAgentServicer): """A wrapper to extend an AgentBase into a gRPC Servicer.""" +
+[docs] def __init__( self, agent_class: Type[AgentBase], @@ -662,14 +686,20 @@

Source code for agentscope.agents.rpc_agent

         self.task_id_lock = threading.Lock()
         self.agent_id_lock = threading.Lock()
         self.task_id_counter = 0
-        self.agent_pool: dict[str, AgentBase] = {}
+        self.agent_pool: dict[str, AgentBase] = {}
+ +
+[docs] def get_task_id(self) -> int: """Get the auto-increment task id.""" with self.task_id_lock: self.task_id_counter += 1 - return self.task_id_counter + return self.task_id_counter
+ +
+[docs] def check_and_generate_agent( self, agent_id: str, @@ -696,8 +726,11 @@

Source code for agentscope.agents.rpc_agent

                     )
                 agent_instance._agent_id = agent_id  # pylint: disable=W0212
                 self.agent_pool[agent_id] = agent_instance
-                logger.info(f"create agent instance [{agent_id}]")
+                logger.info(f"create agent instance [{agent_id}]")
+ +
+[docs] def check_and_delete_agent(self, agent_id: str) -> None: """ Check whether the agent exists, and delete the agent instance @@ -709,8 +742,11 @@

Source code for agentscope.agents.rpc_agent

         with self.agent_id_lock:
             if agent_id in self.agent_pool:
                 self.agent_pool.pop(agent_id)
-                logger.info(f"delete agent instance [{agent_id}]")
+                logger.info(f"delete agent instance [{agent_id}]")
+ +
+[docs] def call_func(self, request: RpcMsg, _: ServicerContext) -> RpcMsg: """Call the specific servicer function.""" if hasattr(self, request.target_func): @@ -726,7 +762,8 @@

Source code for agentscope.agents.rpc_agent

                     content=f"Unsupported method {request.target_func}",
                     role="assistant",
                 ).serialize(),
-            )
+            )
+ def _reply(self, request: RpcMsg) -> RpcMsg: """Call function of RpcAgentService @@ -822,6 +859,8 @@

Source code for agentscope.agents.rpc_agent

         self.check_and_delete_agent(request.agent_id)
         return RpcMsg()
 
+
+[docs] def process_messages( self, task_id: int, @@ -845,7 +884,9 @@

Source code for agentscope.agents.rpc_agent

                 content=f"Error in agent [{agent_id}]:\n{error_msg}",
             )
         with cond:
-            cond.notify_all()
+            cond.notify_all()
+
+
diff --git a/en/_modules/agentscope/agents/text_to_image_agent.html b/en/_modules/agentscope/agents/text_to_image_agent.html index d8785ffb1..b64514501 100644 --- a/en/_modules/agentscope/agents/text_to_image_agent.html +++ b/en/_modules/agentscope/agents/text_to_image_agent.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -103,7 +105,7 @@

Source code for agentscope.agents.text_to_image_agent

-[docs] +[docs] class TextToImageAgent(AgentBase): """ A agent used to perform text to image tasks. @@ -111,6 +113,8 @@

Source code for agentscope.agents.text_to_image_agent

TODO: change the agent into a service. """ +
+[docs] def __init__( self, name: str, @@ -137,10 +141,11 @@

Source code for agentscope.agents.text_to_image_agent

model_config_name=model_config_name, use_memory=use_memory, memory_config=memory_config, - ) + )
+
-[docs] +[docs] def reply(self, x: dict = None) -> dict: if self.memory: self.memory.add(x) diff --git a/en/_modules/agentscope/agents/user_agent.html b/en/_modules/agentscope/agents/user_agent.html index 28988ef37..e12fa8eb6 100644 --- a/en/_modules/agentscope/agents/user_agent.html +++ b/en/_modules/agentscope/agents/user_agent.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -106,10 +108,12 @@

Source code for agentscope.agents.user_agent

-[docs]
+[docs]
 class UserAgent(AgentBase):
     """User agent class"""
 
+
+[docs] def __init__(self, name: str = "User", require_url: bool = False) -> None: """Initialize a UserAgent object. @@ -125,10 +129,11 @@

Source code for agentscope.agents.user_agent

super().__init__(name=name)
 
         self.name = name
-        self.require_url = require_url
+        self.require_url = require_url
+
-[docs] +[docs] def reply( self, x: dict = None, @@ -201,7 +206,7 @@

Source code for agentscope.agents.user_agent

-[docs]
+[docs]
     def speak(
         self,
         content: Union[str, dict],
diff --git a/en/_modules/agentscope/constants.html b/en/_modules/agentscope/constants.html
new file mode 100644
index 000000000..a25c4d4d2
--- /dev/null
+++ b/en/_modules/agentscope/constants.html
@@ -0,0 +1,194 @@
+
+
+
+
+  
+  
+  agentscope.constants — AgentScope  documentation
+      
+      
+      
+
+  
+  
+  
+        
+        
+        
+        
+        
+        
+        
+    
+    
+     
+
+
+ 
+  
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.constants

+# -*- coding: utf-8 -*-
+""" Some constants used in the project"""
+from numbers import Number
+from enum import IntEnum
+
+PACKAGE_NAME = "agentscope"
+MSG_TOKEN = f"[{PACKAGE_NAME}_msg]"
+
+
+# default values
+
+# for file manager
+_DEFAULT_DIR = "./runs"
+_DEFAULT_LOG_LEVEL = "INFO"
+_DEFAULT_SUBDIR_CODE = "code"
+_DEFAULT_SUBDIR_FILE = "file"
+_DEFAULT_SUBDIR_INVOKE = "invoke"
+_DEFAULT_CFG_NAME = ".config"
+_DEFAULT_IMAGE_NAME = "image_{}_{}.png"
+_DEFAULT_SQLITE_DB_PATH = "agentscope.db"
+
+
+# for model wrapper
+_DEFAULT_MAX_RETRIES = 3
+_DEFAULT_MESSAGES_KEY = "inputs"
+_DEFAULT_RETRY_INTERVAL = 1
+_DEFAULT_API_BUDGET = None
+# for execute python
+_DEFAULT_PYPI_MIRROR = "http://mirrors.aliyun.com/pypi/simple/"
+_DEFAULT_TRUSTED_HOST = "mirrors.aliyun.com"
+# for monitor
+_DEFAULT_MONITOR_TABLE_NAME = "monitor_metrics"
+# for summarization
+_DEFAULT_SUMMARIZATION_PROMPT = """
+TEXT: {}
+"""
+_DEFAULT_SYSTEM_PROMPT = """
+You are a helpful agent to summarize the text.
+You need to keep all the key information of the text in the summary.
+"""
+_DEFAULT_TOKEN_LIMIT_PROMPT = """
+Summarize the text after TEXT in less than {} tokens:
+"""
+
+# typing
+Embedding = list[Number]
+
+
+# enums
+
+[docs] +class ResponseFormat(IntEnum): + """Enum for model response format.""" + + NONE = 0 + JSON = 1
+ + + +
+[docs] +class ShrinkPolicy(IntEnum): + """Enum for shrink strategies when the prompt is too long.""" + + TRUNCATE = 0 + SUMMARIZE = 1
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/memory/memory.html b/en/_modules/agentscope/memory/memory.html index fc8bbda55..61dbb549a 100644 --- a/en/_modules/agentscope/memory/memory.html +++ b/en/_modules/agentscope/memory/memory.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -109,12 +111,14 @@

Source code for agentscope.memory.memory

 
 
 
-[docs] +[docs] class MemoryBase(ABC): """Base class for memory.""" _version: int = 1 +
+[docs] def __init__( self, config: Optional[dict] = None, @@ -125,10 +129,11 @@

Source code for agentscope.memory.memory

             config (`Optional[dict]`, defaults to `None`):
                 Configuration of this memory.
         """
-        self.config = {} if config is None else config
+        self.config = {} if config is None else config
+
-[docs] +[docs] def update_config(self, config: dict) -> None: """ Configure memory as specified in config @@ -137,7 +142,7 @@

Source code for agentscope.memory.memory

 
 
 
-[docs] +[docs] @abstractmethod def get_memory( self, @@ -151,7 +156,7 @@

Source code for agentscope.memory.memory

 
 
 
-[docs] +[docs] @abstractmethod def add(self, memories: Union[list[dict], dict, None]) -> None: """ @@ -160,7 +165,7 @@

Source code for agentscope.memory.memory

 
 
 
-[docs] +[docs] @abstractmethod def delete(self, index: Union[Iterable, int]) -> None: """ @@ -170,7 +175,7 @@

Source code for agentscope.memory.memory

 
 
 
-[docs] +[docs] @abstractmethod def load( self, @@ -184,7 +189,7 @@

Source code for agentscope.memory.memory

 
 
 
-[docs] +[docs] @abstractmethod def export( self, @@ -195,14 +200,14 @@

Source code for agentscope.memory.memory

 
 
 
-[docs] +[docs] @abstractmethod def clear(self) -> None: """Clean memory, depending on how the memory are stored"""
-[docs] +[docs] @abstractmethod def size(self) -> int: """Returns the number of memory segments in memory.""" diff --git a/en/_modules/agentscope/memory/temporary_memory.html b/en/_modules/agentscope/memory/temporary_memory.html index 8dd03774e..313884ab5 100644 --- a/en/_modules/agentscope/memory/temporary_memory.html +++ b/en/_modules/agentscope/memory/temporary_memory.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -114,12 +116,14 @@

Source code for agentscope.memory.temporary_memory

-[docs] +[docs] class TemporaryMemory(MemoryBase): """ In-memory memory module, not writing to hard disk """ +
+[docs] def __init__( self, config: Optional[dict] = None, @@ -133,10 +137,11 @@

Source code for agentscope.memory.temporary_memory

if isinstance(embedding_model, str): self.embedding_model = load_model_by_config_name(embedding_model) else: - self.embedding_model = embedding_model + self.embedding_model = embedding_model
+
-[docs] +[docs] def add( self, memories: Union[Sequence[dict], dict, None], @@ -171,7 +176,7 @@

Source code for agentscope.memory.temporary_memory

-[docs] +[docs] def delete(self, index: Union[Iterable, int]) -> None: if self.size() == 0: logger.warning( @@ -203,7 +208,7 @@

Source code for agentscope.memory.temporary_memory

-[docs] +[docs] def export( self, to_mem: bool = False, @@ -225,7 +230,7 @@

Source code for agentscope.memory.temporary_memory

-[docs] +[docs] def load( self, memories: Union[str, dict, list], @@ -264,21 +269,21 @@

Source code for agentscope.memory.temporary_memory

-[docs] +[docs] def clear(self) -> None: """Clean memory, depending on how the memory are stored""" self._content = []
-[docs] +[docs] def size(self) -> int: """Returns the number of memory segments in memory.""" return len(self._content)
-[docs] +[docs] def retrieve_by_embedding( self, query: Union[str, Embedding], @@ -335,7 +340,7 @@

Source code for agentscope.memory.temporary_memory

-[docs] +[docs] def get_embeddings( self, embedding_model: Callable[[Union[str, dict]], Embedding] = None, @@ -364,7 +369,7 @@

Source code for agentscope.memory.temporary_memory

-[docs] +[docs] def get_memory( self, recent_n: Optional[int] = None, diff --git a/en/_modules/agentscope/message.html b/en/_modules/agentscope/message.html new file mode 100644 index 000000000..33312a401 --- /dev/null +++ b/en/_modules/agentscope/message.html @@ -0,0 +1,584 @@ + + + + + + + agentscope.message — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.message

+# -*- coding: utf-8 -*-
+"""The base class for message unit"""
+
+from typing import Any, Optional, Union, Sequence, Literal
+from uuid import uuid4
+import json
+
+from loguru import logger
+
+from .rpc import RpcAgentClient, ResponseStub, call_in_thread
+from .utils.tools import _get_timestamp
+
+
+
+[docs] +class MessageBase(dict): + """Base Message class, which is used to maintain information for dialog, + memory and used to construct prompt. + """ + +
+[docs] + def __init__( + self, + name: str, + content: Any, + role: Literal["user", "system", "assistant"] = "assistant", + url: Optional[Union[Sequence[str], str]] = None, + timestamp: Optional[str] = None, + **kwargs: Any, + ) -> None: + """Initialize the message object + + Args: + name (`str`): + The name of who send the message. It's often used in + role-playing scenario to tell the name of the sender. + content (`Any`): + The content of the message. + role (`Literal["system", "user", "assistant"]`, defaults to "assistant"): + The role of who send the message. It can be one of the + `"system"`, `"user"`, or `"assistant"`. Default to + `"assistant"`. + url (`Optional[Union[list[str], str]]`, defaults to None): + A url to file, image, video, audio or website. + timestamp (`Optional[str]`, defaults to None): + The timestamp of the message, if None, it will be set to + current time. + **kwargs (`Any`): + Other attributes of the message. + """ # noqa + # id and timestamp will be added to the object as its attributes + # rather than items in dict + self.id = uuid4().hex + if timestamp is None: + self.timestamp = _get_timestamp() + else: + self.timestamp = timestamp + + self.name = name + self.content = content + self.role = role + + if url: + self.url = url + else: + self.url = None + + self.update(kwargs)
+ + + def __getattr__(self, key: Any) -> Any: + try: + return self[key] + except KeyError as e: + raise AttributeError(f"no attribute '{key}'") from e + + def __setattr__(self, key: Any, value: Any) -> None: + self[key] = value + + def __delattr__(self, key: Any) -> None: + try: + del self[key] + except KeyError as e: + raise AttributeError(f"no attribute '{key}'") from e + +
+[docs] + def to_str(self) -> str: + """Return the string representation of the message""" + raise NotImplementedError
+ + +
+[docs] + def serialize(self) -> str: + """Return the serialized message.""" + raise NotImplementedError
+
+ + + +
+[docs] +class Msg(MessageBase): + """The Message class.""" + +
+[docs] + def __init__( + self, + name: str, + content: Any, + role: Literal["system", "user", "assistant"] = None, + url: Optional[Union[Sequence[str], str]] = None, + timestamp: Optional[str] = None, + echo: bool = False, + **kwargs: Any, + ) -> None: + """Initialize the message object + + Args: + name (`str`): + The name of who send the message. + content (`Any`): + The content of the message. + role (`Literal["system", "user", "assistant"]`): + Used to identify the source of the message, e.g. the system + information, the user input, or the model response. This + argument is used to accommodate most Chat API formats. + url (`Optional[Union[list[str], str]]`, defaults to `None`): + A url to file, image, video, audio or website. + timestamp (`Optional[str]`, defaults to `None`): + The timestamp of the message, if None, it will be set to + current time. + **kwargs (`Any`): + Other attributes of the message. + """ + + if role is None: + logger.warning( + "A new field `role` is newly added to the message. " + "Please specify the role of the message. Currently we use " + 'a default "assistant" value.', + ) + + super().__init__( + name=name, + content=content, + role=role or "assistant", + url=url, + timestamp=timestamp, + **kwargs, + ) + if echo: + logger.chat(self)
+ + +
+[docs] + def to_str(self) -> str: + """Return the string representation of the message""" + return f"{self.name}: {self.content}"
+ + +
+[docs] + def serialize(self) -> str: + return json.dumps({"__type": "Msg", **self})
+
+ + + +
+[docs] +class Tht(MessageBase): + """The Thought message is used to record the thought of the agent to + help them make decisions and responses. Generally, it shouldn't be + passed to or seen by the other agents. + + In our framework, we formulate the thought in prompt as follows: + - For OpenAI API calling: + + .. code-block:: python + + [ + ... + { + "role": "assistant", + "name": "thought", + "content": "I should ..." + }, + ... + ] + + - For open-source models that accepts string as input: + + .. code-block:: python + + ... + {self.name} thought: I should ... + ... + + We admit that there maybe better ways to formulate the thought. Users + are encouraged to create their own thought formulation methods by + inheriting `MessageBase` class and rewrite the `__init__` and `to_str` + function. + + .. code-block:: python + + class MyThought(MessageBase): + def to_str(self) -> str: + # implement your own thought formulation method + pass + """ + +
+[docs] + def __init__( + self, + content: Any, + timestamp: Optional[str] = None, + ) -> None: + super().__init__( + name="thought", + content=content, + role="assistant", + timestamp=timestamp, + )
+ + +
+[docs] + def to_str(self) -> str: + """Return the string representation of the message""" + return f"{self.name} thought: {self.content}"
+ + +
+[docs] + def serialize(self) -> str: + return json.dumps({"__type": "Tht", **self})
+
+ + + +
+[docs] +class PlaceholderMessage(MessageBase): + """A placeholder for the return message of RpcAgent.""" + + PLACEHOLDER_ATTRS = { + "_host", + "_port", + "_client", + "_task_id", + "_stub", + "_is_placeholder", + } + + LOCAL_ATTRS = { + "name", + "timestamp", + *PLACEHOLDER_ATTRS, + } + +
+[docs] + def __init__( + self, + name: str, + content: Any, + url: Optional[Union[Sequence[str], str]] = None, + timestamp: Optional[str] = None, + host: str = None, + port: int = None, + task_id: int = None, + client: Optional[RpcAgentClient] = None, + x: dict = None, + **kwargs: Any, + ) -> None: + """A placeholder message, records the address of the real message. + + Args: + name (`str`): + The name of who send the message. It's often used in + role-playing scenario to tell the name of the sender. + However, you can also only use `role` when calling openai api. + The usage of `name` refers to + https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models. + content (`Any`): + The content of the message. + role (`Literal["system", "user", "assistant"]`, defaults to "assistant"): + The role of the message, which can be one of the `"system"`, + `"user"`, or `"assistant"`. + url (`Optional[Union[list[str], str]]`, defaults to None): + A url to file, image, video, audio or website. + timestamp (`Optional[str]`, defaults to None): + The timestamp of the message, if None, it will be set to + current time. + host (`str`, defaults to `None`): + The hostname of the rpc server where the real message is + located. + port (`int`, defaults to `None`): + The port of the rpc server where the real message is located. + task_id (`int`, defaults to `None`): + The task id of the real message in the rpc server. + client (`RpcAgentClient`, defaults to `None`): + An RpcAgentClient instance used to connect to the generator of + this placeholder. + x (`dict`, defaults to `None`): + Input parameters used to call rpc methods on the client. + """ # noqa + super().__init__( + name=name, + content=content, + url=url, + timestamp=timestamp, + **kwargs, + ) + # placeholder indicates whether the real message is still in rpc server + self._is_placeholder = True + if client is None: + self._stub: ResponseStub = None + self._host: str = host + self._port: int = port + self._task_id: int = task_id + else: + self._stub = call_in_thread(client, x, "_reply") + self._host = client.host + self._port = client.port + self._task_id = None
+ + + def __is_local(self, key: Any) -> bool: + return ( + key in PlaceholderMessage.LOCAL_ATTRS or not self._is_placeholder + ) + + def __getattr__(self, __name: str) -> Any: + """Get attribute value from PlaceholderMessage. Get value from rpc + agent server if necessary. + + Args: + __name (`str`): + Attribute name. + """ + if not self.__is_local(__name): + self.update_value() + return MessageBase.__getattr__(self, __name) + + def __getitem__(self, __key: Any) -> Any: + """Get item value from PlaceholderMessage. Get value from rpc + agent server if necessary. + + Args: + __key (`Any`): + Item name. + """ + if not self.__is_local(__key): + self.update_value() + return MessageBase.__getitem__(self, __key) + +
+[docs] + def to_str(self) -> str: + return f"{self.name}: {self.content}"
+ + +
+[docs] + def update_value(self) -> MessageBase: + """Get attribute values from rpc agent server immediately""" + if self._is_placeholder: + # retrieve real message from rpc agent server + self.__update_task_id() + client = RpcAgentClient(self._host, self._port) + result = client.call_func( + func_name="_get", + value=json.dumps({"task_id": self._task_id}), + ) + msg = deserialize(result) + status = msg.pop("__status", "OK") + if status == "ERROR": + raise RuntimeError(msg.content) + self.update(msg) + # the actual value has been updated, not a placeholder any more + self._is_placeholder = False + return self
+ + + def __update_task_id(self) -> None: + if self._stub is not None: + resp = deserialize(self._stub.get_response()) + self._task_id = resp["task_id"] # type: ignore[call-overload] + self._stub = None + +
+[docs] + def serialize(self) -> str: + if self._is_placeholder: + self.__update_task_id() + return json.dumps( + { + "__type": "PlaceholderMessage", + "name": self.name, + "content": None, + "timestamp": self.timestamp, + "host": self._host, + "port": self._port, + "task_id": self._task_id, + }, + ) + else: + states = { + k: v + for k, v in self.items() + if k not in PlaceholderMessage.PLACEHOLDER_ATTRS + } + states["__type"] = "Msg" + return json.dumps(states)
+
+ + + +_MSGS = { + "Msg": Msg, + "Tht": Tht, + "PlaceholderMessage": PlaceholderMessage, +} + + +
+[docs] +def deserialize(s: str) -> Union[MessageBase, Sequence]: + """Deserialize json string into MessageBase""" + js_msg = json.loads(s) + msg_type = js_msg.pop("__type") + if msg_type == "List": + return [deserialize(s) for s in js_msg["__value"]] + elif msg_type not in _MSGS: + raise NotImplementedError( + "Deserialization of {msg_type} is not supported.", + ) + return _MSGS[msg_type](**js_msg)
+ + + +
+[docs] +def serialize(messages: Union[Sequence[MessageBase], MessageBase]) -> str: + """Serialize multiple MessageBase instance""" + if isinstance(messages, MessageBase): + return messages.serialize() + seq = [msg.serialize() for msg in messages] + return json.dumps({"__type": "List", "__value": seq})
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/models.html b/en/_modules/agentscope/models.html index 5145e1eb7..8693d2af7 100644 --- a/en/_modules/agentscope/models.html +++ b/en/_modules/agentscope/models.html @@ -57,15 +57,17 @@

AgentScope API Reference

diff --git a/en/_modules/agentscope/models/dashscope_model.html b/en/_modules/agentscope/models/dashscope_model.html index 675b3233f..8449bc4a4 100644 --- a/en/_modules/agentscope/models/dashscope_model.html +++ b/en/_modules/agentscope/models/dashscope_model.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -115,9 +117,13 @@

Source code for agentscope.models.dashscope_model

from ..file_manager import file_manager +
+[docs] class DashScopeWrapperBase(ModelWrapperBase, ABC): """The model wrapper for DashScope API.""" +
+[docs] def __init__( self, config_name: str, @@ -158,8 +164,11 @@

Source code for agentscope.models.dashscope_model

self.max_length = None # Set monitor accordingly - self._register_default_metrics() + self._register_default_metrics()
+ +
+[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -168,11 +177,13 @@

Source code for agentscope.models.dashscope_model

f"Model Wrapper [{type(self).__name__}] doesn't " f"need to format the input. Please try to use the " f"model wrapper directly.", - ) + )
+
+
-[docs] +[docs] class DashScopeChatWrapper(DashScopeWrapperBase): """The model wrapper for DashScope's chat API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/api-details @@ -310,7 +321,7 @@

Source code for agentscope.models.dashscope_model

)
-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -419,7 +430,7 @@

Source code for agentscope.models.dashscope_model

-[docs] +[docs] class DashScopeImageSynthesisWrapper(DashScopeWrapperBase): """The model wrapper for DashScope Image Synthesis API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/quick-start-1 @@ -524,7 +535,7 @@

Source code for agentscope.models.dashscope_model

-[docs] +[docs] class DashScopeTextEmbeddingWrapper(DashScopeWrapperBase): """The model wrapper for DashScope Text Embedding API.""" @@ -628,7 +639,7 @@

Source code for agentscope.models.dashscope_model

-[docs] +[docs] class DashScopeMultiModalWrapper(DashScopeWrapperBase): """The model wrapper for DashScope Multimodal API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-api @@ -770,7 +781,7 @@

Source code for agentscope.models.dashscope_model

)
-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], diff --git a/en/_modules/agentscope/models/gemini_model.html b/en/_modules/agentscope/models/gemini_model.html index 7f58de352..815887a79 100644 --- a/en/_modules/agentscope/models/gemini_model.html +++ b/en/_modules/agentscope/models/gemini_model.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -113,6 +115,8 @@

Source code for agentscope.models.gemini_model

genai = None +

+[docs] class GeminiWrapperBase(ModelWrapperBase, ABC): """The base class for Google Gemini model wrapper.""" @@ -120,6 +124,8 @@

Source code for agentscope.models.gemini_model

"""The generation method used in `__call__` function, which is used to filter models in `list_models` function.""" +

+[docs] def __init__( self, config_name: str, @@ -151,7 +157,8 @@

Source code for agentscope.models.gemini_model

self.model_name = model_name - self._register_default_metrics() + self._register_default_metrics()

+ def _register_default_metrics(self) -> None: """Register the default metrics for the model.""" @@ -159,6 +166,8 @@

Source code for agentscope.models.gemini_model

"The method `_register_default_metrics` must be implemented.", ) +

+[docs] def list_models(self) -> Sequence: """List all available models for this API calling.""" support_models = list(genai.list_models()) @@ -170,7 +179,8 @@

Source code for agentscope.models.gemini_model

_ for _ in support_models if self._generation_method in _.supported_generation_methods - ] + ]

+ def __call__(self, *args: Any, **kwargs: Any) -> ModelResponse: """Processing input with the model.""" @@ -178,11 +188,12 @@

Source code for agentscope.models.gemini_model

f"Model Wrapper [{type(self).__name__}]" f" is missing the the required `__call__`" f" method.", - ) + )

+
-[docs] +[docs] class GeminiChatWrapper(GeminiWrapperBase): """The wrapper for Google Gemini chat model, e.g. gemini-pro""" @@ -192,6 +203,8 @@

Source code for agentscope.models.gemini_model

generation_method = "generateContent" """The generation method used in `__call__` function.""" +

+[docs] def __init__( self, config_name: str, @@ -207,7 +220,8 @@

Source code for agentscope.models.gemini_model

) # Create the generative model - self.model = genai.GenerativeModel(model_name, **kwargs) + self.model = genai.GenerativeModel(model_name, **kwargs)

+ def __call__( self, @@ -296,7 +310,7 @@

Source code for agentscope.models.gemini_model

)

-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -396,7 +410,7 @@

Source code for agentscope.models.gemini_model

-[docs] +[docs] class GeminiEmbeddingWrapper(GeminiWrapperBase): """The wrapper for Google Gemini embedding model, e.g. models/embedding-001""" diff --git a/en/_modules/agentscope/models/model.html b/en/_modules/agentscope/models/model.html index b52a6c754..a1b494139 100644 --- a/en/_modules/agentscope/models/model.html +++ b/en/_modules/agentscope/models/model.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -268,7 +270,7 @@

Source code for agentscope.models.model

 
 
 
-[docs] +[docs] class ModelWrapperBase(metaclass=_ModelWrapperMeta): """The base class for model wrapper.""" @@ -282,6 +284,8 @@

Source code for agentscope.models.model

     model_name: str
     """The name of the model, which is used in model api calling."""
 
+
+[docs] def __init__( self, # pylint: disable=W0613 config_name: str, @@ -300,10 +304,11 @@

Source code for agentscope.models.model

         self.monitor = MonitorFactory.get_monitor()
 
         self.config_name = config_name
-        logger.info(f"Initialize model [{config_name}]")
+        logger.info(f"Initialize model [{config_name}]")
+
-[docs] +[docs] @classmethod def get_wrapper(cls, model_type: str) -> Type[ModelWrapperBase]: """Get the specific model wrapper""" @@ -331,7 +336,7 @@

Source code for agentscope.models.model

         )
 
 
-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -393,7 +398,7 @@

Source code for agentscope.models.model

             return get_full_name(name=metric_name)
 
 
-[docs] +[docs] def update_monitor(self, **kwargs: Any) -> None: """Update the monitor with the given values. diff --git a/en/_modules/agentscope/models/ollama_model.html b/en/_modules/agentscope/models/ollama_model.html index 0d0b5c065..b31452268 100644 --- a/en/_modules/agentscope/models/ollama_model.html +++ b/en/_modules/agentscope/models/ollama_model.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -111,6 +113,8 @@

Source code for agentscope.models.ollama_model

ollama = None +

+[docs] class OllamaWrapperBase(ModelWrapperBase, ABC): """The base class for Ollama model wrappers. @@ -136,6 +140,8 @@

Source code for agentscope.models.ollama_model

"""Controls how long the model will stay loaded into memory following the request.""" +

+[docs] def __init__( self, config_name: str, @@ -163,11 +169,13 @@

Source code for agentscope.models.ollama_model

self.options = options self.keep_alive = keep_alive - self._register_default_metrics() + self._register_default_metrics()

+
+
-[docs] +[docs] class OllamaChatWrapper(OllamaWrapperBase): """The model wrapper for Ollama chat API.""" @@ -265,7 +273,7 @@

Source code for agentscope.models.ollama_model

)

-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -323,7 +331,7 @@

Source code for agentscope.models.ollama_model

-[docs] +[docs] class OllamaEmbeddingWrapper(OllamaWrapperBase): """The model wrapper for Ollama embedding API.""" @@ -402,7 +410,7 @@

Source code for agentscope.models.ollama_model

)

-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -417,7 +425,7 @@

Source code for agentscope.models.ollama_model

-[docs] +[docs] class OllamaGenerationWrapper(OllamaWrapperBase): """The model wrapper for Ollama generation API.""" @@ -514,7 +522,7 @@

Source code for agentscope.models.ollama_model

)

-[docs] +[docs] def format(self, *args: Union[MessageBase, Sequence[MessageBase]]) -> str: """Forward the input to the model. diff --git a/en/_modules/agentscope/models/openai_model.html b/en/_modules/agentscope/models/openai_model.html index ec077f74c..572d2f03e 100644 --- a/en/_modules/agentscope/models/openai_model.html +++ b/en/_modules/agentscope/models/openai_model.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -116,10 +118,12 @@

Source code for agentscope.models.openai_model

-[docs] +[docs] class OpenAIWrapperBase(ModelWrapperBase, ABC): """The model wrapper for OpenAI API.""" +

+[docs] def __init__( self, config_name: str, @@ -185,10 +189,11 @@

Source code for agentscope.models.openai_model

# Set monitor accordingly self._register_budget(model_name, budget) - self._register_default_metrics() + self._register_default_metrics()

+
-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -203,7 +208,7 @@

Source code for agentscope.models.openai_model

-[docs] +[docs] class OpenAIChatWrapper(OpenAIWrapperBase): """The model wrapper for OpenAI's chat API.""" @@ -317,7 +322,7 @@

Source code for agentscope.models.openai_model

)

-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -363,7 +368,7 @@

Source code for agentscope.models.openai_model

-[docs] +[docs] class OpenAIDALLEWrapper(OpenAIWrapperBase): """The model wrapper for OpenAI's DALL·E API.""" @@ -477,7 +482,7 @@

Source code for agentscope.models.openai_model

-[docs] +[docs] class OpenAIEmbeddingWrapper(OpenAIWrapperBase): """The model wrapper for OpenAI embedding API.""" diff --git a/en/_modules/agentscope/models/post_model.html b/en/_modules/agentscope/models/post_model.html index 46d1e911a..1c4627763 100644 --- a/en/_modules/agentscope/models/post_model.html +++ b/en/_modules/agentscope/models/post_model.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -113,12 +115,14 @@

Source code for agentscope.models.post_model

-[docs]
+[docs]
 class PostAPIModelWrapperBase(ModelWrapperBase, ABC):
     """The base model wrapper for the model deployed on the POST API."""
 
     model_type: str = "post_api"
 
+
+[docs] def __init__( self, config_name: str, @@ -184,7 +188,8 @@

Source code for agentscope.models.post_model

self.post_args = post_args or {}
         self.max_retries = max_retries
         self.messages_key = messages_key
-        self.retry_interval = retry_interval
+        self.retry_interval = retry_interval
+ def _parse_response(self, response: dict) -> ModelResponse: """Parse the response json data into ModelResponse""" @@ -260,7 +265,7 @@

Source code for agentscope.models.post_model

-[docs]
+[docs]
 class PostAPIChatWrapper(PostAPIModelWrapperBase):
     """A post api model wrapper compatilble with openai chat, e.g., vLLM,
     FastChat."""
@@ -275,7 +280,7 @@ 

Source code for agentscope.models.post_model

)
 
 
-[docs] +[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -318,6 +323,8 @@

Source code for agentscope.models.post_model

+[docs]
 class PostAPIDALLEWrapper(PostAPIModelWrapperBase):
     """A post api model wrapper compatible with openai dall_e"""
 
@@ -336,6 +343,8 @@ 

Source code for agentscope.models.post_model

urls = [img["url"] for img in response["data"]["response"]["data"]]
         return ModelResponse(image_urls=urls)
 
+
+[docs] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -344,7 +353,9 @@

Source code for agentscope.models.post_model

f"Model Wrapper [{type(self).__name__}] doesn't "
             f"need to format the input. Please try to use the "
             f"model wrapper directly.",
-        )
+        )
+
+
diff --git a/en/_modules/agentscope/models/response.html b/en/_modules/agentscope/models/response.html index 84ebb10fa..e1281e523 100644 --- a/en/_modules/agentscope/models/response.html +++ b/en/_modules/agentscope/models/response.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -106,7 +108,7 @@

Source code for agentscope.models.response

 
 
 
-[docs] +[docs] class ModelResponse: """Encapsulation of data returned by the model. @@ -120,6 +122,8 @@

Source code for agentscope.models.response

     image_urls: Optional[Sequence[str]] = None
     json: Optional[Any] = None
 
+
+[docs] def __init__( self, text: str = None, @@ -142,7 +146,8 @@

Source code for agentscope.models.response

         self.text = text
         self.embedding = embedding
         self.image_urls = image_urls
-        self.raw = raw
+        self.raw = raw
+ def __str__(self) -> str: if _is_json_serializable(self.raw): @@ -162,12 +167,12 @@

Source code for agentscope.models.response

 
 
 
-[docs] +[docs] class ResponseParser: """A class that contains several static methods to parse the response."""
-[docs] +[docs] @classmethod def to_dict(cls, response: ModelResponse) -> ModelResponse: """Parse the response text to a dict, and feed it into the `json` @@ -193,7 +198,7 @@

Source code for agentscope.models.response

 
 
 
-[docs] +[docs] @classmethod def to_list(cls, response: ModelResponse) -> ModelResponse: """Parse the response text to a list, and feed it into the `json` @@ -221,7 +226,7 @@

Source code for agentscope.models.response

 
 
 
-[docs] +[docs] class ResponseParsingError(Exception): """Exception raised when parsing the response fails.""" @@ -234,6 +239,8 @@

Source code for agentscope.models.response

     response: ModelResponse
     """The response that fails to be parsed."""
 
+
+[docs] def __init__( self, *args: Any, @@ -256,7 +263,8 @@

Source code for agentscope.models.response

 
         self.parse_func_code = inspect.getsource(parse_func)
         self.error_info = error_info
-        self.response = response
+        self.response = response
+ def __str__(self) -> str: return ( diff --git a/en/_modules/agentscope/msghub.html b/en/_modules/agentscope/msghub.html index 247e20fd1..9eb1627bc 100644 --- a/en/_modules/agentscope/msghub.html +++ b/en/_modules/agentscope/msghub.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -104,9 +106,13 @@

Source code for agentscope.msghub

 from agentscope.agents import AgentBase
 
 
+
+[docs] class MsgHubManager: """MsgHub manager class for sharing dialog among a group of agents.""" +
+[docs] def __init__( self, participants: Sequence[AgentBase], @@ -117,13 +123,14 @@

Source code for agentscope.msghub

         Args:
             participants (`Sequence[AgentBase]`):
                 The Sequence of participants in the msghub.
-            announcement (`Optional[Union[list[dict], dict]]`, defaults to
-            `None`):
+            announcement
+                (`Optional[Union[list[dict], dict]]`, defaults to `None`):
                 The message that will be broadcast to all participants at
                 the first without requiring response.
         """
         self.participants = participants
-        self.announcement = announcement
+        self.announcement = announcement
+ def __enter__(self) -> MsgHubManager: """Will be called when entering the msghub.""" @@ -154,6 +161,8 @@

Source code for agentscope.msghub

         for agent in self.participants:
             agent.reset_audience(self.participants)
 
+
+[docs] def add( self, new_participant: Union[Sequence[AgentBase], AgentBase], @@ -171,8 +180,11 @@

Source code for agentscope.msghub

                     "already joined in.",
                 )
 
-        self._reset_audience()
+        self._reset_audience()
+ +
+[docs] def delete( self, participant: Union[Sequence[AgentBase], AgentBase], @@ -195,8 +207,11 @@

Source code for agentscope.msghub

                 )
 
         # Remove this agent from the audience of other agents
-        self._reset_audience()
+        self._reset_audience()
+ +
+[docs] def broadcast(self, msg: Union[dict, list[dict]]) -> None: """Broadcast the message to all participants. @@ -206,11 +221,13 @@

Source code for agentscope.msghub

                 participants.
         """
         for agent in self.participants:
-            agent.observe(msg)
+            agent.observe(msg)
+
+
-[docs] +[docs] def msghub( participants: Sequence[AgentBase], announcement: Optional[Union[Sequence[dict], dict]] = None, diff --git a/en/_modules/agentscope/pipelines/functional.html b/en/_modules/agentscope/pipelines/functional.html index 0a02f996e..d57b9204c 100644 --- a/en/_modules/agentscope/pipelines/functional.html +++ b/en/_modules/agentscope/pipelines/functional.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -109,17 +111,20 @@

Source code for agentscope.pipelines.functional

< Operators = Union[Operator, Sequence[Operator]] +
+[docs] def placeholder(x: dict = None) -> dict: r"""A placeholder that do nothing. Acts as a placeholder in branches that do not require any operations in flow control like if-else/switch """ - return x + return x
+
-[docs] +[docs] def sequentialpipeline( operators: Sequence[Operator], x: Optional[dict] = None, @@ -155,7 +160,7 @@

Source code for agentscope.pipelines.functional

<
-[docs] +[docs] def ifelsepipeline( condition_func: Callable, if_body_operators: Operators, @@ -187,7 +192,7 @@

Source code for agentscope.pipelines.functional

<
-[docs] +[docs] def switchpipeline( condition_func: Callable[[Any], Any], case_operators: Mapping[Any, Operators], @@ -223,7 +228,7 @@

Source code for agentscope.pipelines.functional

<
-[docs] +[docs] def forlooppipeline( loop_body_operators: Operators, max_loop: int, @@ -258,7 +263,7 @@

Source code for agentscope.pipelines.functional

<
-[docs] +[docs] def whilelooppipeline( loop_body_operators: Operators, condition_func: Callable[[int, Any], bool] = lambda _, __: False, diff --git a/en/_modules/agentscope/pipelines/pipeline.html b/en/_modules/agentscope/pipelines/pipeline.html index 8fc47f7a5..04d873af3 100644 --- a/en/_modules/agentscope/pipelines/pipeline.html +++ b/en/_modules/agentscope/pipelines/pipeline.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -116,7 +118,7 @@

Source code for agentscope.pipelines.pipeline

-[docs] +[docs] class PipelineBase(Operator): r"""Base interface of all pipelines. @@ -124,8 +126,11 @@

Source code for agentscope.pipelines.pipeline

multiple operators and the interaction logic among them. """ +
+[docs] def __init__(self) -> None: - self.participants: List[Any] = [] + self.participants: List[Any] = []
+ @abstractmethod def __call__(self, x: Optional[dict] = None) -> dict: @@ -142,7 +147,7 @@

Source code for agentscope.pipelines.pipeline

-[docs] +[docs] class IfElsePipeline(PipelineBase): r"""A template pipeline for implementing control flow like if-else. @@ -155,6 +160,8 @@

Source code for agentscope.pipelines.pipeline

else_body_operators(x) """ +
+[docs] def __init__( self, condition_func: Callable[[dict], bool], @@ -176,7 +183,8 @@

Source code for agentscope.pipelines.pipeline

self.condition_func = condition_func self.if_body_operator = if_body_operators self.else_body_operator = else_body_operators - self.participants = [self.if_body_operator] + [self.else_body_operator] + self.participants = [self.if_body_operator] + [self.else_body_operator]
+ def __call__(self, x: Optional[dict] = None) -> dict: return ifelsepipeline( @@ -189,7 +197,7 @@

Source code for agentscope.pipelines.pipeline

-[docs] +[docs] class SwitchPipeline(PipelineBase): r"""A template pipeline for implementing control flow like switch-case. @@ -203,6 +211,8 @@

Source code for agentscope.pipelines.pipeline

default: return default_operators(x) """ +
+[docs] def __init__( self, condition_func: Callable[[dict], Any], @@ -228,7 +238,8 @@

Source code for agentscope.pipelines.pipeline

self.default_operators = default_operators self.participants = list(self.case_operators.values()) + [ self.default_operators, - ] + ]
+ def __call__(self, x: Optional[dict] = None) -> dict: return switchpipeline( @@ -241,7 +252,7 @@

Source code for agentscope.pipelines.pipeline

-[docs] +[docs] class ForLoopPipeline(PipelineBase): r"""A template pipeline for implementing control flow like for-loop @@ -260,6 +271,8 @@

Source code for agentscope.pipelines.pipeline

break """ +
+[docs] def __init__( self, loop_body_operators: Operators, @@ -281,7 +294,8 @@

Source code for agentscope.pipelines.pipeline

self.loop_body_operators = loop_body_operators self.max_loop = max_loop self.break_func = break_func - self.participants = [self.loop_body_operators] + self.participants = [self.loop_body_operators]
+ def __call__(self, x: Optional[dict] = None) -> dict: return forlooppipeline( @@ -294,7 +308,7 @@

Source code for agentscope.pipelines.pipeline

-[docs] +[docs] class WhileLoopPipeline(PipelineBase): r"""A template pipeline for implementing control flow like while-loop @@ -307,6 +321,8 @@

Source code for agentscope.pipelines.pipeline

i += 1 """ +
+[docs] def __init__( self, loop_body_operators: Operators, @@ -325,7 +341,8 @@

Source code for agentscope.pipelines.pipeline

""" self.condition_func = condition_func self.loop_body_operators = loop_body_operators - self.participants = [self.loop_body_operators] + self.participants = [self.loop_body_operators]
+ def __call__(self, x: Optional[dict] = None) -> dict: return whilelooppipeline( @@ -337,7 +354,7 @@

Source code for agentscope.pipelines.pipeline

-[docs] +[docs] class SequentialPipeline(PipelineBase): r"""A template pipeline for implementing sequential logic. @@ -349,6 +366,8 @@

Source code for agentscope.pipelines.pipeline

x = operators[n](x) """ +
+[docs] def __init__(self, operators: Sequence[Operator]) -> None: r"""Initialize a Sequential pipeline. @@ -357,7 +376,8 @@

Source code for agentscope.pipelines.pipeline

A Sequence of operators to be executed sequentially. """ self.operators = operators - self.participants = list(self.operators) + self.participants = list(self.operators)
+ def __call__(self, x: Optional[dict] = None) -> dict: return sequentialpipeline(operators=self.operators, x=x)
diff --git a/en/_modules/agentscope/prompt.html b/en/_modules/agentscope/prompt.html new file mode 100644 index 000000000..2139ca599 --- /dev/null +++ b/en/_modules/agentscope/prompt.html @@ -0,0 +1,324 @@ + + + + + + + agentscope.prompt — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.prompt

+# -*- coding: utf-8 -*-
+"""Prompt engineering module."""
+from typing import Any, Optional, Union
+from enum import IntEnum
+
+from loguru import logger
+
+from agentscope.models import OpenAIWrapperBase, ModelWrapperBase
+from agentscope.constants import ShrinkPolicy
+from agentscope.utils.tools import to_openai_dict, to_dialog_str
+
+
+
+[docs] +class PromptType(IntEnum): + """Enum for prompt types.""" + + STRING = 0 + LIST = 1
+ + + +
+[docs] +class PromptEngine: + """Prompt engineering module for both list and string prompt""" + +
+[docs] + def __init__( + self, + model: ModelWrapperBase, + shrink_policy: ShrinkPolicy = ShrinkPolicy.TRUNCATE, + max_length: Optional[int] = None, + prompt_type: Optional[PromptType] = None, + max_summary_length: int = 200, + summarize_model: Optional[ModelWrapperBase] = None, + ) -> None: + """Init PromptEngine. + + Args: + model (`ModelWrapperBase`): + The target model for prompt engineering. + shrink_policy (`ShrinkPolicy`, defaults to + `ShrinkPolicy.TRUNCATE`): + The shrink policy for prompt engineering, defaults to + `ShrinkPolicy.TRUNCATE`. + max_length (`Optional[int]`, defaults to `None`): + The max length of context, if it is None, it will be set to the + max length of the model. + prompt_type (`Optional[MsgType]`, defaults to `None`): + The type of prompt, if it is None, it will be set according to + the model. + max_summary_length (`int`, defaults to `200`): + The max length of summary, if it is None, it will be set to the + max length of the model. + summarize_model (`Optional[ModelWrapperBase]`, defaults to `None`): + The model used for summarization, if it is None, it will be + set to `model`. + + Note: + + 1. TODO: Shrink function is still under development. + + 2. If the argument `max_length` and `prompt_type` are not given, + they will be set according to the given model. + + 3. `shrink_policy` is used when the prompt is too long, it can + be set to `ShrinkPolicy.TRUNCATE` or `ShrinkPolicy.SUMMARIZE`. + + a. `ShrinkPolicy.TRUNCATE` will truncate the prompt to the + desired length. + + b. `ShrinkPolicy.SUMMARIZE` will summarize partial of the + dialog history to save space. The summarization model + defaults to `model` if not given. + + Example: + + With prompt engine, we encapsulate different operations for + string- and list-style prompt, and block the prompt engineering + process from the user. + As a user, you can just combine you prompt as follows. + + .. code-block:: python + + # prepare the component + system_prompt = "You're a helpful assistant ..." + hint_prompt = "You should response in Json format." + prefix = "assistant: " + + # initialize the prompt engine and join the prompt + engine = PromptEngine(model) + prompt = engine.join(system_prompt, memory.get_memory(), + hint_prompt, prefix) + """ + self.model = model + self.shrink_policy = shrink_policy + self.max_length = max_length + + if prompt_type is None: + if isinstance(model, OpenAIWrapperBase): + self.prompt_type = PromptType.LIST + else: + self.prompt_type = PromptType.STRING + else: + self.prompt_type = prompt_type + + self.max_summary_length = max_summary_length + + if summarize_model is None: + self.summarize_model = model + + logger.warning( + "The prompt engine will be deprecated in the future. " + "Please use the `format` function in model wrapper object " + "instead. More details refer to ", + "https://modelscope.github.io/agentscope/en/tutorial/206-prompt" + ".html", + )
+ + +
+[docs] + def join( + self, + *args: Any, + format_map: Optional[dict] = None, + ) -> Union[str, list[dict]]: + """Join prompt components according to its type. The join function can + accept any number and type of arguments. If prompt type is + `PromptType.STRING`, the arguments will be joined by `"\\\\n"`. If + prompt type is `PromptType.LIST`, the string arguments will be + converted to `Msg` from `system`. + """ + # TODO: achieve the summarize function + + # Filter `None` + args = [_ for _ in args if _ is not None] + + if self.prompt_type == PromptType.STRING: + return self.join_to_str(*args, format_map=format_map) + elif self.prompt_type == PromptType.LIST: + return self.join_to_list(*args, format_map=format_map) + else: + raise RuntimeError("Invalid prompt type.")
+ + +
+[docs] + def join_to_str(self, *args: Any, format_map: Union[dict, None]) -> str: + """Join prompt components to a string.""" + prompt = [] + for item in args: + if isinstance(item, list): + items_str = self.join_to_str(*item, format_map=None) + prompt += [items_str] + elif isinstance(item, dict): + prompt.append(to_dialog_str(item)) + else: + prompt.append(str(item)) + prompt_str = "\n".join(prompt) + + if format_map is not None: + prompt_str = prompt_str.format_map(format_map) + + return prompt_str
+ + +
+[docs] + def join_to_list(self, *args: Any, format_map: Union[dict, None]) -> list: + """Join prompt components to a list of `Msg` objects.""" + prompt = [] + for item in args: + if isinstance(item, list): + # nested processing + prompt.extend(self.join_to_list(*item, format_map=None)) + elif isinstance(item, dict): + prompt.append(to_openai_dict(item)) + else: + prompt.append(to_openai_dict({"content": str(item)})) + + if format_map is not None: + format_prompt = [] + for msg in prompt: + format_prompt.append( + { + k.format_map(format_map): v.format_map(format_map) + for k, v in msg.items() + }, + ) + prompt = format_prompt + + return prompt
+
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/rpc/rpc_agent_client.html b/en/_modules/agentscope/rpc/rpc_agent_client.html index 926653ba0..85a4d334c 100644 --- a/en/_modules/agentscope/rpc/rpc_agent_client.html +++ b/en/_modules/agentscope/rpc/rpc_agent_client.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -115,10 +117,12 @@

Source code for agentscope.rpc.rpc_agent_client

<
-[docs] +[docs] class RpcAgentClient: """A client of Rpc agent server""" +
+[docs] def __init__(self, host: str, port: int, agent_id: str = "") -> None: """Init a rpc agent client @@ -131,10 +135,11 @@

Source code for agentscope.rpc.rpc_agent_client

< """ self.host = host self.port = port - self.agent_id = agent_id + self.agent_id = agent_id
+
-[docs] +[docs] def call_func( self, func_name: str, @@ -164,7 +169,7 @@

Source code for agentscope.rpc.rpc_agent_client

<
-[docs] +[docs] def create_agent(self, agent_configs: Optional[dict]) -> None: """Create a new agent for this client.""" try: @@ -185,7 +190,7 @@

Source code for agentscope.rpc.rpc_agent_client

<
-[docs] +[docs] def delete_agent(self) -> None: """ Delete the agent created by this client. @@ -202,16 +207,19 @@

Source code for agentscope.rpc.rpc_agent_client

<
-[docs] +[docs] class ResponseStub: """A stub used to save the response of an rpc call in a sub-thread.""" +
+[docs] def __init__(self) -> None: self.response = None - self.condition = threading.Condition() + self.condition = threading.Condition()
+
-[docs] +[docs] def set_response(self, response: str) -> None: """Set the message.""" with self.condition: @@ -220,7 +228,7 @@

Source code for agentscope.rpc.rpc_agent_client

<
-[docs] +[docs] def get_response(self) -> str: """Get the message.""" with self.condition: @@ -232,7 +240,7 @@

Source code for agentscope.rpc.rpc_agent_client

<
-[docs] +[docs] def call_in_thread( client: RpcAgentClient, x: dict, diff --git a/en/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html b/en/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html index b053921b2..69dc77ab3 100644 --- a/en/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html +++ b/en/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -105,10 +107,12 @@

Source code for agentscope.rpc.rpc_agent_pb2_grpc

-[docs] +[docs] class RpcAgentStub(object): """Servicer for rpc agent server""" +
+[docs] def __init__(self, channel): """Constructor. @@ -120,16 +124,17 @@

Source code for agentscope.rpc.rpc_agent_pb2_grpc

request_serializer=rpc__agent__pb2.RpcMsg.SerializeToString, response_deserializer=rpc__agent__pb2.RpcMsg.FromString, )
+
-[docs] +[docs] class RpcAgentServicer(object): """Servicer for rpc agent server"""
-[docs] +[docs] def call_func(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -140,7 +145,7 @@

Source code for agentscope.rpc.rpc_agent_pb2_grpc

-[docs] +[docs] def add_RpcAgentServicer_to_server(servicer, server): rpc_method_handlers = { "call_func": grpc.unary_unary_rpc_method_handler( @@ -158,9 +163,13 @@

Source code for agentscope.rpc.rpc_agent_pb2_grpc

# This class is part of an EXPERIMENTAL API. +
+[docs] class RpcAgent(object): """Servicer for rpc agent server""" +
+[docs] @staticmethod def call_func( request, @@ -188,7 +197,9 @@

Source code for agentscope.rpc.rpc_agent_pb2_grpc

wait_for_ready, timeout, metadata, - ) + )
+
+
diff --git a/en/_modules/agentscope/service.html b/en/_modules/agentscope/service.html index a3a5b7347..c56845aba 100644 --- a/en/_modules/agentscope/service.html +++ b/en/_modules/agentscope/service.html @@ -57,15 +57,17 @@

AgentScope API Reference

diff --git a/en/_modules/agentscope/service/execute_code/exec_python.html b/en/_modules/agentscope/service/execute_code/exec_python.html index aa26ec25c..38fa5b8cf 100644 --- a/en/_modules/agentscope/service/execute_code/exec_python.html +++ b/en/_modules/agentscope/service/execute_code/exec_python.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -133,7 +135,7 @@

Source code for agentscope.service.execute_code.exec_python

-[docs] +[docs] def execute_python_code( code: str, timeout: Optional[Union[int, float]] = 300, @@ -458,6 +460,8 @@

Source code for agentscope.service.execute_code.exec_python

) +
+[docs] def sys_python_guard(maximum_memory_bytes: Optional[int] = None) -> None: """ This disables various destructive functions and prevents the generated code @@ -543,7 +547,8 @@

Source code for agentscope.service.execute_code.exec_python

"tkinter", ] for module_name in sys_modules_to_disable: - sys.modules[module_name] = None + sys.modules[module_name] = None
+
diff --git a/en/_modules/agentscope/service/execute_code/exec_shell.html b/en/_modules/agentscope/service/execute_code/exec_shell.html index 7155e361b..42b73878f 100644 --- a/en/_modules/agentscope/service/execute_code/exec_shell.html +++ b/en/_modules/agentscope/service/execute_code/exec_shell.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -102,7 +104,7 @@

Source code for agentscope.service.execute_code.exec_shell

-[docs] +[docs] def execute_shell_command(command: str) -> ServiceResponse: """ Executes a given shell command. diff --git a/en/_modules/agentscope/service/file/common.html b/en/_modules/agentscope/service/file/common.html index 0d31df47a..212d15596 100644 --- a/en/_modules/agentscope/service/file/common.html +++ b/en/_modules/agentscope/service/file/common.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -106,7 +108,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def create_file(file_path: str, content: str = "") -> ServiceResponse: """ Create a file and write content to it. @@ -132,7 +134,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def delete_file(file_path: str) -> ServiceResponse: """Delete a file specified by the file path. @@ -161,7 +163,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def move_file(source_path: str, destination_path: str) -> ServiceResponse: """ Move a file from a source path to a destination path. @@ -203,7 +205,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def create_directory(directory_path: str) -> ServiceResponse: """ Create a directory at the specified path. @@ -238,7 +240,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def delete_directory(directory_path: str) -> ServiceResponse: """ Delete a directory and all of its contents. @@ -273,7 +275,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def move_directory( source_path: str, destination_path: str, @@ -319,7 +321,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def list_directory_content(directory_path: str) -> ServiceResponse: """ List the contents of a directory. i.e. ls -a @@ -358,7 +360,7 @@

Source code for agentscope.service.file.common

-[docs] +[docs] def get_current_directory() -> ServiceResponse: """ Get the current working directory path. diff --git a/en/_modules/agentscope/service/file/json.html b/en/_modules/agentscope/service/file/json.html index 58b6997c3..d2b782c38 100644 --- a/en/_modules/agentscope/service/file/json.html +++ b/en/_modules/agentscope/service/file/json.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -105,7 +107,7 @@

Source code for agentscope.service.file.json

-[docs]
+[docs]
 def read_json_file(file_path: str) -> ServiceResponse:
     """
     Read and parse a JSON file.
@@ -135,7 +137,7 @@ 

Source code for agentscope.service.file.json

-[docs]
+[docs]
 def write_json_file(
     file_path: str,
     data: Any,
diff --git a/en/_modules/agentscope/service/file/text.html b/en/_modules/agentscope/service/file/text.html
index dda0176a8..9a6afe69c 100644
--- a/en/_modules/agentscope/service/file/text.html
+++ b/en/_modules/agentscope/service/file/text.html
@@ -57,15 +57,17 @@
 
 

AgentScope API Reference

@@ -104,7 +106,7 @@

Source code for agentscope.service.file.text

-[docs]
+[docs]
 def read_text_file(file_path: str) -> ServiceResponse:
     """
     Read the content of the text file.
@@ -134,7 +136,7 @@ 

Source code for agentscope.service.file.text

-[docs]
+[docs]
 def write_text_file(
     file_path: str,
     content: str,
diff --git a/en/_modules/agentscope/service/retrieval/retrieval_from_list.html b/en/_modules/agentscope/service/retrieval/retrieval_from_list.html
index ec96bbfbc..4be750dd9 100644
--- a/en/_modules/agentscope/service/retrieval/retrieval_from_list.html
+++ b/en/_modules/agentscope/service/retrieval/retrieval_from_list.html
@@ -57,15 +57,17 @@
 
 

AgentScope API Reference

@@ -105,7 +107,7 @@

Source code for agentscope.service.retrieval.retrieval_from_list

-[docs] +[docs] def retrieve_from_list( query: Any, knowledge: Sequence, # TODO: rename diff --git a/en/_modules/agentscope/service/retrieval/similarity.html b/en/_modules/agentscope/service/retrieval/similarity.html index 30cb880ae..4d5549aa2 100644 --- a/en/_modules/agentscope/service/retrieval/similarity.html +++ b/en/_modules/agentscope/service/retrieval/similarity.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -109,7 +111,7 @@

Source code for agentscope.service.retrieval.similarity

-[docs] +[docs] def cos_sim( a: Embedding, b: Embedding, diff --git a/en/_modules/agentscope/service/service_factory.html b/en/_modules/agentscope/service/service_factory.html index c4bcf7e91..3c541c0e0 100644 --- a/en/_modules/agentscope/service/service_factory.html +++ b/en/_modules/agentscope/service/service_factory.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -147,13 +149,13 @@

Source code for agentscope.service.service_factory

-[docs] +[docs] class ServiceFactory: """A service factory class that turns service function into string prompt format."""
-[docs] +[docs] @classmethod def get( cls, diff --git a/en/_modules/agentscope/service/service_response.html b/en/_modules/agentscope/service/service_response.html index 8a4958fb1..0d7482897 100644 --- a/en/_modules/agentscope/service/service_response.html +++ b/en/_modules/agentscope/service/service_response.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -102,13 +104,15 @@

Source code for agentscope.service.service_response

-[docs] +[docs] class ServiceResponse(dict): """Used to wrap the execution results of the services""" __setattr__ = dict.__setitem__ __getattr__ = dict.__getitem__ +
+[docs] def __init__( self, status: ServiceExecStatus, @@ -127,6 +131,7 @@

Source code for agentscope.service.service_response

""" self.status = status self.content = content
+
diff --git a/en/_modules/agentscope/service/service_status.html b/en/_modules/agentscope/service/service_status.html index ffcb2eb6f..a33f434a6 100644 --- a/en/_modules/agentscope/service/service_status.html +++ b/en/_modules/agentscope/service/service_status.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -100,7 +102,7 @@

Source code for agentscope.service.service_status

-[docs] +[docs] class ServiceExecStatus(IntEnum): """Enum for service execution status.""" diff --git a/en/_modules/agentscope/service/sql_query/mongodb.html b/en/_modules/agentscope/service/sql_query/mongodb.html index 5ed6dddb2..9bc8e3a32 100644 --- a/en/_modules/agentscope/service/sql_query/mongodb.html +++ b/en/_modules/agentscope/service/sql_query/mongodb.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -108,7 +110,7 @@

Source code for agentscope.service.sql_query.mongodb

-[docs] +[docs] def query_mongodb( database: str, collection: str, diff --git a/en/_modules/agentscope/service/sql_query/mysql.html b/en/_modules/agentscope/service/sql_query/mysql.html index c106e6929..6118df6ac 100644 --- a/en/_modules/agentscope/service/sql_query/mysql.html +++ b/en/_modules/agentscope/service/sql_query/mysql.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -110,7 +112,7 @@

Source code for agentscope.service.sql_query.mysql

-[docs] +[docs] def query_mysql( database: str, query: str, diff --git a/en/_modules/agentscope/service/sql_query/sqlite.html b/en/_modules/agentscope/service/sql_query/sqlite.html index 0f471ddbe..96c7e8044 100644 --- a/en/_modules/agentscope/service/sql_query/sqlite.html +++ b/en/_modules/agentscope/service/sql_query/sqlite.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -110,7 +112,7 @@

Source code for agentscope.service.sql_query.sqlite

-[docs] +[docs] def query_sqlite( database: str, query: str, diff --git a/en/_modules/agentscope/service/text_processing/summarization.html b/en/_modules/agentscope/service/text_processing/summarization.html index 91e972849..b712f96a0 100644 --- a/en/_modules/agentscope/service/text_processing/summarization.html +++ b/en/_modules/agentscope/service/text_processing/summarization.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -109,7 +111,7 @@

Source code for agentscope.service.text_processing.summarization

-[docs] +[docs] def summarization( model: ModelWrapperBase, text: str, diff --git a/en/_modules/agentscope/service/web/arxiv.html b/en/_modules/agentscope/service/web/arxiv.html index 4f5f73c15..5984d67fa 100644 --- a/en/_modules/agentscope/service/web/arxiv.html +++ b/en/_modules/agentscope/service/web/arxiv.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -309,7 +311,7 @@

Source code for agentscope.service.web.arxiv

@@ -105,7 +107,7 @@

Source code for agentscope.service.web.download

<
-[docs] +[docs] def download_from_url( url: str, filepath: str, diff --git a/en/_modules/agentscope/service/web/search.html b/en/_modules/agentscope/service/web/search.html index 136a6d570..008ae15a1 100644 --- a/en/_modules/agentscope/service/web/search.html +++ b/en/_modules/agentscope/service/web/search.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -104,7 +106,7 @@

Source code for agentscope.service.web.search

-[docs] +[docs] def bing_search( question: str, api_key: str, @@ -214,7 +216,7 @@

Source code for agentscope.service.web.search

-[docs] +[docs] def google_search( question: str, api_key: str, diff --git a/en/_modules/agentscope/service/web/web_digest.html b/en/_modules/agentscope/service/web/web_digest.html index 2f1eddb14..5f510bfee 100644 --- a/en/_modules/agentscope/service/web/web_digest.html +++ b/en/_modules/agentscope/service/web/web_digest.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -115,6 +117,8 @@

Source code for agentscope.service.web.web_digest

) +
+[docs] def is_valid_url(url: str) -> bool: """ Use urlparse to check if a URL is valid @@ -130,11 +134,12 @@

Source code for agentscope.service.web.web_digest

# (e.g., "http" or "https") and a netloc (domain). return all([result.scheme, result.netloc]) except ValueError: - return False # A ValueError indicates that the URL is not valid. + return False # A ValueError indicates that the URL is not valid.
+
-[docs] +[docs] def load_web( url: str, keep_raw: bool = True, @@ -250,7 +255,7 @@

Source code for agentscope.service.web.web_digest

-[docs] +[docs] def parse_html_to_text( html_text: str, html_selected_tags: Optional[Sequence[str]] = None, @@ -314,7 +319,7 @@

Source code for agentscope.service.web.web_digest

-[docs] +[docs] def digest_webpage( web_text_or_url: str, model: ModelWrapperBase = None, diff --git a/en/_modules/agentscope/utils/common.html b/en/_modules/agentscope/utils/common.html new file mode 100644 index 000000000..d81dab63b --- /dev/null +++ b/en/_modules/agentscope/utils/common.html @@ -0,0 +1,327 @@ + + + + + + + agentscope.utils.common — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.utils.common

+# -*- coding: utf-8 -*-
+""" Common utils."""
+
+import contextlib
+import os
+import re
+import signal
+import sys
+import tempfile
+import threading
+from typing import Any, Generator, Optional, Union
+from loguru import logger
+import requests
+
+from agentscope.service.service_response import ServiceResponse
+from agentscope.service.service_status import ServiceExecStatus
+
+
+
+[docs] +@contextlib.contextmanager +def timer(seconds: Optional[Union[int, float]] = None) -> Generator: + """ + A context manager that limits the execution time of a code block to a + given number of seconds. + The implementation of this contextmanager are borrowed from + https://github.com/openai/human-eval/blob/master/human_eval/execution.py + + Note: + This function only works in Unix and MainThread, + since `signal.setitimer` is only available in Unix. + + """ + if ( + seconds is None + or sys.platform == "win32" + or threading.currentThread().name # pylint: disable=W4902 + != "MainThread" + ): + yield + return + + def signal_handler(*args: Any, **kwargs: Any) -> None: + raise TimeoutError("timed out") + + signal.setitimer(signal.ITIMER_REAL, seconds) + signal.signal(signal.SIGALRM, signal_handler) + + try: + # Enter the context and execute the code block. + yield + finally: + signal.setitimer(signal.ITIMER_REAL, 0)
+ + + +
+[docs] +@contextlib.contextmanager +def create_tempdir() -> Generator: + """ + A context manager that creates a temporary directory and changes the + current working directory to it. + The implementation of this contextmanager are borrowed from + https://github.com/openai/human-eval/blob/master/human_eval/execution.py + """ + with tempfile.TemporaryDirectory() as dirname: + with chdir(dirname): + yield dirname
+ + + +
+[docs] +@contextlib.contextmanager +def chdir(path: str) -> Generator: + """ + A context manager that changes the current working directory to the + given path. + The implementation of this contextmanager are borrowed from + https://github.com/openai/human-eval/blob/master/human_eval/execution.py + """ + if path == ".": + yield + return + cwd = os.getcwd() + os.chdir(path) + try: + yield + except BaseException as exc: + raise exc + finally: + os.chdir(cwd)
+ + + +
+[docs] +def write_file(content: str, file_path: str) -> ServiceResponse: + """ + Write content to a file. + + Args: + content (str): The content to be written to the file. + file_path (str): The path to the file where the content will be + written. + + Returns: + ServiceResponse: where the boolean indicates the success of the + operation, and the str contains an empty string if successful or an + error message if any, including the error type. + + This function attempts to open the file in write mode and write the + provided content to it. If the file does not exist, it will be created. + If the file exists, its content will be overwritten. If a + PermissionError occurs, indicating a lack of necessary permissions, + or an IOError occurs, signaling additional issues such as an invalid + file path or hardware-related I/O error, the function will catch the + exception and return `False` along with the error message. + """ + try: + with open(file_path, "w", encoding="utf-8") as file: + file.write(content) + return ServiceResponse( + status=ServiceExecStatus.SUCCESS, + content="Success", + ) + except Exception as e: + error_message = f"{e.__class__.__name__}: {e}" + return ServiceResponse( + status=ServiceExecStatus.ERROR, + content=error_message, + )
+ + + +
+[docs] +def requests_get( + url: str, + params: dict, + headers: Optional[dict] = None, +) -> Union[dict, str]: + """ + Sends a GET request to the specified URL with the provided query parameters + and headers. Returns the JSON response as a dictionary. + + This function handles the request, checks for errors, logs exceptions, + and parses the JSON response. + + Args: + url (str): The URL to which the GET request is sent. + params (Dict): A dictionary containing query parameters to be included + in the request. + headers (Optional[Dict]): An optional dictionary of HTTP headers to + send with the request. + + Returns: + Dict or str: + If the request is successful, returns a dictionary containing the + parsed JSON data. + If the request fails, returns the error string. + """ + # Make the request + try: + # Check if headers are provided, and include them if they are not None + if headers: + response = requests.get(url, params=params, headers=headers) + else: + response = requests.get(url, params=params) + # This will raise an exception for HTTP error codes + response.raise_for_status() + except requests.RequestException as e: + logger.error(e) + return str(e) + # Parse the JSON response + search_results = response.json() + return search_results
+ + + +
+[docs] +def if_change_database(sql_query: str) -> bool: + """Check whether SQL query only contains SELECT query""" + # Compile the regex pattern outside the function for better performance + pattern_unsafe_sql = re.compile( + r"\b(INSERT|UPDATE|DELETE|REPLACE|CREATE|ALTER|DROP|TRUNCATE|USE)\b", + re.IGNORECASE, + ) + + # Remove SQL comments + sql_query = re.sub(r"--.*?$", "", sql_query, flags=re.MULTILINE) + # Remove /* */ comments + sql_query = re.sub(r"/\*.*?\*/", "", sql_query, flags=re.DOTALL) + # Matching non-SELECT statements with regular expressions + if pattern_unsafe_sql.search(sql_query): + return False + return True
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/utils/logging_utils.html b/en/_modules/agentscope/utils/logging_utils.html index d7061c7d2..3e25e8097 100644 --- a/en/_modules/agentscope/utils/logging_utils.html +++ b/en/_modules/agentscope/utils/logging_utils.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -219,6 +221,8 @@

Source code for agentscope.utils.logging_utils

logger.log(LEVEL_CHAT_LOG, message, *args, **kwargs) +

+[docs] def log_studio(message: dict, uid: str, **kwargs: Any) -> None: """Send chat message to studio. @@ -272,7 +276,8 @@

Source code for agentscope.utils.logging_utils

uid=uid, flushing=flushing, avatar=avatar, - ) + )

+ def _level_format(record: dict) -> str: @@ -289,7 +294,7 @@

Source code for agentscope.utils.logging_utils

-[docs] +[docs] def setup_logger( path_log: Optional[str] = None, level: LOG_LEVEL = "INFO", diff --git a/en/_modules/agentscope/utils/monitor.html b/en/_modules/agentscope/utils/monitor.html index d509852d3..63e816a9c 100644 --- a/en/_modules/agentscope/utils/monitor.html +++ b/en/_modules/agentscope/utils/monitor.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -111,12 +113,12 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] class MonitorBase(ABC): r"""Base interface of Monitor"""
-[docs] +[docs] @abstractmethod def register( self, @@ -141,7 +143,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def exists(self, metric_name: str) -> bool: """Determine whether a metric exists in the monitor. @@ -156,7 +158,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def add(self, metric_name: str, value: float) -> bool: """Add value to a specific metric. @@ -173,7 +175,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] def update(self, values: dict, prefix: Optional[str] = None) -> None: """Update multiple metrics at once.""" for k, v in values: @@ -181,7 +183,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def clear(self, metric_name: str) -> bool: """Clear the values of a specific metric. @@ -196,7 +198,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def remove(self, metric_name: str) -> bool: """Remove a specific metric from the monitor. @@ -211,7 +213,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def get_value(self, metric_name: str) -> Optional[float]: """Get the value of a specific metric. @@ -226,7 +228,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def get_unit(self, metric_name: str) -> Optional[str]: """Get the unit of a specific metric. @@ -241,7 +243,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def get_quota(self, metric_name: str) -> Optional[float]: """Get the quota of a specific metric. @@ -256,7 +258,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def set_quota(self, metric_name: str, quota: float) -> bool: """Set the quota of a specific metric @@ -273,7 +275,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def get_metric(self, metric_name: str) -> Optional[dict]: """Get the specific metric @@ -294,7 +296,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def get_metrics(self, filter_regex: Optional[str] = None) -> dict: """Get a dictionary of metrics. @@ -322,7 +324,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @abstractmethod def register_budget( self, @@ -347,6 +349,8 @@

Source code for agentscope.utils.monitor

 
 
 
+
+[docs] def get_full_name(name: str, prefix: Optional[str] = None) -> str: """Get the full name of a metric. @@ -360,14 +364,17 @@

Source code for agentscope.utils.monitor

     if prefix is None:
         return name
     else:
-        return f"{prefix}.{name}"
+        return f"{prefix}.{name}"
+
-[docs] +[docs] class QuotaExceededError(Exception): """An Exception used to indicate that a certain metric exceeds quota""" +
+[docs] def __init__( self, name: str, @@ -380,9 +387,12 @@

Source code for agentscope.utils.monitor

         self.message = f"Metric [{name}] exceeds quota."
         self.name = name
         super().__init__(self.message)
+
+
+[docs] @contextmanager def sqlite_transaction(db_path: str, timeout: float = 30.0) -> Generator: """Get a sqlite transaction cursor. @@ -405,9 +415,12 @@

Source code for agentscope.utils.monitor

         raise e
     finally:
         cursor.close()
-        conn.close()
+        conn.close()
+ +
+[docs] @contextmanager def sqlite_cursor(db_path: str, timeout: float = 30.0) -> Generator: """Get a sqlite cursor. @@ -425,12 +438,17 @@

Source code for agentscope.utils.monitor

         yield cursor
     finally:
         cursor.close()
-        conn.close()
+        conn.close()
+ +
+[docs] class SqliteMonitor(MonitorBase): """A monitor based on sqlite""" +
+[docs] def __init__( self, db_path: str, @@ -452,7 +470,8 @@

Source code for agentscope.utils.monitor

         self._create_monitor_table(drop_exists)
         logger.info(
             f"SqliteMonitor initialization completed at [{self.db_path}]",
-        )
+        )
+ def _create_monitor_table(self, drop_exists: bool = False) -> None: """Internal method to create a table in sqlite3.""" @@ -485,6 +504,8 @@

Source code for agentscope.utils.monitor

             f"Init [{self.table_name}_quota_exceeded] as the monitor trigger",
         )
 
+
+[docs] def register( self, metric_name: str, @@ -505,7 +526,8 @@

Source code for agentscope.utils.monitor

                 f"Register metric [{metric_name}] to SqliteMonitor with unit "
                 f"[{metric_unit}] and quota [{quota}]",
             )
-            return True
+            return True
+ def _add( self, @@ -525,13 +547,18 @@

Source code for agentscope.utils.monitor

         except sqlite3.IntegrityError as e:
             raise QuotaExceededError(metric_name) from e
 
+
+[docs] def add(self, metric_name: str, value: float) -> bool: with sqlite_transaction(self.db_path) as cursor: if not self._exists(cursor, metric_name): return False self._add(cursor, metric_name, value) - return True + return True
+ +
+[docs] def clear(self, metric_name: str) -> bool: with sqlite_transaction(self.db_path) as cursor: if not self._exists(cursor, metric_name): @@ -544,8 +571,11 @@

Source code for agentscope.utils.monitor

             """,
                 (0.0, metric_name),
             )
-            return True
+            return True
+ +
+[docs] def remove(self, metric_name: str) -> bool: with sqlite_transaction(self.db_path) as cursor: if not self._exists(cursor, metric_name): @@ -556,7 +586,8 @@

Source code for agentscope.utils.monitor

                 WHERE name = ?""",
                 (metric_name,),
             )
-        return True
+        return True
+ def _get_metric(self, cursor: sqlite3.Cursor, metric_name: str) -> dict: cursor.execute( @@ -576,20 +607,28 @@

Source code for agentscope.utils.monitor

         else:
             raise RuntimeError(f"Fail to get metric {metric_name}")
 
+
+[docs] def get_value(self, metric_name: str) -> Optional[float]: with sqlite_cursor(self.db_path) as cursor: if not self._exists(cursor, metric_name): return None metric = self._get_metric(cursor, metric_name) - return metric["value"] + return metric["value"]
+ +
+[docs] def get_quota(self, metric_name: str) -> Optional[float]: with sqlite_cursor(self.db_path) as cursor: if not self._exists(cursor, metric_name): return None metric = self._get_metric(cursor, metric_name) - return metric["quota"] + return metric["quota"]
+ +
+[docs] def set_quota(self, metric_name: str, quota: float) -> bool: with sqlite_transaction(self.db_path) as cursor: if not self._exists(cursor, metric_name): @@ -602,21 +641,30 @@

Source code for agentscope.utils.monitor

             """,
                 (quota, metric_name),
             )
-            return True
+            return True
+ +
+[docs] def get_unit(self, metric_name: str) -> Optional[str]: with sqlite_cursor(self.db_path) as cursor: if not self._exists(cursor, metric_name): return None metric = self._get_metric(cursor, metric_name) - return metric["unit"] + return metric["unit"]
+ +
+[docs] def get_metric(self, metric_name: str) -> Optional[dict]: with sqlite_cursor(self.db_path) as cursor: if not self._exists(cursor, metric_name): return None - return self._get_metric(cursor, metric_name) + return self._get_metric(cursor, metric_name)
+ +
+[docs] def get_metrics(self, filter_regex: Optional[str] = None) -> dict: with sqlite_cursor(self.db_path) as cursor: cursor.execute(f"SELECT * FROM {self.table_name}") @@ -637,7 +685,8 @@

Source code for agentscope.utils.monitor

                 key: value
                 for key, value in metrics.items()
                 if pattern.search(key)
-            }
+            }
+ def _exists(self, cursor: sqlite3.Cursor, name: str) -> bool: cursor.execute( @@ -649,10 +698,15 @@

Source code for agentscope.utils.monitor

         )
         return cursor.fetchone() is not None
 
+
+[docs] def exists(self, metric_name: str) -> bool: with sqlite_cursor(self.db_path) as cursor: - return self._exists(cursor, metric_name) + return self._exists(cursor, metric_name)
+ +
+[docs] def update(self, values: dict, prefix: Optional[str] = None) -> None: with sqlite_transaction(self.db_path) as cursor: for metric_name, value in values.items(): @@ -663,7 +717,8 @@

Source code for agentscope.utils.monitor

                         prefix=prefix,
                     ),
                     value,
-                )
+                )
+ def _create_update_cost_trigger( self, @@ -687,6 +742,8 @@

Source code for agentscope.utils.monitor

                 """,
             )
 
+
+[docs] def register_budget( self, model_name: str, @@ -726,7 +783,9 @@

Source code for agentscope.utils.monitor

             logger.warning(
                 f"Calculate budgets for model [{model_name}] is not supported",
             )
-            return False
+            return False
+
+ def _get_pricing() -> dict: @@ -757,7 +816,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] class MonitorFactory: """Factory of Monitor. @@ -770,7 +829,7 @@

Source code for agentscope.utils.monitor

     _instance = None
 
 
-[docs] +[docs] @classmethod def get_monitor( cls, @@ -798,7 +857,7 @@

Source code for agentscope.utils.monitor

 
 
 
-[docs] +[docs] @classmethod def flush(cls) -> None: """ diff --git a/en/_modules/agentscope/utils/token_utils.html b/en/_modules/agentscope/utils/token_utils.html new file mode 100644 index 000000000..e0f0e1fef --- /dev/null +++ b/en/_modules/agentscope/utils/token_utils.html @@ -0,0 +1,291 @@ + + + + + + + agentscope.utils.token_utils — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.utils.token_utils

+# -*- coding: utf-8 -*-
+"""Token utils."""
+from typing import Union
+from loguru import logger
+
+try:
+    import tiktoken
+except ImportError:
+    tiktoken = None
+
+# TODO: obtain from web API and store it in `~/.cache`
+OPENAI_MAX_LENGTH = {
+    "update": 20231212,
+    # gpt-4
+    "gpt-4-1106-preview": 128000,
+    "gpt-4-vision-preview": 128000,
+    "gpt-4": 8192,
+    "gpt-4-32k": 32768,
+    "gpt-4-0613": 8192,
+    "gpt-4-32k-0613": 32768,
+    "gpt-4-0314": 8192,  # legacy
+    "gpt-4-32k-0314": 32768,  # legacy
+    # gpt-3.5
+    "gpt-3.5-turbo-1106": 16385,
+    "gpt-3.5-turbo": 4096,
+    "gpt-3.5-turbo-16k": 16385,
+    "gpt-3.5-turbo-instruct": 4096,
+    "gpt-3.5-turbo-0613": 4096,  # legacy
+    "gpt-3.5-turbo-16k-0613": 16385,  # deprecated on June 13th 2024
+    "gpt-3.5-turbo-0301": 4096,  # deprecated on June 13th 2024
+    "text-davinci-003": 4096,  # deprecated on Jan 4th 2024
+    "text-davinci-002": 4096,  # deprecated on Jan 4th 2024
+    "code-davinci-002": 4096,  # deprecated on Jan 4th 2024
+    # gpt-3 legacy
+    "text-curie-001": 2049,
+    "text-babbage-001": 2049,
+    "text-ada-001": 2049,
+    "davinci": 2049,
+    "curie": 2049,
+    "babbage": 2049,
+    "ada": 2049,
+}
+
+
+
+[docs] +def get_openai_max_length(model_name: str) -> int: + """Get the max length of the OpenAi models.""" + try: + return OPENAI_MAX_LENGTH[model_name] + except KeyError as exc: + raise KeyError( + f"Model [{model_name}] not found in OPENAI_MAX_LENGTH. " + f"The last updated date is {OPENAI_MAX_LENGTH['update']}", + ) from exc
+ + + +
+[docs] +def count_openai_token(content: Union[str, list], model: str) -> int: + """Count token in format of OpenAI API""" + if isinstance(content, str): + content = [content] + try: + encoding = tiktoken.encoding_for_model(model) + except KeyError: + logger.warning( + "Warning: model not found. Using cl100k_base encoding.", + ) + encoding = tiktoken.get_encoding("cl100k_base") + + if model in [ + "text-davinci-003", # deprecated on Jan 4th 2024, + "text-davinci-002", # deprecated on Jan 4th 2024 + "code-davinci-002", # deprecated on Jan 4th 2024 + # gpt-3 legacy + "text-curie-001", + "text-babbage-001", + "text-ada-001", + "davinci", + "curie", + "babbage", + "ada", + ]: + num_tokens = 0 + for message in content: + if isinstance(message, dict): + raise NotImplementedError( + f"""count_openai_token() is not implemented for + model {model}. See + https://github.com/openai/openai-python for + information on how messages are converted to tokens.""", + ) + num_tokens += len(encoding.encode(message)) + return num_tokens + return num_tokens_from_content(content, model)
+ + + +
+[docs] +def num_tokens_from_content(content: list, model: str) -> int: + """Count token in format of OpenAI Chat API""" + # modified from https://github.com/openai/openai-cookbook/blob/main + # /examples/How_to_count_tokens_with_tiktoken.ipynb + try: + encoding = tiktoken.encoding_for_model(model) + except KeyError: + logger.warning( + "Warning: model not found. Using cl100k_base encoding.", + ) + encoding = tiktoken.get_encoding("cl100k_base") + + if model in { + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo-16k-0613", + "gpt-4-0314", + "gpt-4-32k-0314", + "gpt-4-0613", + "gpt-4-32k-0613", + }: + tokens_per_message = 3 + tokens_per_name = 1 + elif model == "gpt-3.5-turbo-0301": + # every message follows <|im_start|>{role/name}\n{ + # content}<|im_end|>\n + tokens_per_message = 4 + # if there's a name, the role is omitted + tokens_per_name = -1 + elif "gpt-3.5-turbo" in model: + logger.warning( + "Warning: gpt-3.5-turbo may update over time. " + "Returning num tokens assuming " + "gpt-3.5-turbo-0613.", + ) + return num_tokens_from_content(content, "gpt-3.5-turbo-0613") + elif "gpt-4" in model: + logger.warning( + "Warning: gpt-4 may update over time. Returning " + "num tokens assuming gpt-4-0613.", + ) + return num_tokens_from_content(content, "gpt-4-0613") + else: + raise NotImplementedError( + f"""num_tokens_from_content() is not implemented for model + {model}. See + https://github.com/openai/openai-python + for information on how messages are converted to tokens.""", + ) + num_tokens = 0 + for message in content: + if isinstance(message, str): + num_tokens += len(encoding.encode(message)) + else: + num_tokens += tokens_per_message + for key, value in message.items(): + num_tokens += len(encoding.encode(value)) + if key == "name": + num_tokens += tokens_per_name + # every reply is primed with <|start|>assistant<|message|> + num_tokens += 3 + return num_tokens
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/utils/tools.html b/en/_modules/agentscope/utils/tools.html new file mode 100644 index 000000000..74a57dd70 --- /dev/null +++ b/en/_modules/agentscope/utils/tools.html @@ -0,0 +1,379 @@ + + + + + + + agentscope.utils.tools — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.utils.tools

+# -*- coding: utf-8 -*-
+""" Tools for agentscope """
+import base64
+import datetime
+import json
+import secrets
+import string
+from typing import Any, Literal
+
+from urllib.parse import urlparse
+
+import requests
+from loguru import logger
+
+
+def _get_timestamp(
+    format_: str = "%Y-%m-%d %H:%M:%S",
+    time: datetime.datetime = None,
+) -> str:
+    """Get current timestamp."""
+    if time is None:
+        return datetime.datetime.now().strftime(format_)
+    else:
+        return time.strftime(format_)
+
+
+
+[docs] +def to_openai_dict(item: dict) -> dict: + """Convert `Msg` to `dict` for OpenAI API.""" + clean_dict = {} + + if "name" in item: + clean_dict["name"] = item["name"] + + if "role" in item: + clean_dict["role"] = item["role"] + else: + clean_dict["role"] = "assistant" + + if "content" in item: + clean_dict["content"] = _convert_to_str(item["content"]) + else: + logger.warning( + f"Message {item} doesn't have `content` field for " f"OpenAI API.", + ) + + return clean_dict
+ + + +
+[docs] +def to_dialog_str(item: dict) -> str: + """Convert a dict into string prompt style.""" + speaker = item.get("name", None) or item.get("role", None) + content = item.get("content", None) + + if content is None: + return str(item) + + if speaker is None: + return content + else: + return f"{speaker}: {content}"
+ + + +def _guess_type_by_extension( + url: str, +) -> Literal["image", "audio", "video", "file"]: + """Guess the type of the file by its extension.""" + extension = url.split(".")[-1].lower() + + if extension in [ + "bmp", + "dib", + "icns", + "ico", + "jfif", + "jpe", + "jpeg", + "jpg", + "j2c", + "j2k", + "jp2", + "jpc", + "jpf", + "jpx", + "apng", + "png", + "bw", + "rgb", + "rgba", + "sgi", + "tif", + "tiff", + "webp", + ]: + return "image" + elif extension in [ + "amr", + "wav", + "3gp", + "3gpp", + "aac", + "mp3", + "flac", + "ogg", + ]: + return "audio" + elif extension in [ + "mp4", + "webm", + "mkv", + "flv", + "avi", + "mov", + "wmv", + "rmvb", + ]: + return "video" + else: + return "file" + + +def _to_openai_image_url(url: str) -> str: + """Convert an image url to openai format. If the given url is a local + file, it will be converted to base64 format. Otherwise, it will be + returned directly. + + Args: + url (`str`): + The local or public url of the image. + """ + # See https://platform.openai.com/docs/guides/vision for details of + # support image extensions. + image_extensions = ( + ".png", + ".jpg", + ".jpeg", + ".gif", + ".webp", + ) + + parsed_url = urlparse(url) + + # Checking for HTTP(S) image links + if parsed_url.scheme in ["http", "https"]: + lower_path = parsed_url.path.lower() + if lower_path.endswith(image_extensions): + return url + + # Check if it is a local file + elif parsed_url.scheme == "file" or not parsed_url.scheme: + if parsed_url.path.lower().endswith(image_extensions): + with open(parsed_url.path, "rb") as image_file: + base64_image = base64.b64encode(image_file.read()).decode( + "utf-8", + ) + extension = parsed_url.path.lower().split(".")[-1] + mime_type = f"image/{extension}" + return f"data:{mime_type};base64,{base64_image}" + + raise TypeError(f"{url} should be end with {image_extensions}.") + + +def _download_file(url: str, path_file: str, max_retries: int = 3) -> bool: + """Download file from the given url and save it to the given path. + + Args: + url (`str`): + The url of the file. + path_file (`str`): + The path to save the file. + max_retries (`int`, defaults to `3`) + The maximum number of retries when fail to download the file. + """ + for n_retry in range(1, max_retries + 1): + response = requests.get(url, stream=True) + if response.status_code == requests.codes.ok: + with open(path_file, "wb") as file: + for chunk in response.iter_content(1024): + file.write(chunk) + return True + else: + logger.warning( + f"Failed to download file from {url} (status code: " + f"{response.status_code}). Retry {n_retry}/{max_retries}.", + ) + return False + + +def _generate_random_code( + length: int = 6, + uppercase: bool = True, + lowercase: bool = True, + digits: bool = True, +) -> str: + """Get random code.""" + characters = "" + if uppercase: + characters += string.ascii_uppercase + if lowercase: + characters += string.ascii_lowercase + if digits: + characters += string.digits + return "".join(secrets.choice(characters) for i in range(length)) + + +def _is_json_serializable(obj: Any) -> bool: + """Check if the given object is json serializable.""" + try: + json.dumps(obj) + return True + except TypeError: + return False + + +def _convert_to_str(content: Any) -> str: + """Convert the content to string. + + Note: + For prompt engineering, simply calling `str(content)` or + `json.dumps(content)` is not enough. + + - For `str(content)`, if `content` is a dictionary, it will turn double + quotes to single quotes. When this string is fed into prompt, the LLMs + may learn to use single quotes instead of double quotes (which + cannot be loaded by `json.loads` API). + + - For `json.dumps(content)`, if `content` is a string, it will add + double quotes to the string. LLMs may learn to use double quotes to + wrap strings, which leads to the same issue as `str(content)`. + + To avoid these issues, we use this function to safely convert the + content to a string used in prompt. + + Args: + content (`Any`): + The content to be converted. + + Returns: + `str`: The converted string. + """ + + if isinstance(content, str): + return content + elif isinstance(content, (dict, list, int, float, bool, tuple)): + return json.dumps(content, ensure_ascii=False) + else: + return str(content) +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/web/_app.html b/en/_modules/agentscope/web/_app.html index 5659593aa..7a1a445b6 100644 --- a/en/_modules/agentscope/web/_app.html +++ b/en/_modules/agentscope/web/_app.html @@ -57,15 +57,17 @@

AgentScope API Reference

diff --git a/en/_modules/agentscope/web/studio/studio.html b/en/_modules/agentscope/web/studio/studio.html new file mode 100644 index 000000000..bb52ad5af --- /dev/null +++ b/en/_modules/agentscope/web/studio/studio.html @@ -0,0 +1,493 @@ + + + + + + + agentscope.web.studio.studio — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.web.studio.studio

+# -*- coding: utf-8 -*-
+"""run web ui"""
+import argparse
+import os
+import sys
+import threading
+import time
+from collections import defaultdict
+from typing import Optional, Callable
+import traceback
+
+try:
+    import gradio as gr
+except ImportError:
+    gr = None
+
+try:
+    import modelscope_studio as mgr
+except ImportError:
+    mgr = None
+
+from agentscope.web.studio.utils import (
+    send_player_input,
+    get_chat_msg,
+    SYS_MSG_PREFIX,
+    ResetException,
+    check_uuid,
+    send_msg,
+    generate_image_from_name,
+    audio2text,
+    send_reset_msg,
+    thread_local_data,
+    cycle_dots,
+)
+from agentscope.web.studio.constants import _SPEAK
+
+MAX_NUM_DISPLAY_MSG = 20
+FAIL_COUNT_DOWN = 30
+
+
+
+[docs] +def init_uid_list() -> list: + """Initialize an empty list for storing user IDs.""" + return []
+ + + +glb_history_dict = defaultdict(init_uid_list) +glb_doing_signal_dict = defaultdict(init_uid_list) +glb_signed_user = [] + + +
+[docs] +def reset_glb_var(uid: str) -> None: + """Reset global variables for a given user ID.""" + global glb_history_dict + global glb_doing_signal_dict + glb_history_dict[uid] = init_uid_list() + glb_doing_signal_dict[uid] = init_uid_list()
+ + + +
+[docs] +def get_chat(uid: str) -> list[list]: + """Retrieve chat messages for a given user ID.""" + uid = check_uuid(uid) + global glb_history_dict + global glb_doing_signal_dict + + line = get_chat_msg(uid=uid) + # TODO: Optimize the display effect, currently there is a problem of + # output display jumping + if line: + if line[1] and line[1]["text"] == _SPEAK: + line[1]["text"] = "" + glb_doing_signal_dict[uid] = line + else: + glb_history_dict[uid] += [line] + glb_doing_signal_dict[uid] = [] + dial_msg = [] + for line in glb_history_dict[uid]: + _, msg = line + if isinstance(msg, dict): + dial_msg.append(line) + else: + # User chat, format: (msg, None) + dial_msg.append(line) + if glb_doing_signal_dict[uid]: + if glb_doing_signal_dict[uid][1]: + text = cycle_dots(glb_doing_signal_dict[uid][1]["text"]) + glb_doing_signal_dict[uid][1]["text"] = text + glb_doing_signal_dict[uid][1]["id"] = str(time.time()) + glb_doing_signal_dict[uid][1]["flushing"] = False + + dial_msg.append(glb_doing_signal_dict[uid]) + return dial_msg[-MAX_NUM_DISPLAY_MSG:]
+ + + +
+[docs] +def send_audio(audio_term: str, uid: str) -> None: + """Convert audio input to text and send as a chat message.""" + uid = check_uuid(uid) + content = audio2text(audio_path=audio_term) + send_player_input(content, uid=uid) + msg = f"""{content} + <audio src="{audio_term}"></audio>""" + send_msg(msg, is_player=True, role="Me", uid=uid, avatar=None)
+ + + +
+[docs] +def send_image(image_term: str, uid: str) -> None: + """Send an image as a chat message.""" + uid = check_uuid(uid) + send_player_input(image_term, uid=uid) + + msg = f"""<img src="{image_term}"></img>""" + avatar = generate_image_from_name("Me") + send_msg(msg, is_player=True, role="Me", uid=uid, avatar=avatar)
+ + + +
+[docs] +def send_message(msg: str, uid: str) -> str: + """Send a generic message to the player.""" + uid = check_uuid(uid) + send_player_input(msg, uid=uid) + avatar = generate_image_from_name("Me") + send_msg(msg, is_player=True, role="Me", uid=uid, avatar=avatar) + return ""
+ + + +
+[docs] +def fn_choice(data: gr.EventData, uid: str) -> None: + """Handle a selection event from the chatbot interface.""" + uid = check_uuid(uid) + # pylint: disable=protected-access + send_player_input(data._data["value"], uid=uid)
+ + + +
+[docs] +def import_function_from_path( + module_path: str, + function_name: str, + module_name: Optional[str] = None, +) -> Callable: + """Import a function from the given module path.""" + import importlib.util + + script_dir = os.path.dirname(os.path.abspath(module_path)) + + # Temporarily add a script directory to sys.path + original_sys_path = sys.path[:] + sys.path.insert(0, script_dir) + + try: + # If a module name is not provided, you can use the filename ( + # without extension) as the module name + if module_name is None: + module_name = os.path.splitext(os.path.basename(module_path))[0] + # Creating module specifications and loading modules + spec = importlib.util.spec_from_file_location( + module_name, + module_path, + ) + if spec is not None: + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + # Getting a function from a module + function = getattr(module, function_name) + else: + raise ImportError( + f"Could not find module spec for {module_name} at" + f" {module_path}", + ) + except AttributeError as exc: + raise AttributeError( + f"The module '{module_name}' does not have a function named '" + f"{function_name}'. Please put your code in the main function, " + f"read README.md for details.", + ) from exc + finally: + # Restore the original sys.path + sys.path = original_sys_path + + return function
+ + + +# pylint: disable=too-many-statements +
+[docs] +def run_app() -> None: + """Entry point for the web UI application.""" + assert gr is not None, "Please install [full] version of AgentScope." + + parser = argparse.ArgumentParser() + parser.add_argument("script", type=str, help="Script file to run") + args = parser.parse_args() + + # Make sure script_path is an absolute path + script_path = os.path.abspath(args.script) + + # Get the directory where the script is located + script_dir = os.path.dirname(script_path) + # Save the current working directory + # Change the current working directory to the directory where + os.chdir(script_dir) + + def start_game(uid: str) -> None: + """Start the main game loop.""" + thread_local_data.uid = uid + if script_path.endswith(".py"): + main = import_function_from_path(script_path, "main") + elif script_path.endswith(".json"): + from agentscope.web.workstation.workflow import ( + start_workflow, + load_config, + ) + + config = load_config(script_path) + main = lambda: start_workflow(config) + else: + raise ValueError(f"Unrecognized file formats: {script_path}") + + while True: + try: + main() + except ResetException: + print(f"Reset Successfully:{uid} ") + except Exception as e: + trace_info = "".join( + traceback.TracebackException.from_exception(e).format(), + ) + for i in range(FAIL_COUNT_DOWN, 0, -1): + send_msg( + f"{SYS_MSG_PREFIX} error {trace_info}, reboot " + f"in {i} seconds", + uid=uid, + ) + time.sleep(1) + reset_glb_var(uid) + + def check_for_new_session(uid: str) -> None: + """ + Check for a new user session and start a game thread if necessary. + """ + uid = check_uuid(uid) + if uid not in glb_signed_user: + glb_signed_user.append(uid) + print("==========Signed User==========") + print(f"Total number of users: {len(glb_signed_user)}") + run_thread = threading.Thread( + target=start_game, + args=(uid,), + ) + run_thread.start() + + with gr.Blocks() as demo: + warning_html_code = """ + <div class="hint" style="text-align: + center;background-color: rgba(255, 255, 0, 0.15); + padding: 10px; margin: 10px; border-radius: 5px; + border: 1px solid #ffcc00;"> + <p>If you want to start over, please click the + <strong>reset</strong> + button and <strong>refresh</strong> the page</p> + </div> + """ + gr.HTML(warning_html_code) + uuid = gr.Textbox(label="modelscope_uuid", visible=False) + + with gr.Row(): + chatbot = mgr.Chatbot( + label="Dialog", + show_label=False, + bubble_full_width=False, + visible=True, + ) + + with gr.Column(): + user_chat_input = gr.Textbox( + label="user_chat_input", + placeholder="Say something here", + show_label=False, + ) + send_button = gr.Button(value="📣Send") + with gr.Row(): + audio = gr.Accordion("Audio input", open=False) + with audio: + audio_term = gr.Audio( + visible=True, + type="filepath", + format="wav", + ) + submit_audio_button = gr.Button(value="Send Audio") + image = gr.Accordion("Image input", open=False) + with image: + image_term = gr.Image( + visible=True, + height=300, + interactive=True, + type="filepath", + ) + submit_image_button = gr.Button(value="Send Image") + with gr.Column(): + reset_button = gr.Button(value="Reset") + + # submit message + send_button.click( + send_message, + [user_chat_input, uuid], + user_chat_input, + ) + user_chat_input.submit( + send_message, + [user_chat_input, uuid], + user_chat_input, + ) + + submit_audio_button.click( + send_audio, + inputs=[audio_term, uuid], + outputs=[audio_term], + ) + + submit_image_button.click( + send_image, + inputs=[image_term, uuid], + outputs=[image_term], + ) + + reset_button.click(send_reset_msg, inputs=[uuid]) + + chatbot.custom(fn=fn_choice, inputs=[uuid]) + + demo.load( + check_for_new_session, + inputs=[uuid], + every=0.5, + ) + + demo.load( + get_chat, + inputs=[uuid], + outputs=[chatbot], + every=0.5, + ) + demo.queue() + demo.launch()
+ + + +if __name__ == "__main__": + run_app() +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/web/studio/utils.html b/en/_modules/agentscope/web/studio/utils.html new file mode 100644 index 000000000..5e5aa034e --- /dev/null +++ b/en/_modules/agentscope/web/studio/utils.html @@ -0,0 +1,386 @@ + + + + + + + agentscope.web.studio.utils — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for agentscope.web.studio.utils

+# -*- coding: utf-8 -*-
+"""web ui utils"""
+import os
+import threading
+from typing import Optional
+import hashlib
+from multiprocessing import Queue
+from queue import Empty
+from collections import defaultdict
+
+from PIL import Image
+
+from dashscope.audio.asr import RecognitionCallback, Recognition
+
+SYS_MSG_PREFIX = "【SYSTEM】"
+
+thread_local_data = threading.local()
+
+
+
+[docs] +def init_uid_queues() -> dict: + """Initializes and returns a dictionary of user-specific queues.""" + return { + "glb_queue_chat_msg": Queue(), + "glb_queue_user_input": Queue(), + "glb_queue_reset_msg": Queue(), + }
+ + + +glb_uid_dict = defaultdict(init_uid_queues) + + +
+[docs] +def send_msg( + msg: str, + is_player: bool = False, + role: Optional[str] = None, + uid: Optional[str] = None, + flushing: bool = False, + avatar: Optional[str] = None, + msg_id: Optional[str] = None, +) -> None: + """Sends a message to the web UI.""" + global glb_uid_dict + glb_queue_chat_msg = glb_uid_dict[uid]["glb_queue_chat_msg"] + if is_player: + glb_queue_chat_msg.put( + [ + { + "text": msg, + "name": role, + "flushing": flushing, + "avatar": avatar, + }, + None, + ], + ) + else: + glb_queue_chat_msg.put( + [ + None, + { + "text": msg, + "name": role, + "flushing": flushing, + "avatar": avatar, + "id": msg_id, + }, + ], + )
+ + + +
+[docs] +def get_chat_msg(uid: Optional[str] = None) -> list: + """Retrieves the next chat message from the queue, if available.""" + global glb_uid_dict + glb_queue_chat_msg = glb_uid_dict[uid]["glb_queue_chat_msg"] + if not glb_queue_chat_msg.empty(): + line = glb_queue_chat_msg.get(block=False) + if line is not None: + return line + return []
+ + + +
+[docs] +def send_player_input(msg: str, uid: Optional[str] = None) -> None: + """Sends player input to the web UI.""" + global glb_uid_dict + glb_queue_user_input = glb_uid_dict[uid]["glb_queue_user_input"] + glb_queue_user_input.put([None, msg])
+ + + +
+[docs] +def get_player_input( + timeout: Optional[int] = None, + uid: Optional[str] = None, +) -> str: + """Gets player input from the web UI or command line.""" + global glb_uid_dict + glb_queue_user_input = glb_uid_dict[uid]["glb_queue_user_input"] + + if timeout: + try: + content = glb_queue_user_input.get(block=True, timeout=timeout)[1] + except Empty as exc: + raise TimeoutError("timed out") from exc + else: + content = glb_queue_user_input.get(block=True)[1] + if content == "**Reset**": + glb_uid_dict[uid] = init_uid_queues() + raise ResetException + return content
+ + + +
+[docs] +def send_reset_msg(uid: Optional[str] = None) -> None: + """Sends a reset message to the web UI.""" + uid = check_uuid(uid) + global glb_uid_dict + glb_queue_reset_msg = glb_uid_dict[uid]["glb_queue_reset_msg"] + glb_queue_reset_msg.put([None, "**Reset**"]) + send_player_input("**Reset**", uid)
+ + + +
+[docs] +def get_reset_msg(uid: Optional[str] = None) -> None: + """Retrieves a reset message from the queue, if available.""" + global glb_uid_dict + glb_queue_reset_msg = glb_uid_dict[uid]["glb_queue_reset_msg"] + if not glb_queue_reset_msg.empty(): + content = glb_queue_reset_msg.get(block=True)[1] + if content == "**Reset**": + glb_uid_dict[uid] = init_uid_queues() + raise ResetException
+ + + +
+[docs] +class ResetException(Exception): + """Custom exception to signal a reset action in the application."""
+ + + +
+[docs] +def check_uuid(uid: Optional[str]) -> str: + """Checks whether a UUID is provided or generates a default one.""" + if not uid or uid == "": + if os.getenv("MODELSCOPE_ENVIRONMENT") == "studio": + import gradio as gr + + raise gr.Error("Please login first") + uid = "local_user" + return uid
+ + + +
+[docs] +def generate_image_from_name(name: str) -> str: + """Generates an image based on the hash of the given name.""" + from agentscope.file_manager import file_manager + + # Using hashlib to generate a hash of the name + hash_func = hashlib.md5() + hash_func.update(name.encode("utf-8")) + hash_value = hash_func.hexdigest() + + # Extract the first 6 characters of the hash value as the hexadecimal + # representation of the color + # generate a color value between #000000 and #ffffff + color_hex = "#" + hash_value[:6] + color_rgb = Image.new("RGB", (1, 1), color_hex).getpixel((0, 0)) + + image_filepath = os.path.join(file_manager.dir_root, f"{name}_image.png") + + # Check if the image already exists + if os.path.exists(image_filepath): + return image_filepath + + # If the image does not exist, generate and save it + width, height = 200, 200 + image = Image.new("RGB", (width, height), color_rgb) + + image.save(image_filepath) + + return image_filepath
+ + + +
+[docs] +def audio2text(audio_path: str) -> str: + """Converts audio file at the given path to text using ASR.""" + # dashscope.api_key = "" + callback = RecognitionCallback() + rec = Recognition( + model="paraformer-realtime-v1", + format="wav", + sample_rate=16000, + callback=callback, + ) + + result = rec.call(audio_path) + return " ".join([s["text"] for s in result["output"]["sentence"]])
+ + + +
+[docs] +def cycle_dots(text: str, num_dots: int = 3) -> str: + """display thinking dots before agent reply""" + current_dots = len(text) - len(text.rstrip(".")) + next_dots = (current_dots + 1) % (num_dots + 1) + if next_dots == 0: + next_dots = 1 + return text.rstrip(".") + "." * next_dots
+ + + +
+[docs] +def user_input( + prefix: str = "User input: ", + timeout: Optional[int] = None, +) -> str: + """get user input""" + if hasattr(thread_local_data, "uid"): + get_reset_msg(uid=thread_local_data.uid) + content = get_player_input( + timeout=timeout, + uid=thread_local_data.uid, + ) + else: + if timeout: + from inputimeout import inputimeout, TimeoutOccurred + + try: + content = inputimeout(prefix, timeout=timeout) + except TimeoutOccurred as exc: + raise TimeoutError("timed out") from exc + else: + content = input(prefix) + return content
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/web/workstation/workflow.html b/en/_modules/agentscope/web/workstation/workflow.html new file mode 100644 index 000000000..ad6ce0f2a --- /dev/null +++ b/en/_modules/agentscope/web/workstation/workflow.html @@ -0,0 +1,249 @@ + + + + + + + agentscope.web.workstation.workflow — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + + +
  • +
  • +
+
+
+
+
+ +

Source code for agentscope.web.workstation.workflow

+# -*- coding: utf-8 -*-
+""" Workflow"""
+import argparse
+import json
+import os
+
+from loguru import logger
+from agentscope.web.workstation.workflow_dag import build_dag
+
+
+
+[docs] +def load_config(config_path: str) -> dict: + """Load a JSON configuration file. + + Args: + config_path: A string path to the JSON configuration file. + + Returns: + A dictionary containing the loaded configuration. + """ + with open(config_path, "r", encoding="utf-8") as config_file: + config = json.load(config_file) + return config
+ + + +
+[docs] +def start_workflow(config: dict) -> None: + """Start the application workflow based on the given configuration. + + Args: + config: A dictionary containing the application configuration. + + This function will initialize and launch the application. + """ + logger.info("Launching...") + + dag = build_dag(config) + dag.run() + + logger.info("Finished.")
+ + + +
+[docs] +def compile_workflow(config: dict, compiled_filename: str = "main.py") -> None: + """Generates Python code based on the given configuration. + + Args: + config: A dictionary containing the application configuration. + compiled_filename: complied file name. + + """ + logger.info("Compiling...") + + dag = build_dag(config) + dag.compile(compiled_filename) + + logger.info("Finished.")
+ + + +
+[docs] +def main() -> None: + """Parse command-line arguments and launch the application workflow. + + This function sets up command-line argument parsing and checks if a + configuration file path is provided. If the configuration file is + found, it proceeds to load it and start the workflow. + + If no configuration file is provided, a FileNotFoundError is raised. + """ + parser = argparse.ArgumentParser(description="AgentScope Launcher") + parser.add_argument( + "cfg", + type=str, + help="Path to the config file.", + nargs="?", + ) + parser.add_argument( + "--compile", + type=str, + help="Compile the json code to python file, e.g. main.py", + default=False, + nargs="?", + const="", + ) + args = parser.parse_args() + cfg_path = args.cfg + compiled_filename = args.compile + + if cfg_path: + config = load_config(cfg_path) + if not compiled_filename: + start_workflow(config) + else: + if os.path.exists(compiled_filename): + while True: + user_input = input( + f"File 【{compiled_filename}】already exists, are you " + f"sure to overwrite? (yes/no)", + ) + if user_input.lower() in ["no", "n", "false"]: + raise FileExistsError(compiled_filename) + + if user_input.lower() in ["", "yes", "y", "true"]: + logger.warning(f"Overwrite 【{compiled_filename}】!") + break + + logger.info("Invalid input.") + compile_workflow(config, compiled_filename) + else: + raise FileNotFoundError("Please provide config file.")
+ + + +if __name__ == "__main__": + main() +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/web/workstation/workflow_dag.html b/en/_modules/agentscope/web/workstation/workflow_dag.html new file mode 100644 index 000000000..0f23a7545 --- /dev/null +++ b/en/_modules/agentscope/web/workstation/workflow_dag.html @@ -0,0 +1,491 @@ + + + + + + + agentscope.web.workstation.workflow_dag — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + + +
  • +
  • +
+
+
+
+
+ +

Source code for agentscope.web.workstation.workflow_dag

+# -*- coding: utf-8 -*-
+"""
+AgentScope workstation DAG running engine.
+
+This module defines various workflow nodes that can be used to construct
+a computational DAG. Each node represents a step in the DAG and
+can perform certain actions when called.
+"""
+import copy
+from typing import Any
+from loguru import logger
+
+import agentscope
+from agentscope.web.workstation.workflow_node import (
+    NODE_NAME_MAPPING,
+    WorkflowNodeType,
+    DEFAULT_FLOW_VAR,
+)
+from agentscope.web.workstation.workflow_utils import is_callable_expression
+
+try:
+    import networkx as nx
+except ImportError:
+    nx = None
+
+
+
+[docs] +def remove_duplicates_from_end(lst: list) -> list: + """remove duplicates element from end on a list""" + seen = set() + result = [] + for item in reversed(lst): + if item not in seen: + seen.add(item) + result.append(item) + result.reverse() + return result
+ + + +
+[docs] +class ASDiGraph(nx.DiGraph): + """ + A class that represents a directed graph, extending the functionality of + networkx's DiGraph to suit specific workflow requirements in AgentScope. + + This graph supports operations such as adding nodes with associated + computations and executing these computations in a topological order. + + Attributes: + nodes_not_in_graph (set): A set of nodes that are not included in + the computation graph. + """ + +
+[docs] + def __init__(self, *args, **kwargs): # type: ignore[no-untyped-def] + """ + Initialize the ASDiGraph instance. + """ + super().__init__(*args, **kwargs) + self.nodes_not_in_graph = set() + + # Prepare the header of the file with necessary imports and any + # global definitions + self.imports = [ + "import agentscope", + ] + + self.inits = [ + """agentscope.init(logger_level="DEBUG")""", + f"{DEFAULT_FLOW_VAR} = None", + ] + + self.execs = ["\n"]
+ + +
+[docs] + def run(self) -> None: + """ + Execute the computations associated with each node in the graph. + + The method initializes AgentScope, performs a topological sort of + the nodes, and then runs each node's computation sequentially using + the outputs from its predecessors as inputs. + """ + agentscope.init(logger_level="DEBUG") + sorted_nodes = list(nx.topological_sort(self)) + sorted_nodes = [ + node_id + for node_id in sorted_nodes + if node_id not in self.nodes_not_in_graph + ] + logger.info(f"sorted_nodes: {sorted_nodes}") + logger.info(f"nodes_not_in_graph: {self.nodes_not_in_graph}") + + # Cache output + values = {} + + # Run with predecessors outputs + for node_id in sorted_nodes: + inputs = [ + values[predecessor] + for predecessor in self.predecessors(node_id) + ] + if not inputs: + values[node_id] = self.exec_node(node_id) + elif len(inputs): + # Note: only support exec with the first predecessor now + values[node_id] = self.exec_node(node_id, inputs[0]) + else: + raise ValueError("Too many predecessors!")
+ + +
+[docs] + def compile(self, compiled_filename: str = "") -> str: + """Compile DAG to a runnable python code""" + + def format_python_code(code: str) -> str: + try: + from black import FileMode, format_str + + logger.debug("Formatting Code with black...") + return format_str(code, mode=FileMode()) + except Exception: + return code + + sorted_nodes = list(nx.topological_sort(self)) + sorted_nodes = [ + node_id + for node_id in sorted_nodes + if node_id not in self.nodes_not_in_graph + ] + + for node_id in sorted_nodes: + node = self.nodes[node_id] + self.execs.append(node["compile_dict"]["execs"]) + + header = "\n".join(self.imports) + + # Remove duplicate import + new_imports = remove_duplicates_from_end(header.split("\n")) + header = "\n".join(new_imports) + body = "\n ".join(self.inits + self.execs) + + main_body = f"def main():\n {body}" + + # Combine header and body to form the full script + script = ( + f"{header}\n\n\n{main_body}\n\nif __name__ == " + f"'__main__':\n main()\n" + ) + + formatted_code = format_python_code(script) + + if len(compiled_filename) > 0: + # Write the script to file + with open(compiled_filename, "w", encoding="utf-8") as file: + file.write(formatted_code) + return formatted_code
+ + + # pylint: disable=R0912 +
+[docs] + def add_as_node( + self, + node_id: str, + node_info: dict, + config: dict, + ) -> Any: + """ + Add a node to the graph based on provided node information and + configuration. + + Args: + node_id (str): The identifier for the node being added. + node_info (dict): A dictionary containing information about the + node. + config (dict): Configuration information for the node dependencies. + + Returns: + The computation object associated with the added node. + """ + node_cls = NODE_NAME_MAPPING[node_info.get("name", "")] + if node_cls.node_type not in [ + WorkflowNodeType.MODEL, + WorkflowNodeType.AGENT, + WorkflowNodeType.MESSAGE, + WorkflowNodeType.PIPELINE, + WorkflowNodeType.COPY, + WorkflowNodeType.SERVICE, + ]: + raise NotImplementedError(node_cls) + + if self.has_node(node_id): + return self.nodes[node_id]["opt"] + + # Init dep nodes + deps = [str(n) for n in node_info.get("data", {}).get("elements", [])] + + # Exclude for dag when in a Group + if node_cls.node_type != WorkflowNodeType.COPY: + self.nodes_not_in_graph = self.nodes_not_in_graph.union(set(deps)) + + dep_opts = [] + for dep_node_id in deps: + if not self.has_node(dep_node_id): + dep_node_info = config[dep_node_id] + self.add_as_node(dep_node_id, dep_node_info, config) + dep_opts.append(self.nodes[dep_node_id]["opt"]) + + node_opt = node_cls( + node_id=node_id, + opt_kwargs=node_info["data"].get("args", {}), + source_kwargs=node_info["data"].get("source", {}), + dep_opts=dep_opts, + ) + + # Add build compiled python code + compile_dict = node_opt.compile() + + self.add_node( + node_id, + opt=node_opt, + compile_dict=compile_dict, + **node_info, + ) + + # Insert compile information to imports and inits + self.imports.append(compile_dict["imports"]) + + if node_cls.node_type == WorkflowNodeType.MODEL: + self.inits.insert(1, compile_dict["inits"]) + else: + self.inits.append(compile_dict["inits"]) + return node_opt
+ + +
+[docs] + def exec_node(self, node_id: str, x_in: Any = None) -> Any: + """ + Execute the computation associated with a given node in the graph. + + Args: + node_id (str): The identifier of the node whose computation is + to be executed. + x_in: The input to the node's computation. Defaults to None. + + Returns: + The output of the node's computation. + """ + logger.debug( + f"\nnode_id: {node_id}\nin_values:{x_in}", + ) + opt = self.nodes[node_id]["opt"] + out_values = opt(x_in) + logger.debug( + f"\nnode_id: {node_id}\nout_values:{out_values}", + ) + return out_values
+
+ + + +
+[docs] +def sanitize_node_data(raw_info: dict) -> dict: + """ + Clean and validate node data, evaluating callable expressions where + necessary. + + Processes the raw node information, removes empty arguments, and evaluates + any callable expressions provided as string literals. + + Args: + raw_info (dict): The raw node information dictionary that may contain + callable expressions as strings. + + Returns: + dict: The sanitized node information with callable expressions + evaluated. + """ + + copied_info = copy.deepcopy(raw_info) + raw_info["data"]["source"] = copy.deepcopy( + copied_info["data"].get( + "args", + {}, + ), + ) + for key, value in copied_info["data"].get("args", {}).items(): + if not value: + raw_info["data"]["args"].pop(key) + raw_info["data"]["source"].pop(key) + elif is_callable_expression(value): + raw_info["data"]["args"][key] = eval(value) + return raw_info
+ + + +
+[docs] +def build_dag(config: dict) -> ASDiGraph: + """ + Construct a Directed Acyclic Graph (DAG) from the provided configuration. + + Initializes the graph nodes based on the configuration, adds model nodes + first, then non-model nodes, and finally adds edges between the nodes. + + Args: + config (dict): The configuration to build the graph from, containing + node info such as name, type, arguments, and connections. + + Returns: + ASDiGraph: The constructed directed acyclic graph. + + Raises: + ValueError: If the resulting graph is not acyclic. + """ + dag = ASDiGraph() + + for node_id, node_info in config.items(): + config[node_id] = sanitize_node_data(node_info) + + # Add and init model nodes first + for node_id, node_info in config.items(): + if ( + NODE_NAME_MAPPING[node_info["name"]].node_type + == WorkflowNodeType.MODEL + ): + dag.add_as_node(node_id, node_info, config) + + # Add and init non-model nodes + for node_id, node_info in config.items(): + if ( + NODE_NAME_MAPPING[node_info["name"]].node_type + != WorkflowNodeType.MODEL + ): + dag.add_as_node(node_id, node_info, config) + + # Add edges + for node_id, node_info in config.items(): + outputs = node_info.get("outputs", {}) + for output_key, output_val in outputs.items(): + connections = output_val.get("connections", []) + for conn in connections: + target_node_id = conn.get("node") + # Here it is assumed that the output of the connection is + # only connected to one of the inputs. If there are more + # complex connections, modify the logic accordingly + dag.add_edge(node_id, target_node_id, output_key=output_key) + + # Check if the graph is a DAG + if not nx.is_directed_acyclic_graph(dag): + raise ValueError("The provided configuration does not form a DAG.") + + return dag
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/web/workstation/workflow_node.html b/en/_modules/agentscope/web/workstation/workflow_node.html new file mode 100644 index 000000000..21660ac1a --- /dev/null +++ b/en/_modules/agentscope/web/workstation/workflow_node.html @@ -0,0 +1,1215 @@ + + + + + + + agentscope.web.workstation.workflow_node — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + + +
  • +
  • +
+
+
+
+
+ +

Source code for agentscope.web.workstation.workflow_node

+# -*- coding: utf-8 -*-
+"""Workflow node opt."""
+from abc import ABC, abstractmethod
+from enum import IntEnum
+from typing import List, Optional
+
+from agentscope import msghub
+from agentscope.agents import (
+    DialogAgent,
+    UserAgent,
+    TextToImageAgent,
+    DictDialogAgent,
+    ReActAgent,
+)
+from agentscope.message import Msg
+from agentscope.models import read_model_configs
+from agentscope.pipelines import (
+    SequentialPipeline,
+    ForLoopPipeline,
+    WhileLoopPipeline,
+    IfElsePipeline,
+    SwitchPipeline,
+)
+from agentscope.pipelines.functional import placeholder
+from agentscope.web.workstation.workflow_utils import (
+    kwarg_converter,
+    deps_converter,
+    dict_converter,
+)
+from agentscope.service import (
+    bing_search,
+    google_search,
+    read_text_file,
+    write_text_file,
+    execute_python_code,
+    ServiceFactory,
+)
+
+DEFAULT_FLOW_VAR = "flow"
+
+
+
+[docs] +class WorkflowNodeType(IntEnum): + """Enum for workflow node.""" + + MODEL = 0 + AGENT = 1 + PIPELINE = 2 + SERVICE = 3 + MESSAGE = 4 + COPY = 5
+ + + +
+[docs] +class WorkflowNode(ABC): + """ + Abstract base class representing a generic node in a workflow. + + WorkflowNode is designed to be subclassed with specific logic implemented + in the subclass methods. It provides an interface for initialization and + execution of operations when the node is called. + """ + + node_type = None + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + """ + Initialize nodes. Implement specific initialization logic in + subclasses. + """ + self.node_id = node_id + self.opt_kwargs = opt_kwargs + self.source_kwargs = source_kwargs + self.dep_opts = dep_opts + self.dep_vars = [opt.var_name for opt in self.dep_opts] + self.var_name = f"{self.node_type.name.lower()}_{self.node_id}"
+ + + def __call__(self, x: dict = None): # type: ignore[no-untyped-def] + """ + Performs the operations of the node. Implement specific logic in + subclasses. + """ + +
+[docs] + @abstractmethod + def compile(self) -> dict: + """ + Compile Node to python executable code dict + """ + return { + "imports": "", + "inits": "", + "execs": "", + }
+
+ + + +
+[docs] +class ModelNode(WorkflowNode): + """ + A node that represents a model in a workflow. + + The ModelNode can be used to load and execute a model as part of the + workflow node. It initializes model configurations and performs + model-related operations when called. + """ + + node_type = WorkflowNodeType.MODEL + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + read_model_configs([self.opt_kwargs])
+ + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.models import read_model_configs", + "inits": f"read_model_configs([{self.opt_kwargs}])", + "execs": "", + }
+
+ + + +
+[docs] +class MsgNode(WorkflowNode): + """ + A node that manages messaging within a workflow. + + MsgNode is responsible for handling messages, creating message objects, + and performing message-related operations when the node is invoked. + """ + + node_type = WorkflowNodeType.MESSAGE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.msg = Msg(**self.opt_kwargs)
+ + + def __call__(self, x: dict = None) -> dict: + return self.msg + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.message import Msg", + "inits": f"{DEFAULT_FLOW_VAR} = Msg" + f"({kwarg_converter(self.opt_kwargs)})", + "execs": "", + }
+
+ + + +
+[docs] +class DialogAgentNode(WorkflowNode): + """ + A node representing a DialogAgent within a workflow. + """ + + node_type = WorkflowNodeType.AGENT + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.pipeline = DialogAgent(**self.opt_kwargs)
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.agents import DialogAgent", + "inits": f"{self.var_name} = DialogAgent(" + f"{kwarg_converter(self.opt_kwargs)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class UserAgentNode(WorkflowNode): + """ + A node representing a UserAgent within a workflow. + """ + + node_type = WorkflowNodeType.AGENT + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.pipeline = UserAgent(**self.opt_kwargs)
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.agents import UserAgent", + "inits": f"{self.var_name} = UserAgent(" + f"{kwarg_converter(self.opt_kwargs)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class TextToImageAgentNode(WorkflowNode): + """ + A node representing a TextToImageAgent within a workflow. + """ + + node_type = WorkflowNodeType.AGENT + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.pipeline = TextToImageAgent(**self.opt_kwargs)
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.agents import TextToImageAgent", + "inits": f"{self.var_name} = TextToImageAgent(" + f"{kwarg_converter(self.opt_kwargs)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class DictDialogAgentNode(WorkflowNode): + """ + A node representing a DictDialogAgent within a workflow. + """ + + node_type = WorkflowNodeType.AGENT + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.pipeline = DictDialogAgent(**self.opt_kwargs)
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.agents import DictDialogAgent", + "inits": f"{self.var_name} = DictDialogAgent(" + f"{kwarg_converter(self.opt_kwargs)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class ReActAgentNode(WorkflowNode): + """ + A node representing a ReActAgent within a workflow. + """ + + node_type = WorkflowNodeType.AGENT + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + # Build tools + self.tools = [] + for tool in dep_opts: + if not hasattr(tool, "service_func"): + raise TypeError(f"{tool} must be tool!") + self.tools.append(tool.service_func) + self.pipeline = ReActAgent(tools=self.tools, **self.opt_kwargs)
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.agents import ReActAgent", + "inits": f"{self.var_name} = ReActAgent" + f"({kwarg_converter(self.opt_kwargs)}, tools" + f"={deps_converter(self.dep_vars)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class MsgHubNode(WorkflowNode): + """ + A node that serves as a messaging hub within a workflow. + + MsgHubNode is responsible for broadcasting announcements to participants + and managing the flow of messages within a workflow's node. + """ + + node_type = WorkflowNodeType.PIPELINE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.announcement = Msg( + name=self.opt_kwargs["announcement"].get("name", "Host"), + content=self.opt_kwargs["announcement"].get("content", "Welcome!"), + role="system", + ) + assert len(self.dep_opts) == 1 and hasattr( + self.dep_opts[0], + "pipeline", + ), ( + "MsgHub members must be a list of length 1, with the first " + "element being an instance of PipelineBaseNode" + ) + + self.pipeline = self.dep_opts[0] + self.participants = get_all_agents(self.pipeline) + self.participants_var = get_all_agents(self.pipeline, return_var=True)
+ + + def __call__(self, x: dict = None) -> dict: + with msghub(self.participants, announcement=self.announcement): + x = self.pipeline(x) + return x + +
+[docs] + def compile(self) -> dict: + announcement = ( + f'Msg(name="' + f'{self.opt_kwargs["announcement"].get("name", "Host")}", ' + f'content="' + f'{self.opt_kwargs["announcement"].get("content", "Host")}"' + f', role="system")' + ) + execs = f"""with msghub({deps_converter(self.participants_var)}, + announcement={announcement}): + {DEFAULT_FLOW_VAR} = {self.dep_vars[0]}({DEFAULT_FLOW_VAR}) + """ + return { + "imports": "from agentscope.msghub import msghub\n" + "from agentscope.message import Msg", + "inits": "", + "execs": execs, + }
+
+ + + +
+[docs] +class PlaceHolderNode(WorkflowNode): + """ + A placeholder node within a workflow. + + This node acts as a placeholder and can be used to pass through information + or data without performing any significant operation. + """ + + node_type = WorkflowNodeType.PIPELINE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.pipeline = placeholder
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.pipelines.functional import " + "placeholder", + "inits": f"{self.var_name} = placeholder", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class SequentialPipelineNode(WorkflowNode): + """ + A node representing a sequential node within a workflow. + + SequentialPipelineNode executes a series of operators or nodes in a + sequence, where the output of one node is the input to the next. + """ + + node_type = WorkflowNodeType.PIPELINE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.pipeline = SequentialPipeline(operators=self.dep_opts)
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.pipelines import SequentialPipeline", + "inits": f"{self.var_name} = SequentialPipeline(" + f"{deps_converter(self.dep_vars)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class ForLoopPipelineNode(WorkflowNode): + """ + A node representing a for-loop structure in a workflow. + + ForLoopPipelineNode allows the execution of a pipeline node multiple times, + iterating over a given set of inputs or a specified range. + """ + + node_type = WorkflowNodeType.PIPELINE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + assert ( + len(self.dep_opts) == 1 + ), "ForLoopPipelineNode can only contain one PipelineNode." + self.pipeline = ForLoopPipeline( + loop_body_operators=self.dep_opts[0], + **self.opt_kwargs, + )
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.pipelines import ForLoopPipeline", + "inits": f"{self.var_name} = ForLoopPipeline(" + f"loop_body_operators=" + f"{deps_converter(self.dep_vars)}," + f" {kwarg_converter(self.source_kwargs)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class WhileLoopPipelineNode(WorkflowNode): + """ + A node representing a while-loop structure in a workflow. + + WhileLoopPipelineNode enables conditional repeated execution of a node + node based on a specified condition. + """ + + node_type = WorkflowNodeType.PIPELINE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + assert ( + len(self.dep_opts) == 1 + ), "WhileLoopPipelineNode can only contain one PipelineNode." + self.pipeline = WhileLoopPipeline( + loop_body_operators=self.dep_opts[0], + **self.opt_kwargs, + )
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.pipelines import WhileLoopPipeline", + "inits": f"{self.var_name} = WhileLoopPipeline(" + f"loop_body_operators=" + f"{deps_converter(self.dep_vars)}," + f" {kwarg_converter(self.source_kwargs)})", + "execs": f"{DEFAULT_FLOW_VAR} = {self.var_name}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class IfElsePipelineNode(WorkflowNode): + """ + A node representing an if-else conditional structure in a workflow. + + IfElsePipelineNode directs the flow of execution to different node + nodes based on a specified condition. + """ + + node_type = WorkflowNodeType.PIPELINE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + assert ( + 0 < len(self.dep_opts) <= 2 + ), "IfElsePipelineNode must contain one or two PipelineNode." + if len(self.dep_opts) == 1: + self.pipeline = IfElsePipeline( + if_body_operators=self.dep_opts[0], + **self.opt_kwargs, + ) + elif len(self.dep_opts) == 2: + self.pipeline = IfElsePipeline( + if_body_operators=self.dep_opts[0], + else_body_operators=self.dep_opts[1], + **self.opt_kwargs, + )
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + imports = "from agentscope.pipelines import IfElsePipeline" + execs = f"{DEFAULT_FLOW_VAR} = {self.var_name}({DEFAULT_FLOW_VAR})" + if len(self.dep_vars) == 1: + return { + "imports": imports, + "inits": f"{self.var_name} = IfElsePipeline(" + f"if_body_operators={self.dep_vars[0]})", + "execs": execs, + } + elif len(self.dep_vars) == 2: + return { + "imports": imports, + "inits": f"{self.var_name} = IfElsePipeline(" + f"if_body_operators={self.dep_vars[0]}, " + f"else_body_operators={self.dep_vars[1]})", + "execs": execs, + } + raise ValueError
+
+ + + +
+[docs] +class SwitchPipelineNode(WorkflowNode): + """ + A node representing a switch-case structure within a workflow. + + SwitchPipelineNode routes the execution to different node nodes + based on the evaluation of a specified key or condition. + """ + + node_type = WorkflowNodeType.PIPELINE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + assert 0 < len(self.dep_opts), ( + "SwitchPipelineNode must contain at least " "one PipelineNode." + ) + case_operators = {} + self.case_operators_var = {} + + if len(self.dep_opts) == len(self.opt_kwargs["cases"]): + # No default_operators provided + default_operators = placeholder + self.default_var_name = "placeholder" + elif len(self.dep_opts) == len(self.opt_kwargs["cases"]) + 1: + # default_operators provided + default_operators = self.dep_opts.pop(-1) + self.default_var_name = self.dep_vars.pop(-1) + else: + raise ValueError( + f"SwitchPipelineNode deps {self.dep_opts} not matches " + f"cases {self.opt_kwargs['cases']}.", + ) + + for key, value, var in zip( + self.opt_kwargs["cases"], + self.dep_opts, + self.dep_vars, + ): + case_operators[key] = value.pipeline + self.case_operators_var[key] = var + self.opt_kwargs.pop("cases") + self.source_kwargs.pop("cases") + self.pipeline = SwitchPipeline( + case_operators=case_operators, + default_operators=default_operators, # type: ignore[arg-type] + **self.opt_kwargs, + )
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + imports = ( + "from agentscope.pipelines import SwitchPipeline\n" + "from agentscope.pipelines.functional import placeholder" + ) + execs = f"{DEFAULT_FLOW_VAR} = {self.var_name}({DEFAULT_FLOW_VAR})" + return { + "imports": imports, + "inits": f"{self.var_name} = SwitchPipeline(case_operators=" + f"{dict_converter(self.case_operators_var)}, " + f"default_operators={self.default_var_name}," + f" {kwarg_converter(self.source_kwargs)})", + "execs": execs, + }
+
+ + + +
+[docs] +class CopyNode(WorkflowNode): + """ + A node that duplicates the output of another node in the workflow. + + CopyNode is used to replicate the results of a parent node and can be + useful in workflows where the same output is needed for multiple + subsequent operations. + """ + + node_type = WorkflowNodeType.COPY + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + assert len(self.dep_opts) == 1, "CopyNode can only have one parent!" + self.pipeline = self.dep_opts[0]
+ + + def __call__(self, x: dict = None) -> dict: + return self.pipeline(x) + +
+[docs] + def compile(self) -> dict: + return { + "imports": "", + "inits": "", + "execs": f"{DEFAULT_FLOW_VAR} = {self.dep_vars[0]}" + f"({DEFAULT_FLOW_VAR})", + }
+
+ + + +
+[docs] +class BingSearchServiceNode(WorkflowNode): + """ + Bing Search Node + """ + + node_type = WorkflowNodeType.SERVICE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.service_func = ServiceFactory.get(bing_search, **self.opt_kwargs)
+ + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.service import ServiceFactory\n" + "from agentscope.service import bing_search", + "inits": f"{self.var_name} = ServiceFactory.get(bing_search," + f" {kwarg_converter(self.opt_kwargs)})", + "execs": "", + }
+
+ + + +
+[docs] +class GoogleSearchServiceNode(WorkflowNode): + """ + Google Search Node + """ + + node_type = WorkflowNodeType.SERVICE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.service_func = ServiceFactory.get( + google_search, + **self.opt_kwargs, + )
+ + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.service import ServiceFactory\n" + "from agentscope.service import google_search", + "inits": f"{self.var_name} = ServiceFactory.get(google_search," + f" {kwarg_converter(self.opt_kwargs)})", + "execs": "", + }
+
+ + + +
+[docs] +class PythonServiceNode(WorkflowNode): + """ + Execute python Node + """ + + node_type = WorkflowNodeType.SERVICE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.service_func = ServiceFactory.get(execute_python_code)
+ + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.service import ServiceFactory\n" + "from agentscope.service import execute_python_code", + "inits": f"{self.var_name} = ServiceFactory.get(" + f"execute_python_code)", + "execs": "", + }
+
+ + + +
+[docs] +class ReadTextServiceNode(WorkflowNode): + """ + Read Text Service Node + """ + + node_type = WorkflowNodeType.SERVICE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.service_func = ServiceFactory.get(read_text_file)
+ + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.service import ServiceFactory\n" + "from agentscope.service import read_text_file", + "inits": f"{self.var_name} = ServiceFactory.get(read_text_file)", + "execs": "", + }
+
+ + + +
+[docs] +class WriteTextServiceNode(WorkflowNode): + """ + Write Text Service Node + """ + + node_type = WorkflowNodeType.SERVICE + +
+[docs] + def __init__( + self, + node_id: str, + opt_kwargs: dict, + source_kwargs: dict, + dep_opts: list, + ) -> None: + super().__init__(node_id, opt_kwargs, source_kwargs, dep_opts) + self.service_func = ServiceFactory.get(write_text_file)
+ + +
+[docs] + def compile(self) -> dict: + return { + "imports": "from agentscope.service import ServiceFactory\n" + "from agentscope.service import write_text_file", + "inits": f"{self.var_name} = ServiceFactory.get(write_text_file)", + "execs": "", + }
+
+ + + +NODE_NAME_MAPPING = { + "dashscope_chat": ModelNode, + "openai_chat": ModelNode, + "post_api_chat": ModelNode, + "Message": MsgNode, + "DialogAgent": DialogAgentNode, + "UserAgent": UserAgentNode, + "TextToImageAgent": TextToImageAgentNode, + "DictDialogAgent": DictDialogAgentNode, + "ReActAgent": ReActAgentNode, + "Placeholder": PlaceHolderNode, + "MsgHub": MsgHubNode, + "SequentialPipeline": SequentialPipelineNode, + "ForLoopPipeline": ForLoopPipelineNode, + "WhileLoopPipeline": WhileLoopPipelineNode, + "IfElsePipeline": IfElsePipelineNode, + "SwitchPipeline": SwitchPipelineNode, + "CopyNode": CopyNode, + "BingSearchService": BingSearchServiceNode, + "GoogleSearchService": GoogleSearchServiceNode, + "PythonService": PythonServiceNode, + "ReadTextService": ReadTextServiceNode, + "WriteTextService": WriteTextServiceNode, +} + + +
+[docs] +def get_all_agents( + node: WorkflowNode, + seen_agents: Optional[set] = None, + return_var: bool = False, +) -> List: + """ + Retrieve all unique agent objects from a pipeline. + + Recursively traverses the pipeline to collect all distinct agent-based + participants. Prevents duplication by tracking already seen agents. + + Args: + node (WorkflowNode): The WorkflowNode from which to extract agents. + seen_agents (set, optional): A set of agents that have already been + seen to avoid duplication. Defaults to None. + + Returns: + list: A list of unique agent objects found in the pipeline. + """ + if seen_agents is None: + seen_agents = set() + + all_agents = [] + + for participant in node.pipeline.participants: + if participant.node_type == WorkflowNodeType.AGENT: + if participant not in seen_agents: + if return_var: + all_agents.append(participant.var_name) + else: + all_agents.append(participant.pipeline) + seen_agents.add(participant.pipeline) + elif participant.node_type == WorkflowNodeType.PIPELINE: + nested_agents = get_all_agents( + participant, + seen_agents, + return_var=return_var, + ) + all_agents.extend(nested_agents) + else: + raise TypeError(type(participant)) + + return all_agents
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/agentscope/web/workstation/workflow_utils.html b/en/_modules/agentscope/web/workstation/workflow_utils.html new file mode 100644 index 000000000..649819da2 --- /dev/null +++ b/en/_modules/agentscope/web/workstation/workflow_utils.html @@ -0,0 +1,177 @@ + + + + + + + agentscope.web.workstation.workflow_utils — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + + +
  • +
  • +
+
+
+
+
+ +

Source code for agentscope.web.workstation.workflow_utils

+# -*- coding: utf-8 -*-
+"""Workflow node utils."""
+
+
+
+[docs] +def is_callable_expression(s: str) -> bool: + """Check a expression whether a callable expression""" + try: + # Do not detect exp like this + if s in ["input", "print"]: + return False + result = eval(s) + return callable(result) + except Exception: + return False
+ + + +
+[docs] +def kwarg_converter(kwargs: dict) -> str: + """Convert a kwarg dict to a string.""" + kwarg_parts = [] + for key, value in kwargs.items(): + if is_callable_expression(value): + kwarg_parts.append(f"{key}={value}") + else: + kwarg_parts.append(f"{key}={repr(value)}") + return ", ".join(kwarg_parts)
+ + + +
+[docs] +def deps_converter(dep_vars: list) -> str: + """Convert a dep_vars list to a string.""" + return f"[{', '.join(dep_vars)}]"
+ + + +
+[docs] +def dict_converter(dictionary: dict) -> str: + """Convert a dictionary to a string.""" + result_parts = [] + for key, value in dictionary.items(): + result_parts.append(f'"{key}": {value}') + return "{" + ", ".join(result_parts) + "}"
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2024, Alibaba Tongyi Lab.

+
+ + Built with Sphinx using a + theme + provided by Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/en/_modules/index.html b/en/_modules/index.html index 9f43813f6..ecd962f81 100644 --- a/en/_modules/index.html +++ b/en/_modules/index.html @@ -57,15 +57,17 @@

AgentScope API Reference

@@ -101,8 +103,10 @@

All modules for which code is available

  • agentscope.agents.rpc_agent
  • agentscope.agents.text_to_image_agent
  • agentscope.agents.user_agent
  • +
  • agentscope.constants
  • agentscope.memory.memory
  • agentscope.memory.temporary_memory
  • +
  • agentscope.message
  • agentscope.models
  • agentscope.msghub
  • agentscope.pipelines.functional
  • agentscope.pipelines.pipeline
  • +
  • agentscope.prompt
  • agentscope.rpc.rpc_agent_client
  • agentscope.rpc.rpc_agent_pb2_grpc
  • agentscope.service
  • @@ -135,9 +140,18 @@

    All modules for which code is available

  • agentscope.service.web.download
  • agentscope.service.web.search
  • agentscope.service.web.web_digest
  • -
  • agentscope.utils.logging_utils
  • +
  • agentscope.utils.common
  • +
  • agentscope.utils.logging_utils
  • agentscope.utils.monitor
  • +
  • agentscope.utils.token_utils
  • +
  • agentscope.utils.tools
  • agentscope.web._app
  • +
  • agentscope.web.studio.studio
  • +
  • agentscope.web.studio.utils
  • +
  • agentscope.web.workstation.workflow
  • +
  • agentscope.web.workstation.workflow_dag
  • +
  • agentscope.web.workstation.workflow_node
  • +
  • agentscope.web.workstation.workflow_utils
  • google._upb._message
  • rpc_agent_pb2
  • diff --git a/en/_sources/agentscope.agents.agent.rst.txt b/en/_sources/agentscope.agents.agent.rst.txt new file mode 100644 index 000000000..3977231b9 --- /dev/null +++ b/en/_sources/agentscope.agents.agent.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.agent +======================= +.. automodule:: agentscope.agents.agent + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.agents.dialog_agent.rst.txt b/en/_sources/agentscope.agents.dialog_agent.rst.txt new file mode 100644 index 000000000..a58d7557b --- /dev/null +++ b/en/_sources/agentscope.agents.dialog_agent.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.dialog_agent +============================== +.. automodule:: agentscope.agents.dialog_agent + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.agents.dict_dialog_agent.rst.txt b/en/_sources/agentscope.agents.dict_dialog_agent.rst.txt new file mode 100644 index 000000000..a7df63953 --- /dev/null +++ b/en/_sources/agentscope.agents.dict_dialog_agent.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.dict_dialog_agent +=================================== +.. automodule:: agentscope.agents.dict_dialog_agent + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.agents.operator.rst.txt b/en/_sources/agentscope.agents.operator.rst.txt new file mode 100644 index 000000000..133160f52 --- /dev/null +++ b/en/_sources/agentscope.agents.operator.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.operator +========================== +.. automodule:: agentscope.agents.operator + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.agents.react_agent.rst.txt b/en/_sources/agentscope.agents.react_agent.rst.txt new file mode 100644 index 000000000..dd9717d15 --- /dev/null +++ b/en/_sources/agentscope.agents.react_agent.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.react_agent +============================= +.. automodule:: agentscope.agents.react_agent + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.agents.rpc_agent.rst.txt b/en/_sources/agentscope.agents.rpc_agent.rst.txt new file mode 100644 index 000000000..2385e3129 --- /dev/null +++ b/en/_sources/agentscope.agents.rpc_agent.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.rpc_agent +=========================== +.. automodule:: agentscope.agents.rpc_agent + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.agents.text_to_image_agent.rst.txt b/en/_sources/agentscope.agents.text_to_image_agent.rst.txt new file mode 100644 index 000000000..787f7a6d3 --- /dev/null +++ b/en/_sources/agentscope.agents.text_to_image_agent.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.text_to_image_agent +===================================== +.. automodule:: agentscope.agents.text_to_image_agent + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.agents.user_agent.rst.txt b/en/_sources/agentscope.agents.user_agent.rst.txt new file mode 100644 index 000000000..f05fe42c9 --- /dev/null +++ b/en/_sources/agentscope.agents.user_agent.rst.txt @@ -0,0 +1,6 @@ +agentscope.agents.user_agent +============================ +.. automodule:: agentscope.agents.user_agent + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.constants.rst.txt b/en/_sources/agentscope.constants.rst.txt new file mode 100644 index 000000000..4962d468e --- /dev/null +++ b/en/_sources/agentscope.constants.rst.txt @@ -0,0 +1,6 @@ +agentscope.constants +==================== +.. automodule:: agentscope.constants + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.file_manager.rst.txt b/en/_sources/agentscope.file_manager.rst.txt new file mode 100644 index 000000000..04406c8e9 --- /dev/null +++ b/en/_sources/agentscope.file_manager.rst.txt @@ -0,0 +1,6 @@ +agentscope.file_manager +======================= +.. automodule:: agentscope.file_manager + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.memory.memory.rst.txt b/en/_sources/agentscope.memory.memory.rst.txt new file mode 100644 index 000000000..ffb167921 --- /dev/null +++ b/en/_sources/agentscope.memory.memory.rst.txt @@ -0,0 +1,6 @@ +agentscope.memory.memory +======================== +.. automodule:: agentscope.memory.memory + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.memory.temporary_memory.rst.txt b/en/_sources/agentscope.memory.temporary_memory.rst.txt new file mode 100644 index 000000000..51e97cf37 --- /dev/null +++ b/en/_sources/agentscope.memory.temporary_memory.rst.txt @@ -0,0 +1,6 @@ +agentscope.memory.temporary_memory +================================== +.. automodule:: agentscope.memory.temporary_memory + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.message.rst.txt b/en/_sources/agentscope.message.rst.txt new file mode 100644 index 000000000..396df5303 --- /dev/null +++ b/en/_sources/agentscope.message.rst.txt @@ -0,0 +1,6 @@ +agentscope.message +================== +.. automodule:: agentscope.message + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.config.rst.txt b/en/_sources/agentscope.models.config.rst.txt new file mode 100644 index 000000000..b802dcbaf --- /dev/null +++ b/en/_sources/agentscope.models.config.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.config +======================== +.. automodule:: agentscope.models.config + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.dashscope_model.rst.txt b/en/_sources/agentscope.models.dashscope_model.rst.txt new file mode 100644 index 000000000..0ffcfa7eb --- /dev/null +++ b/en/_sources/agentscope.models.dashscope_model.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.dashscope_model +================================= +.. automodule:: agentscope.models.dashscope_model + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.gemini_model.rst.txt b/en/_sources/agentscope.models.gemini_model.rst.txt new file mode 100644 index 000000000..83fb945d6 --- /dev/null +++ b/en/_sources/agentscope.models.gemini_model.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.gemini_model +============================== +.. automodule:: agentscope.models.gemini_model + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.model.rst.txt b/en/_sources/agentscope.models.model.rst.txt new file mode 100644 index 000000000..4cd6c0752 --- /dev/null +++ b/en/_sources/agentscope.models.model.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.model +======================= +.. automodule:: agentscope.models.model + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.ollama_model.rst.txt b/en/_sources/agentscope.models.ollama_model.rst.txt new file mode 100644 index 000000000..718c62346 --- /dev/null +++ b/en/_sources/agentscope.models.ollama_model.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.ollama_model +============================== +.. automodule:: agentscope.models.ollama_model + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.openai_model.rst.txt b/en/_sources/agentscope.models.openai_model.rst.txt new file mode 100644 index 000000000..9a6a21798 --- /dev/null +++ b/en/_sources/agentscope.models.openai_model.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.openai_model +============================== +.. automodule:: agentscope.models.openai_model + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.post_model.rst.txt b/en/_sources/agentscope.models.post_model.rst.txt new file mode 100644 index 000000000..4ddd271f6 --- /dev/null +++ b/en/_sources/agentscope.models.post_model.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.post_model +============================ +.. automodule:: agentscope.models.post_model + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.models.response.rst.txt b/en/_sources/agentscope.models.response.rst.txt new file mode 100644 index 000000000..f55ddb18b --- /dev/null +++ b/en/_sources/agentscope.models.response.rst.txt @@ -0,0 +1,6 @@ +agentscope.models.response +========================== +.. automodule:: agentscope.models.response + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.msghub.rst.txt b/en/_sources/agentscope.msghub.rst.txt new file mode 100644 index 000000000..34b260096 --- /dev/null +++ b/en/_sources/agentscope.msghub.rst.txt @@ -0,0 +1,6 @@ +agentscope.msghub +================= +.. automodule:: agentscope.msghub + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.pipelines.functional.rst.txt b/en/_sources/agentscope.pipelines.functional.rst.txt new file mode 100644 index 000000000..188e074be --- /dev/null +++ b/en/_sources/agentscope.pipelines.functional.rst.txt @@ -0,0 +1,6 @@ +agentscope.pipelines.functional +=============================== +.. automodule:: agentscope.pipelines.functional + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.pipelines.pipeline.rst.txt b/en/_sources/agentscope.pipelines.pipeline.rst.txt new file mode 100644 index 000000000..a7d36ebfc --- /dev/null +++ b/en/_sources/agentscope.pipelines.pipeline.rst.txt @@ -0,0 +1,6 @@ +agentscope.pipelines.pipeline +============================= +.. automodule:: agentscope.pipelines.pipeline + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.prompt.rst.txt b/en/_sources/agentscope.prompt.rst.txt new file mode 100644 index 000000000..37873259f --- /dev/null +++ b/en/_sources/agentscope.prompt.rst.txt @@ -0,0 +1,6 @@ +agentscope.prompt +================= +.. automodule:: agentscope.prompt + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.rpc.rpc_agent_client.rst.txt b/en/_sources/agentscope.rpc.rpc_agent_client.rst.txt new file mode 100644 index 000000000..a5eec4585 --- /dev/null +++ b/en/_sources/agentscope.rpc.rpc_agent_client.rst.txt @@ -0,0 +1,6 @@ +agentscope.rpc.rpc_agent_client +=============================== +.. automodule:: agentscope.rpc.rpc_agent_client + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.rpc.rpc_agent_pb2.rst.txt b/en/_sources/agentscope.rpc.rpc_agent_pb2.rst.txt new file mode 100644 index 000000000..670f157fe --- /dev/null +++ b/en/_sources/agentscope.rpc.rpc_agent_pb2.rst.txt @@ -0,0 +1,6 @@ +agentscope.rpc.rpc_agent_pb2 +============================ +.. automodule:: agentscope.rpc.rpc_agent_pb2 + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.rpc.rpc_agent_pb2_grpc.rst.txt b/en/_sources/agentscope.rpc.rpc_agent_pb2_grpc.rst.txt new file mode 100644 index 000000000..855214c5d --- /dev/null +++ b/en/_sources/agentscope.rpc.rpc_agent_pb2_grpc.rst.txt @@ -0,0 +1,6 @@ +agentscope.rpc.rpc_agent_pb2_grpc +================================= +.. automodule:: agentscope.rpc.rpc_agent_pb2_grpc + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.execute_code.exec_python.rst.txt b/en/_sources/agentscope.service.execute_code.exec_python.rst.txt new file mode 100644 index 000000000..efea8e56c --- /dev/null +++ b/en/_sources/agentscope.service.execute_code.exec_python.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.execute_code.exec_python +=========================================== +.. automodule:: agentscope.service.execute_code.exec_python + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.execute_code.exec_shell.rst.txt b/en/_sources/agentscope.service.execute_code.exec_shell.rst.txt new file mode 100644 index 000000000..3b1494234 --- /dev/null +++ b/en/_sources/agentscope.service.execute_code.exec_shell.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.execute_code.exec_shell +========================================== +.. automodule:: agentscope.service.execute_code.exec_shell + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.file.common.rst.txt b/en/_sources/agentscope.service.file.common.rst.txt new file mode 100644 index 000000000..8d51349d4 --- /dev/null +++ b/en/_sources/agentscope.service.file.common.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.file.common +============================== +.. automodule:: agentscope.service.file.common + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.file.json.rst.txt b/en/_sources/agentscope.service.file.json.rst.txt new file mode 100644 index 000000000..c536ec196 --- /dev/null +++ b/en/_sources/agentscope.service.file.json.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.file.json +============================ +.. automodule:: agentscope.service.file.json + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.file.text.rst.txt b/en/_sources/agentscope.service.file.text.rst.txt new file mode 100644 index 000000000..9fa04875d --- /dev/null +++ b/en/_sources/agentscope.service.file.text.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.file.text +============================ +.. automodule:: agentscope.service.file.text + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.retrieval.retrieval_from_list.rst.txt b/en/_sources/agentscope.service.retrieval.retrieval_from_list.rst.txt new file mode 100644 index 000000000..d6b788063 --- /dev/null +++ b/en/_sources/agentscope.service.retrieval.retrieval_from_list.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.retrieval.retrieval_from_list +================================================ +.. automodule:: agentscope.service.retrieval.retrieval_from_list + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.retrieval.similarity.rst.txt b/en/_sources/agentscope.service.retrieval.similarity.rst.txt new file mode 100644 index 000000000..7d335bb0f --- /dev/null +++ b/en/_sources/agentscope.service.retrieval.similarity.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.retrieval.similarity +======================================= +.. automodule:: agentscope.service.retrieval.similarity + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.service_factory.rst.txt b/en/_sources/agentscope.service.service_factory.rst.txt new file mode 100644 index 000000000..cf4ab1d5b --- /dev/null +++ b/en/_sources/agentscope.service.service_factory.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.service_factory +================================== +.. automodule:: agentscope.service.service_factory + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.service_response.rst.txt b/en/_sources/agentscope.service.service_response.rst.txt new file mode 100644 index 000000000..e3366af2c --- /dev/null +++ b/en/_sources/agentscope.service.service_response.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.service_response +=================================== +.. automodule:: agentscope.service.service_response + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.service_status.rst.txt b/en/_sources/agentscope.service.service_status.rst.txt new file mode 100644 index 000000000..265a1635b --- /dev/null +++ b/en/_sources/agentscope.service.service_status.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.service_status +================================= +.. automodule:: agentscope.service.service_status + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.sql_query.mongodb.rst.txt b/en/_sources/agentscope.service.sql_query.mongodb.rst.txt new file mode 100644 index 000000000..e5ab37652 --- /dev/null +++ b/en/_sources/agentscope.service.sql_query.mongodb.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.sql_query.mongodb +==================================== +.. automodule:: agentscope.service.sql_query.mongodb + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.sql_query.mysql.rst.txt b/en/_sources/agentscope.service.sql_query.mysql.rst.txt new file mode 100644 index 000000000..f54937fde --- /dev/null +++ b/en/_sources/agentscope.service.sql_query.mysql.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.sql_query.mysql +================================== +.. automodule:: agentscope.service.sql_query.mysql + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.sql_query.sqlite.rst.txt b/en/_sources/agentscope.service.sql_query.sqlite.rst.txt new file mode 100644 index 000000000..3b706c585 --- /dev/null +++ b/en/_sources/agentscope.service.sql_query.sqlite.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.sql_query.sqlite +=================================== +.. automodule:: agentscope.service.sql_query.sqlite + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.text_processing.summarization.rst.txt b/en/_sources/agentscope.service.text_processing.summarization.rst.txt new file mode 100644 index 000000000..4fc5c49b7 --- /dev/null +++ b/en/_sources/agentscope.service.text_processing.summarization.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.text_processing.summarization +================================================ +.. automodule:: agentscope.service.text_processing.summarization + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.web.arxiv.rst.txt b/en/_sources/agentscope.service.web.arxiv.rst.txt new file mode 100644 index 000000000..12162de59 --- /dev/null +++ b/en/_sources/agentscope.service.web.arxiv.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.web.arxiv +============================ +.. automodule:: agentscope.service.web.arxiv + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.web.download.rst.txt b/en/_sources/agentscope.service.web.download.rst.txt new file mode 100644 index 000000000..1a8694696 --- /dev/null +++ b/en/_sources/agentscope.service.web.download.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.web.download +=============================== +.. automodule:: agentscope.service.web.download + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.web.search.rst.txt b/en/_sources/agentscope.service.web.search.rst.txt new file mode 100644 index 000000000..68bb6bd12 --- /dev/null +++ b/en/_sources/agentscope.service.web.search.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.web.search +============================= +.. automodule:: agentscope.service.web.search + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.service.web.web_digest.rst.txt b/en/_sources/agentscope.service.web.web_digest.rst.txt new file mode 100644 index 000000000..ecf926d3d --- /dev/null +++ b/en/_sources/agentscope.service.web.web_digest.rst.txt @@ -0,0 +1,6 @@ +agentscope.service.web.web_digest +================================= +.. automodule:: agentscope.service.web.web_digest + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.utils.common.rst.txt b/en/_sources/agentscope.utils.common.rst.txt new file mode 100644 index 000000000..dc3fb19cf --- /dev/null +++ b/en/_sources/agentscope.utils.common.rst.txt @@ -0,0 +1,6 @@ +agentscope.utils.common +======================= +.. automodule:: agentscope.utils.common + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.utils.logging_utils.rst.txt b/en/_sources/agentscope.utils.logging_utils.rst.txt new file mode 100644 index 000000000..54032346f --- /dev/null +++ b/en/_sources/agentscope.utils.logging_utils.rst.txt @@ -0,0 +1,6 @@ +agentscope.utils.logging_utils +============================== +.. automodule:: agentscope.utils.logging_utils + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.utils.monitor.rst.txt b/en/_sources/agentscope.utils.monitor.rst.txt new file mode 100644 index 000000000..7a61a138f --- /dev/null +++ b/en/_sources/agentscope.utils.monitor.rst.txt @@ -0,0 +1,6 @@ +agentscope.utils.monitor +======================== +.. automodule:: agentscope.utils.monitor + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.utils.token_utils.rst.txt b/en/_sources/agentscope.utils.token_utils.rst.txt new file mode 100644 index 000000000..4e0335e4d --- /dev/null +++ b/en/_sources/agentscope.utils.token_utils.rst.txt @@ -0,0 +1,6 @@ +agentscope.utils.token_utils +============================ +.. automodule:: agentscope.utils.token_utils + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.utils.tools.rst.txt b/en/_sources/agentscope.utils.tools.rst.txt new file mode 100644 index 000000000..889e80929 --- /dev/null +++ b/en/_sources/agentscope.utils.tools.rst.txt @@ -0,0 +1,6 @@ +agentscope.utils.tools +====================== +.. automodule:: agentscope.utils.tools + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.web.studio.constants.rst.txt b/en/_sources/agentscope.web.studio.constants.rst.txt new file mode 100644 index 000000000..1ff763320 --- /dev/null +++ b/en/_sources/agentscope.web.studio.constants.rst.txt @@ -0,0 +1,6 @@ +agentscope.web.studio.constants +=============================== +.. automodule:: agentscope.web.studio.constants + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.web.studio.studio.rst.txt b/en/_sources/agentscope.web.studio.studio.rst.txt new file mode 100644 index 000000000..a2b5805cc --- /dev/null +++ b/en/_sources/agentscope.web.studio.studio.rst.txt @@ -0,0 +1,6 @@ +agentscope.web.studio.studio +============================ +.. automodule:: agentscope.web.studio.studio + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.web.studio.utils.rst.txt b/en/_sources/agentscope.web.studio.utils.rst.txt new file mode 100644 index 000000000..c9be22c7d --- /dev/null +++ b/en/_sources/agentscope.web.studio.utils.rst.txt @@ -0,0 +1,6 @@ +agentscope.web.studio.utils +=========================== +.. automodule:: agentscope.web.studio.utils + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.web.workstation.workflow.rst.txt b/en/_sources/agentscope.web.workstation.workflow.rst.txt new file mode 100644 index 000000000..cd21130ca --- /dev/null +++ b/en/_sources/agentscope.web.workstation.workflow.rst.txt @@ -0,0 +1,6 @@ +agentscope.web.workstation.workflow +=================================== +.. automodule:: agentscope.web.workstation.workflow + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.web.workstation.workflow_dag.rst.txt b/en/_sources/agentscope.web.workstation.workflow_dag.rst.txt new file mode 100644 index 000000000..5752e8e63 --- /dev/null +++ b/en/_sources/agentscope.web.workstation.workflow_dag.rst.txt @@ -0,0 +1,6 @@ +agentscope.web.workstation.workflow_dag +======================================= +.. automodule:: agentscope.web.workstation.workflow_dag + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.web.workstation.workflow_node.rst.txt b/en/_sources/agentscope.web.workstation.workflow_node.rst.txt new file mode 100644 index 000000000..c7fc7cf99 --- /dev/null +++ b/en/_sources/agentscope.web.workstation.workflow_node.rst.txt @@ -0,0 +1,6 @@ +agentscope.web.workstation.workflow_node +======================================== +.. automodule:: agentscope.web.workstation.workflow_node + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/agentscope.web.workstation.workflow_utils.rst.txt b/en/_sources/agentscope.web.workstation.workflow_utils.rst.txt new file mode 100644 index 000000000..ded0b5368 --- /dev/null +++ b/en/_sources/agentscope.web.workstation.workflow_utils.rst.txt @@ -0,0 +1,6 @@ +agentscope.web.workstation.workflow_utils +========================================= +.. automodule:: agentscope.web.workstation.workflow_utils + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/en/_sources/index.rst.txt b/en/_sources/index.rst.txt index 9033b1ee1..091134860 100644 --- a/en/_sources/index.rst.txt +++ b/en/_sources/index.rst.txt @@ -28,15 +28,17 @@ AgentScope Documentation :glob: :caption: AgentScope API Reference + agentscope + agentscope.message + agentscope.models agentscope.agents agentscope.memory - agentscope.models agentscope.pipelines agentscope.service agentscope.rpc - agentscope.utils agentscope.web - agentscope + agentscope.prompt + agentscope.utils Indices and tables ================== diff --git a/en/agentscope.agents.agent.html b/en/agentscope.agents.agent.html new file mode 100644 index 000000000..7bc98f138 --- /dev/null +++ b/en/agentscope.agents.agent.html @@ -0,0 +1,292 @@ + + + + + + + + agentscope.agents.agent — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.agent

    +

    Base class for Agent

    +
    +
    +class agentscope.agents.agent.AgentBase(*args: tuple, **kwargs: dict)[source]
    +

    Bases: Operator

    +

    Base class for all agents.

    +

    All agents should inherit from this class and implement the reply +function.

    +
    +
    +__init__(name: str, sys_prompt: str | None = None, model_config_name: str | None = None, use_memory: bool = True, memory_config: dict | None = None) None[source]
    +

    Initialize an agent from the given arguments.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (Optional[str]) – The system prompt of the agent, which can be passed by args +or hard-coded in the agent.

    • +
    • model_config_name (str, defaults to None) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict]) – The config of memory.

    • +
    +
    +
    +
    + +
    +
    +classmethod generate_agent_id() str[source]
    +

    Generate the agent_id of this agent instance

    +
    + +
    +
    +reply(x: dict | None = None) dict[source]
    +

    Define the actions taken by this agent.

    +
    +
    Parameters:
    +

    x (dict, defaults to None) – Dialog history and some environment information

    +
    +
    Returns:
    +

    The agent’s response to the input.

    +
    +
    +
    +

    Note

    +

    Given that some agents are in an adversarial environment, +their input doesn’t include the thoughts of other agents.

    +
    +
    + +
    +
    +load_from_config(config: dict) None[source]
    +

    Load configuration for this agent.

    +
    +
    Parameters:
    +

    config (dict) – model configuration

    +
    +
    +
    + +
    +
    +export_config() dict[source]
    +

    Return configuration of this agent.

    +
    +
    Returns:
    +

    The configuration of current agent.

    +
    +
    +
    + +
    +
    +load_memory(memory: Sequence[dict]) None[source]
    +

    Load input memory.

    +
    + +
    +
    +speak(content: str | dict) None[source]
    +

    Speak out the content generated by the agent.

    +
    + +
    +
    +observe(x: dict | Sequence[dict]) None[source]
    +

    Observe the input, store it in memory without response to it.

    +
    +
    Parameters:
    +

    x (Union[dict, Sequence[dict]]) – The input message to be recorded in memory.

    +
    +
    +
    + +
    +
    +reset_audience(audience: Sequence[AgentBase]) None[source]
    +

    Set the audience of this agent, which means if this agent +generates a response, it will be passed to all audiences.

    +
    +
    Parameters:
    +

    audience (Sequence[AgentBase]) – The audience of this agent, which will be notified when this +agent generates a response message.

    +
    +
    +
    + +
    +
    +clear_audience() None[source]
    +

    Remove the audience of this agent.

    +
    + +
    +
    +rm_audience(audience: Sequence[AgentBase] | AgentBase) None[source]
    +

    Remove the given audience from the Sequence

    +
    + +
    +
    +property agent_id: str
    +

    The unique id of this agent.

    +
    +
    Returns:
    +

    agent_id

    +
    +
    Return type:
    +

    str

    +
    +
    +
    + +
    +
    +to_dist(host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, launch_server: bool = True, local_mode: bool = True, lazy_launch: bool = True) AgentBase[source]
    +

    Convert current agent instance into a distributed version.

    +
    +
    Parameters:
    +
      +
    • host (str, defaults to “localhost”) – Hostname of the rpc agent server.

    • +
    • port (int, defaults to None) – Port of the rpc agent server.

    • +
    • max_pool_size (int, defaults to 8192) – Max number of task results that the server can accommodate.

    • +
    • max_timeout_seconds (int, defaults to 1800) – Timeout for task results.

    • +
    • local_mode (bool, defaults to True) – Whether the started rpc server only listens to local +requests.

    • +
    • lazy_launch (bool, defaults to True) – Only launch the server when the agent is called.

    • +
    +
    +
    Returns:
    +

    the wrapped agent instance with distributed +functionality

    +
    +
    Return type:
    +

    AgentBase

    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.agents.dialog_agent.html b/en/agentscope.agents.dialog_agent.html new file mode 100644 index 000000000..f24bd4183 --- /dev/null +++ b/en/agentscope.agents.dialog_agent.html @@ -0,0 +1,180 @@ + + + + + + + + agentscope.agents.dialog_agent — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.dialog_agent

    +

    A general dialog agent.

    +
    +
    +class agentscope.agents.dialog_agent.DialogAgent(*args: tuple, **kwargs: dict)[source]
    +

    Bases: AgentBase

    +

    A simple agent used to perform a dialogue. Your can set its role by +sys_prompt.

    +
    +
    +__init__(name: str, sys_prompt: str, model_config_name: str, use_memory: bool = True, memory_config: dict | None = None, prompt_type: PromptType | None = None) None[source]
    +

    Initialize the dialog agent.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (Optional[str]) – The system prompt of the agent, which can be passed by args +or hard-coded in the agent.

    • +
    • model_config_name (str) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict]) – The config of memory.

    • +
    • (Optional[PromptType] (prompt_type)

    • +
    • to (defaults)

    • +
    • PromptType.LIST) – The type of the prompt organization, chosen from +PromptType.LIST or PromptType.STRING.

    • +
    +
    +
    +
    + +
    +
    +reply(x: dict | None = None) dict[source]
    +

    Reply function of the agent. Processes the input data, +generates a prompt using the current dialogue memory and system +prompt, and invokes the language model to produce a response. The +response is then formatted and added to the dialogue memory.

    +
    +
    Parameters:
    +

    x (dict, defaults to None) – A dictionary representing the user’s input to the agent. This +input is added to the dialogue memory if provided. Defaults to +None.

    +
    +
    Returns:
    +

    A dictionary representing the message generated by the agent in +response to the user’s input.

    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.agents.dict_dialog_agent.html b/en/agentscope.agents.dict_dialog_agent.html new file mode 100644 index 000000000..99a1c598b --- /dev/null +++ b/en/agentscope.agents.dict_dialog_agent.html @@ -0,0 +1,219 @@ + + + + + + + + agentscope.agents.dict_dialog_agent — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.dict_dialog_agent

    +

    A dict dialog agent that using parse_func and fault_handler to +parse the model response.

    +
    +
    +agentscope.agents.dict_dialog_agent.parse_dict(response: ModelResponse) ModelResponse[source]
    +

    Parse function for DictDialogAgent

    +
    + +
    +
    +agentscope.agents.dict_dialog_agent.default_response(response: ModelResponse) ModelResponse[source]
    +

    The default response of fault_handler

    +
    + +
    +
    +class agentscope.agents.dict_dialog_agent.DictDialogAgent(*args: tuple, **kwargs: dict)[source]
    +

    Bases: AgentBase

    +

    An agent that generates response in a dict format, where user can +specify the required fields in the response via prompt, e.g.

    +
    prompt = "... Response in the following format that can be loaded by
    +python json.loads()
    +{
    +    "thought": "thought",
    +    "speak": "thoughts summary to say to others",
    +    # ...
    +}"
    +
    +
    +

    This agent class is an example for using parse_func and fault_handler +to parse the output from the model, and handling the fault when parsing +fails. We take “speak” as a required field in the response, and print +the speak field as the output response.

    +

    For usage example, please refer to the example of werewolf in +examples/game_werewolf

    +
    +
    +__init__(name: str, sys_prompt: str, model_config_name: str, use_memory: bool = True, memory_config: dict | None = None, parse_func: ~typing.Callable[[...], ~typing.Any] | None = <function parse_dict>, fault_handler: ~typing.Callable[[...], ~typing.Any] | None = <function default_response>, max_retries: int | None = 3, prompt_type: ~agentscope.prompt.PromptType | None = None) None[source]
    +

    Initialize the dict dialog agent.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (Optional[str], defaults to None) – The system prompt of the agent, which can be passed by args +or hard-coded in the agent.

    • +
    • model_config_name (str, defaults to None) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict], defaults to None) – The config of memory.

    • +
    • parse_func (Optional[Callable[…, Any]], defaults to parse_dict) – The function used to parse the model output, +e.g. json.loads, which is used to extract json from the +output.

    • +
    • fault_handler (Optional[Callable[…, Any]], defaults to default_response) – The function used to handle the fault when parse_func fails +to parse the model output.

    • +
    • max_retries (Optional[int], defaults to None) – The maximum number of retries when failed to parse the model +output.

    • +
    • prompt_type (Optional[PromptType], defaults to PromptType.LIST) – The type of the prompt organization, chosen from +PromptType.LIST or PromptType.STRING.

    • +
    +
    +
    +
    + +
    +
    +reply(x: dict | None = None) dict[source]
    +

    Reply function of the agent. +Processes the input data, generates a prompt using the current +dialogue memory and system prompt, and invokes the language +model to produce a response. The response is then formatted +and added to the dialogue memory.

    +
    +
    Parameters:
    +

    x (dict, defaults to None) – A dictionary representing the user’s input to the agent. +This input is added to the dialogue memory if provided.

    +
    +
    Returns:
    +

    A dictionary representing the message generated by the agent in +response to the user’s input. It contains at least a ‘speak’ key +with the textual response and may include other keys such as +‘agreement’ if provided by the language model.

    +
    +
    Raises:
    +

    json.decoder.JSONDecodeError – If the response from the language model is not valid JSON, + it defaults to treating the response as plain text.

    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.agents.html b/en/agentscope.agents.html index 4d98966ab..9a5906216 100644 --- a/en/agentscope.agents.html +++ b/en/agentscope.agents.html @@ -24,7 +24,7 @@ - + @@ -58,6 +58,9 @@

    AgentScope API Reference

    @@ -110,10 +112,29 @@
    class agentscope.agents.AgentBase(*args: tuple, **kwargs: dict)[source]
    -

    Bases: Operator

    +

    Bases: Operator

    Base class for all agents.

    All agents should inherit from this class and implement the reply function.

    +
    +
    +__init__(name: str, sys_prompt: str | None = None, model_config_name: str | None = None, use_memory: bool = True, memory_config: dict | None = None) None[source]
    +

    Initialize an agent from the given arguments.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (Optional[str]) – The system prompt of the agent, which can be passed by args +or hard-coded in the agent.

    • +
    • model_config_name (str, defaults to None) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict]) – The config of memory.

    • +
    +
    +
    +
    +
    classmethod generate_agent_id() str[source]
    @@ -186,7 +207,7 @@
    -reset_audience(audience: Sequence[AgentBase]) None[source]
    +reset_audience(audience: Sequence[AgentBase]) None[source]

    Set the audience of this agent, which means if this agent generates a response, it will be passed to all audiences.

    @@ -205,7 +226,7 @@
    -rm_audience(audience: Sequence[AgentBase] | AgentBase) None[source]
    +rm_audience(audience: Sequence[AgentBase] | AgentBase) None[source]

    Remove the given audience from the Sequence

    @@ -225,7 +246,7 @@
    -to_dist(host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, launch_server: bool = True, local_mode: bool = True, lazy_launch: bool = True) AgentBase[source]
    +to_dist(host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, launch_server: bool = True, local_mode: bool = True, lazy_launch: bool = True) AgentBase[source]

    Convert current agent instance into a distributed version.

    Parameters:
    @@ -264,9 +285,32 @@
    class agentscope.agents.DialogAgent(*args: tuple, **kwargs: dict)[source]
    -

    Bases: AgentBase

    +

    Bases: AgentBase

    A simple agent used to perform a dialogue. Your can set its role by sys_prompt.

    +
    +
    +__init__(name: str, sys_prompt: str, model_config_name: str, use_memory: bool = True, memory_config: dict | None = None, prompt_type: PromptType | None = None) None[source]
    +

    Initialize the dialog agent.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (Optional[str]) – The system prompt of the agent, which can be passed by args +or hard-coded in the agent.

    • +
    • model_config_name (str) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict]) – The config of memory.

    • +
    • (Optional[PromptType] (prompt_type)

    • +
    • to (defaults)

    • +
    • PromptType.LIST) – The type of the prompt organization, chosen from +PromptType.LIST or PromptType.STRING.

    • +
    +
    +
    +
    +
    reply(x: dict | None = None) dict[source]
    @@ -292,7 +336,7 @@
    class agentscope.agents.DictDialogAgent(*args: tuple, **kwargs: dict)[source]
    -

    Bases: AgentBase

    +

    Bases: AgentBase

    An agent that generates response in a dict format, where user can specify the required fields in the response via prompt, e.g.

    prompt = "... Response in the following format that can be loaded by
    @@ -310,6 +354,34 @@
     the speak field as the output response.

    For usage example, please refer to the example of werewolf in examples/game_werewolf

    +
    +
    +__init__(name: str, sys_prompt: str, model_config_name: str, use_memory: bool = True, memory_config: dict | None = None, parse_func: ~typing.Callable[[...], ~typing.Any] | None = <function parse_dict>, fault_handler: ~typing.Callable[[...], ~typing.Any] | None = <function default_response>, max_retries: int | None = 3, prompt_type: ~agentscope.prompt.PromptType | None = None) None[source]
    +

    Initialize the dict dialog agent.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (Optional[str], defaults to None) – The system prompt of the agent, which can be passed by args +or hard-coded in the agent.

    • +
    • model_config_name (str, defaults to None) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict], defaults to None) – The config of memory.

    • +
    • parse_func (Optional[Callable[…, Any]], defaults to parse_dict) – The function used to parse the model output, +e.g. json.loads, which is used to extract json from the +output.

    • +
    • fault_handler (Optional[Callable[…, Any]], defaults to default_response) – The function used to handle the fault when parse_func fails +to parse the model output.

    • +
    • max_retries (Optional[int], defaults to None) – The maximum number of retries when failed to parse the model +output.

    • +
    • prompt_type (Optional[PromptType], defaults to PromptType.LIST) – The type of the prompt organization, chosen from +PromptType.LIST or PromptType.STRING.

    • +
    +
    +
    +
    +
    reply(x: dict | None = None) dict[source]
    @@ -341,9 +413,26 @@
    class agentscope.agents.TextToImageAgent(*args: tuple, **kwargs: dict)[source]
    -

    Bases: AgentBase

    +

    Bases: AgentBase

    A agent used to perform text to image tasks.

    TODO: change the agent into a service.

    +
    +
    +__init__(name: str, model_config_name: str, use_memory: bool = True, memory_config: dict | None = None) None[source]
    +

    Initialize the text to image agent.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • model_config_name (str, defaults to None) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict]) – The config of memory.

    • +
    +
    +
    +
    +
    reply(x: dict | None = None) dict[source]
    @@ -368,8 +457,25 @@
    class agentscope.agents.UserAgent(*args: tuple, **kwargs: dict)[source]
    -

    Bases: AgentBase

    +

    Bases: AgentBase

    User agent class

    +
    +
    +__init__(name: str = 'User', require_url: bool = False) None[source]
    +

    Initialize a UserAgent object.

    +
    +
    Parameters:
    +
      +
    • name (str, defaults to “User”) – The name of the agent. Defaults to “User”.

    • +
    • require_url (bool, defaults to False) – Whether the agent requires user to input a URL. Defaults to +False. The URL can lead to a website, a file, +or a directory. It will be added into the generated message +in field url.

    • +
    +
    +
    +
    +
    reply(x: dict | None = None, required_keys: list[str] | str | None = None, timeout: int | None = None) dict[source]
    @@ -412,13 +518,34 @@
    class agentscope.agents.ReActAgent(*args: tuple, **kwargs: dict)[source]
    -

    Bases: AgentBase

    +

    Bases: AgentBase

    An agent class that implements the ReAct algorithm. More details refer to https://arxiv.org/abs/2210.03629.

    Note this is an example implementation of ReAct algorithm in AgentScope. We follow the idea within the paper, but the detailed prompt engineering maybe different. Developers are encouraged to modify the prompt to fit their own needs.

    +
    +
    +__init__(name: str, model_config_name: str, tools: List[Tuple], sys_prompt: str = "You're a helpful assistant. Your name is {name}.", max_iters: int = 10, verbose: bool = True) None[source]
    +

    Initialize the ReAct agent with the given name, model config name +and tools.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (str) – The system prompt of the agent.

    • +
    • model_config_name (str) – The name of the model config, which is used to load model from +configuration.

    • +
    • tools (List[Tuple]) – A list of tuples, each containing the name of a tool and the +tool’s description in JSON schema format.

    • +
    • max_iters (int, defaults to 10) – The maximum number of iterations of the reasoning-acting loops.

    • +
    • verbose (bool, defaults to True) – Whether to print the output of the tools.

    • +
    +
    +
    +
    +
    reply(x: dict | None = None) dict[source]
    @@ -479,8 +606,38 @@
    class agentscope.agents.RpcAgent(*args: tuple, **kwargs: dict)[source]
    -

    Bases: AgentBase

    +

    Bases: AgentBase

    A wrapper to extend an AgentBase into a gRPC Client.

    +
    +
    +__init__(name: str, agent_class: Type[AgentBase], agent_configs: dict | None = None, host: str = 'localhost', port: int | None = None, launch_server: bool = True, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, local_mode: bool = True, lazy_launch: bool = True, agent_id: str | None = None, create_with_agent_configs: bool = True) None[source]
    +

    Initialize a RpcAgent instance.

    +
    +
    Parameters:
    +
      +
    • name (str) – Name of the agent.

    • +
    • agent_class (Type[AgentBase]) – The AgentBase subclass encapsulated by this wrapper.

    • +
    • agent_configs (dict, defaults to None) – The args used to +initialize the agent_class.

    • +
    • host (str, defaults to “localhost”) – Hostname of the rpc agent server.

    • +
    • port (int, defaults to None) – Port of the rpc agent server.

    • +
    • launch_server (bool, defaults to True) – Whether to launch the gRPC agent server.

    • +
    • max_pool_size (int, defaults to 8192) – Max number of task results that the server can accommodate.

    • +
    • max_timeout_seconds (int, defaults to 1800) – Timeout for task results.

    • +
    • local_mode (bool, defaults to True) – Whether the started gRPC server only listens to local +requests.

    • +
    • lazy_launch (bool, defaults to True) – Only launch the server when the agent is called.

    • +
    • agent_id (str, defaults to None) – The agent id of this instance. If None, it will +be generated randomly.

    • +
    • create_with_agent_configs (bool, defaults to True) – Only takes effect when agent_configs is provided. +If true, create the agent instance for the agent with +provided agent_configs, otherwise uses the agent server’s +default parameters.

    • +
    +
    +
    +
    +
    reply(x: dict | None = None) dict[source]
    @@ -513,7 +670,7 @@
    -clone_instances(num_instances: int, including_self: bool = True) Sequence[AgentBase][source]
    +clone_instances(num_instances: int, including_self: bool = True) Sequence[AgentBase][source]

    Clone a series of this instance with different agent_id and return them as a list.

    @@ -544,9 +701,32 @@
    -class agentscope.agents.RpcAgentServerLauncher(agent_class: Type[AgentBase] | None = None, agent_args: tuple = (), agent_kwargs: dict | None = None, host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, local_mode: bool = False)[source]
    +class agentscope.agents.RpcAgentServerLauncher(agent_class: Type[AgentBase] | None = None, agent_args: tuple = (), agent_kwargs: dict | None = None, host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, local_mode: bool = False)[source]

    Bases: object

    Launcher of rpc agent server.

    +
    +
    +__init__(agent_class: Type[AgentBase] | None = None, agent_args: tuple = (), agent_kwargs: dict | None = None, host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, local_mode: bool = False) None[source]
    +

    Init a rpc agent server launcher.

    +
    +
    Parameters:
    +
      +
    • agent_class (Type[AgentBase], defaults to None) – The AgentBase subclass encapsulated by this wrapper.

    • +
    • agent_args (tuple) – The args tuple used to initialize the +agent_class.

    • +
    • agent_kwargs (dict) – The args dict used to initialize the +agent_class.

    • +
    • host (str, defaults to “localhost”) – Hostname of the rpc agent server.

    • +
    • port (int, defaults to None) – Port of the rpc agent server.

    • +
    • max_pool_size (int, defaults to 8192) – Max number of task results that the server can accommodate.

    • +
    • max_timeout_seconds (int, defaults to 1800) – Timeout for task results.

    • +
    • local_mode (bool, defaults to False) – Whether the started rpc server only listens to local +requests.

    • +
    +
    +
    +
    +
    launch(in_subprocess: bool = True) None[source]
    @@ -580,7 +760,7 @@
    diff --git a/en/agentscope.agents.operator.html b/en/agentscope.agents.operator.html new file mode 100644 index 000000000..dc18befdc --- /dev/null +++ b/en/agentscope.agents.operator.html @@ -0,0 +1,139 @@ + + + + + + + + agentscope.agents.operator — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.operator

    +

    A common base class for AgentBase and PipelineBase

    +
    +
    +class agentscope.agents.operator.Operator[source]
    +

    Bases: ABC

    +

    Abstract base class Operator defines a protocol for classes that +implement callable behavior. +The class is designed to be subclassed with an overridden __call__ +method that specifies the execution logic for the operator.

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.agents.react_agent.html b/en/agentscope.agents.react_agent.html new file mode 100644 index 000000000..121bb51b5 --- /dev/null +++ b/en/agentscope.agents.react_agent.html @@ -0,0 +1,219 @@ + + + + + + + + agentscope.agents.react_agent — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.react_agent

    +

    An agent class that implements the ReAct algorithm. The agent will reason +and act iteratively to solve problems. More details can be found in the paper +https://arxiv.org/abs/2210.03629.

    +
    +
    +class agentscope.agents.react_agent.ReActAgent(*args: tuple, **kwargs: dict)[source]
    +

    Bases: AgentBase

    +

    An agent class that implements the ReAct algorithm. More details refer +to https://arxiv.org/abs/2210.03629.

    +

    Note this is an example implementation of ReAct algorithm in AgentScope. +We follow the idea within the paper, but the detailed prompt engineering +maybe different. Developers are encouraged to modify the prompt to fit +their own needs.

    +
    +
    +__init__(name: str, model_config_name: str, tools: List[Tuple], sys_prompt: str = "You're a helpful assistant. Your name is {name}.", max_iters: int = 10, verbose: bool = True) None[source]
    +

    Initialize the ReAct agent with the given name, model config name +and tools.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • sys_prompt (str) – The system prompt of the agent.

    • +
    • model_config_name (str) – The name of the model config, which is used to load model from +configuration.

    • +
    • tools (List[Tuple]) – A list of tuples, each containing the name of a tool and the +tool’s description in JSON schema format.

    • +
    • max_iters (int, defaults to 10) – The maximum number of iterations of the reasoning-acting loops.

    • +
    • verbose (bool, defaults to True) – Whether to print the output of the tools.

    • +
    +
    +
    +
    + +
    +
    +reply(x: dict | None = None) dict[source]
    +

    The reply function that achieves the ReAct algorithm. +The more details please refer to https://arxiv.org/abs/2210.03629

    +
    + +
    +
    +execute_func(index: int, func_call: dict) dict[source]
    +

    Execute the tool function and return the result.

    +
    +
    Parameters:
    +
      +
    • index (int) – The index of the tool function.

    • +
    • func_call (dict) – The function call dictionary with keys ‘name’ and ‘arguments’.

    • +
    +
    +
    Returns:
    +

    The execution results.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +prepare_funcs_prompt(tools: List[Tuple]) Tuple[str, dict][source]
    +

    Convert function descriptions from json schema format to +string prompt format.

    +
    +
    Parameters:
    +

    tools (List[Tuple]) – The list of tool functions and their descriptions in JSON +schema format.

    +
    +
    Returns:
    +

    +
    The string prompt for the tool functions and a function name

    mapping dict.

    +
    +
    +
    {index}. {function name}: {function description}
    +    {argument name} ({argument type}): {argument description}
    +    ...
    +
    +
    +

    +
    +
    Return type:
    +

    Tuple[str, dict]

    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.agents.rpc_agent.html b/en/agentscope.agents.rpc_agent.html new file mode 100644 index 000000000..e9adbab2d --- /dev/null +++ b/en/agentscope.agents.rpc_agent.html @@ -0,0 +1,414 @@ + + + + + + + + agentscope.agents.rpc_agent — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.rpc_agent

    +

    Base class for Rpc Agent

    +
    +
    +agentscope.agents.rpc_agent.rpc_servicer_method(func)[source]
    +

    A decorator used to identify that the specific method is an rpc agent +servicer method, which can only be run in the rpc server process.

    +
    + +
    +
    +class agentscope.agents.rpc_agent.RpcAgent(*args: tuple, **kwargs: dict)[source]
    +

    Bases: AgentBase

    +

    A wrapper to extend an AgentBase into a gRPC Client.

    +
    +
    +__init__(name: str, agent_class: Type[AgentBase], agent_configs: dict | None = None, host: str = 'localhost', port: int | None = None, launch_server: bool = True, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, local_mode: bool = True, lazy_launch: bool = True, agent_id: str | None = None, create_with_agent_configs: bool = True) None[source]
    +

    Initialize a RpcAgent instance.

    +
    +
    Parameters:
    +
      +
    • name (str) – Name of the agent.

    • +
    • agent_class (Type[AgentBase]) – The AgentBase subclass encapsulated by this wrapper.

    • +
    • agent_configs (dict, defaults to None) – The args used to +initialize the agent_class.

    • +
    • host (str, defaults to “localhost”) – Hostname of the rpc agent server.

    • +
    • port (int, defaults to None) – Port of the rpc agent server.

    • +
    • launch_server (bool, defaults to True) – Whether to launch the gRPC agent server.

    • +
    • max_pool_size (int, defaults to 8192) – Max number of task results that the server can accommodate.

    • +
    • max_timeout_seconds (int, defaults to 1800) – Timeout for task results.

    • +
    • local_mode (bool, defaults to True) – Whether the started gRPC server only listens to local +requests.

    • +
    • lazy_launch (bool, defaults to True) – Only launch the server when the agent is called.

    • +
    • agent_id (str, defaults to None) – The agent id of this instance. If None, it will +be generated randomly.

    • +
    • create_with_agent_configs (bool, defaults to True) – Only takes effect when agent_configs is provided. +If true, create the agent instance for the agent with +provided agent_configs, otherwise uses the agent server’s +default parameters.

    • +
    +
    +
    +
    + +
    +
    +reply(x: dict | None = None) dict[source]
    +

    Define the actions taken by this agent.

    +
    +
    Parameters:
    +

    x (dict, defaults to None) – Dialog history and some environment information

    +
    +
    Returns:
    +

    The agent’s response to the input.

    +
    +
    +
    +

    Note

    +

    Given that some agents are in an adversarial environment, +their input doesn’t include the thoughts of other agents.

    +
    +
    + +
    +
    +observe(x: dict | Sequence[dict]) None[source]
    +

    Observe the input, store it in memory without response to it.

    +
    +
    Parameters:
    +

    x (Union[dict, Sequence[dict]]) – The input message to be recorded in memory.

    +
    +
    +
    + +
    +
    +clone_instances(num_instances: int, including_self: bool = True) Sequence[AgentBase][source]
    +

    Clone a series of this instance with different agent_id and +return them as a list.

    +
    +
    Parameters:
    +
      +
    • num_instances (int) – The number of instances in the returned

    • +
    • list. (this method in the returned)

    • +
    • including_self (bool) – Whether to include the instance calling

    • +
    • list.

    • +
    +
    +
    Returns:
    +

    A list of agent instances.

    +
    +
    Return type:
    +

    Sequence[AgentBase]

    +
    +
    +
    + +
    +
    +stop() None[source]
    +

    Stop the RpcAgent and the rpc server.

    +
    + +
    + +
    +
    +agentscope.agents.rpc_agent.setup_rpc_agent_server(agent_class: Type[AgentBase], agent_args: tuple, agent_kwargs: dict, host: str, port: int, init_settings: dict | None = None, start_event: Event | None = None, stop_event: Event | None = None, pipe: int | None = None, local_mode: bool = True, max_pool_size: int = 8192, max_timeout_seconds: int = 1800) None[source]
    +

    Setup gRPC server rpc agent.

    +
    +
    Parameters:
    +
      +
    • agent_class (Type[AgentBase]) – A subclass of AgentBase.

    • +
    • agent_args (tuple) – The args tuple used to initialize the +agent_class.

    • +
    • agent_kwargs (dict) – The args dict used to initialize the +agent_class.

    • +
    • host (str, defaults to “localhost”) – Hostname of the rpc agent server.

    • +
    • port (int) – The socket port monitored by grpc server.

    • +
    • init_settings (dict, defaults to None) – Init settings for agentscope.init.

    • +
    • start_event (EventClass, defaults to None) – An Event instance used to determine whether the child process +has been started.

    • +
    • stop_event (EventClass, defaults to None) – The stop Event instance used to determine whether the child +process has been stopped.

    • +
    • pipe (int, defaults to None) – A pipe instance used to pass the actual port of the server.

    • +
    • local_mode (bool, defaults to None) – Only listen to local requests.

    • +
    • max_pool_size (int, defaults to 8192) – Max number of task results that the server can accommodate.

    • +
    • max_timeout_seconds (int, defaults to 1800) – Timeout for task results.

    • +
    +
    +
    +
    + +
    +
    +agentscope.agents.rpc_agent.find_available_port() int[source]
    +

    Get an unoccupied socket port number.

    +
    + +
    +
    +agentscope.agents.rpc_agent.check_port(port: int | None = None) int[source]
    +

    Check if the port is available.

    +
    +
    Parameters:
    +

    port (int) – the port number being checked.

    +
    +
    Returns:
    +

    the port number that passed the check. If the port is found +to be occupied, an available port number will be automatically +returned.

    +
    +
    Return type:
    +

    int

    +
    +
    +
    + +
    +
    +class agentscope.agents.rpc_agent.RpcAgentServerLauncher(agent_class: Type[AgentBase] | None = None, agent_args: tuple = (), agent_kwargs: dict | None = None, host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, local_mode: bool = False)[source]
    +

    Bases: object

    +

    Launcher of rpc agent server.

    +
    +
    +__init__(agent_class: Type[AgentBase] | None = None, agent_args: tuple = (), agent_kwargs: dict | None = None, host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800, local_mode: bool = False) None[source]
    +

    Init a rpc agent server launcher.

    +
    +
    Parameters:
    +
      +
    • agent_class (Type[AgentBase], defaults to None) – The AgentBase subclass encapsulated by this wrapper.

    • +
    • agent_args (tuple) – The args tuple used to initialize the +agent_class.

    • +
    • agent_kwargs (dict) – The args dict used to initialize the +agent_class.

    • +
    • host (str, defaults to “localhost”) – Hostname of the rpc agent server.

    • +
    • port (int, defaults to None) – Port of the rpc agent server.

    • +
    • max_pool_size (int, defaults to 8192) – Max number of task results that the server can accommodate.

    • +
    • max_timeout_seconds (int, defaults to 1800) – Timeout for task results.

    • +
    • local_mode (bool, defaults to False) – Whether the started rpc server only listens to local +requests.

    • +
    +
    +
    +
    + +
    +
    +launch(in_subprocess: bool = True) None[source]
    +

    launch a rpc agent server.

    +
    +
    Parameters:
    +

    in_subprocess (bool, optional) – launch the server in subprocess. +Defaults to True. For agents that need to obtain command line +input, such as UserAgent, please set this value to False.

    +
    +
    +
    + +
    +
    +wait_until_terminate() None[source]
    +

    Wait for server process

    +
    + +
    +
    +shutdown() None[source]
    +

    Shutdown the rpc agent server.

    +
    + +
    + +
    +
    +class agentscope.agents.rpc_agent.RpcServerSideWrapper(agent_class: Type[AgentBase], agent_args: tuple, agent_kwargs: dict, host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800)[source]
    +

    Bases: RpcAgentServicer

    +

    A wrapper to extend an AgentBase into a gRPC Servicer.

    +
    +
    +__init__(agent_class: Type[AgentBase], agent_args: tuple, agent_kwargs: dict, host: str = 'localhost', port: int | None = None, max_pool_size: int = 8192, max_timeout_seconds: int = 1800)[source]
    +

    Init the service side wrapper.

    +
    +
    Parameters:
    +
      +
    • agent_class (Type[AgentBase]) – The AgentBase subclass +encapsulated by this wrapper.

    • +
    • agent_args (tuple) – The args tuple used to initialize the +agent_class.

    • +
    • agent_kwargs (dict) – The args dict used to initialize the +agent_class.

    • +
    • host (str, defaults to “localhost”) – Hostname of the rpc agent server.

    • +
    • port (int, defaults to None) – Port of the rpc agent server.

    • +
    • max_pool_size (int, defaults to 8192) – The max number of task results that the server can +accommodate. Note that the oldest result will be deleted +after exceeding the pool size.

    • +
    • max_timeout_seconds (int, defaults to 1800) – Timeout for task results. Note that expired results will be +deleted.

    • +
    +
    +
    +
    + +
    +
    +get_task_id() int[source]
    +

    Get the auto-increment task id.

    +
    + +
    +
    +check_and_generate_agent(agent_id: str, agent_configs: dict | None = None) None[source]
    +

    Check whether the agent exists, and create new agent instance +for new agent.

    +
    +
    Parameters:
    +

    agent_id (str) – the agent id.

    +
    +
    +
    + +
    +
    +check_and_delete_agent(agent_id: str) None[source]
    +

    Check whether the agent exists, and delete the agent instance +for the agent_id.

    +
    +
    Parameters:
    +

    agent_id (str) – the agent id.

    +
    +
    +
    + +
    +
    +call_func(request: RpcMsg, _: ServicerContext) RpcMsg[source]
    +

    Call the specific servicer function.

    +
    + +
    +
    +process_messages(task_id: int, agent_id: str, task_msg: dict | None = None) None[source]
    +

    Task processing.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.agents.text_to_image_agent.html b/en/agentscope.agents.text_to_image_agent.html new file mode 100644 index 000000000..751f1dfeb --- /dev/null +++ b/en/agentscope.agents.text_to_image_agent.html @@ -0,0 +1,173 @@ + + + + + + + + agentscope.agents.text_to_image_agent — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.text_to_image_agent

    +

    An agent that convert text to image.

    +
    +
    +class agentscope.agents.text_to_image_agent.TextToImageAgent(*args: tuple, **kwargs: dict)[source]
    +

    Bases: AgentBase

    +

    A agent used to perform text to image tasks.

    +

    TODO: change the agent into a service.

    +
    +
    +__init__(name: str, model_config_name: str, use_memory: bool = True, memory_config: dict | None = None) None[source]
    +

    Initialize the text to image agent.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of the agent.

    • +
    • model_config_name (str, defaults to None) – The name of the model config, which is used to load model from +configuration.

    • +
    • use_memory (bool, defaults to True) – Whether the agent has memory.

    • +
    • memory_config (Optional[dict]) – The config of memory.

    • +
    +
    +
    +
    + +
    +
    +reply(x: dict | None = None) dict[source]
    +

    Define the actions taken by this agent.

    +
    +
    Parameters:
    +

    x (dict, defaults to None) – Dialog history and some environment information

    +
    +
    Returns:
    +

    The agent’s response to the input.

    +
    +
    +
    +

    Note

    +

    Given that some agents are in an adversarial environment, +their input doesn’t include the thoughts of other agents.

    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.agents.user_agent.html b/en/agentscope.agents.user_agent.html new file mode 100644 index 000000000..6075acb5f --- /dev/null +++ b/en/agentscope.agents.user_agent.html @@ -0,0 +1,190 @@ + + + + + + + + agentscope.agents.user_agent — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.agents.user_agent

    +

    User Agent class

    +
    +
    +class agentscope.agents.user_agent.UserAgent(*args: tuple, **kwargs: dict)[source]
    +

    Bases: AgentBase

    +

    User agent class

    +
    +
    +__init__(name: str = 'User', require_url: bool = False) None[source]
    +

    Initialize a UserAgent object.

    +
    +
    Parameters:
    +
      +
    • name (str, defaults to “User”) – The name of the agent. Defaults to “User”.

    • +
    • require_url (bool, defaults to False) – Whether the agent requires user to input a URL. Defaults to +False. The URL can lead to a website, a file, +or a directory. It will be added into the generated message +in field url.

    • +
    +
    +
    +
    + +
    +
    +reply(x: dict | None = None, required_keys: list[str] | str | None = None, timeout: int | None = None) dict[source]
    +

    Processes the input provided by the user and stores it in memory, +potentially formatting it with additional provided details.

    +

    The method prompts the user for input, then optionally prompts for +additional specifics based on the provided format keys. All +information is encapsulated in a message object, which is then +added to the object’s memory.

    +
    +
    Parameters:
    +
      +
    • x (dict, defaults to None) – A dictionary containing initial data to be added to memory. +Defaults to None.

    • +
    • required_keys (Optional[Union[list[str], str]], defaults to None) – Strings that requires user to input, which will be used as +the key of the returned dict. Defaults to None.

    • +
    • timeout (Optional[int], defaults to None) – Raise TimeoutError if user exceed input time, set to None +for no limit.

    • +
    +
    +
    Returns:
    +

    A dictionary representing the message object that contains +the user’s input and any additional details. This is also +stored in the object’s memory.

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +speak(content: str | dict) None[source]
    +

    Speak the content to the audience.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.constants.html b/en/agentscope.constants.html new file mode 100644 index 000000000..bf9863774 --- /dev/null +++ b/en/agentscope.constants.html @@ -0,0 +1,163 @@ + + + + + + + + agentscope.constants — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.constants

    +

    Some constants used in the project

    +
    +
    +class agentscope.constants.ResponseFormat(value)[source]
    +

    Bases: IntEnum

    +

    Enum for model response format.

    +
    +
    +NONE = 0
    +
    + +
    +
    +JSON = 1
    +
    + +
    + +
    +
    +class agentscope.constants.ShrinkPolicy(value)[source]
    +

    Bases: IntEnum

    +

    Enum for shrink strategies when the prompt is too long.

    +
    +
    +TRUNCATE = 0
    +
    + +
    +
    +SUMMARIZE = 1
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.file_manager.html b/en/agentscope.file_manager.html new file mode 100644 index 000000000..4d4aeaafb --- /dev/null +++ b/en/agentscope.file_manager.html @@ -0,0 +1,129 @@ + + + + + + + + agentscope.file_manager — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.file_manager

    +

    Manage the file system for saving files, code and logs.

    +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.html b/en/agentscope.html index ad274a6d3..6d0cabad6 100644 --- a/en/agentscope.html +++ b/en/agentscope.html @@ -23,7 +23,8 @@ - + + @@ -57,19 +58,21 @@

    AgentScope API Reference

    @@ -101,7 +104,7 @@

    Import all modules in the package.

    -agentscope.init(model_configs: dict | str | list | None = None, project: str | None = None, name: str | None = None, save_dir: str = './runs', save_log: bool = True, save_code: bool = True, save_api_invoke: bool = True, logger_level: Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO', agent_configs: dict | str | list | None = None) Sequence[AgentBase][source]
    +agentscope.init(model_configs: dict | str | list | None = None, project: str | None = None, name: str | None = None, save_dir: str = './runs', save_log: bool = True, save_code: bool = True, save_api_invoke: bool = True, logger_level: Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO', agent_configs: dict | str | list | None = None) Sequence[AgentBase][source]

    A unified entry to initialize the package, including model configs, runtime names, saving directories and logging settings.

    @@ -130,7 +133,7 @@
    -agentscope.msghub(participants: Sequence[AgentBase], announcement: Sequence[dict] | dict | None = None) MsgHubManager[source]
    +agentscope.msghub(participants: Sequence[AgentBase], announcement: Sequence[dict] | dict | None = None) MsgHubManager[source]

    msghub is used to share messages among a group of agents.

    Parameters:
    @@ -169,7 +172,8 @@
    @@ -105,6 +107,17 @@ class agentscope.memory.MemoryBase(config: dict | None = None)[source]

    Bases: ABC

    Base class for memory.

    +
    +
    +__init__(config: dict | None = None) None[source]
    +

    MemoryBase is a base class for memory of agents.

    +
    +
    Parameters:
    +

    config (Optional[dict], defaults to None) – Configuration of this memory.

    +
    +
    +
    +
    update_config(config: dict) None[source]
    @@ -161,8 +174,19 @@
    class agentscope.memory.TemporaryMemory(config: dict | None = None, embedding_model: str | Callable | None = None)[source]
    -

    Bases: MemoryBase

    +

    Bases: MemoryBase

    In-memory memory module, not writing to hard disk

    +
    +
    +__init__(config: dict | None = None, embedding_model: str | Callable | None = None) None[source]
    +

    MemoryBase is a base class for memory of agents.

    +
    +
    Parameters:
    +

    config (Optional[dict], defaults to None) – Configuration of this memory.

    +
    +
    +
    +
    add(memories: Sequence[dict] | dict | None, embed: bool = False) None[source]
    @@ -275,7 +299,7 @@

    diff --git a/en/agentscope.memory.memory.html b/en/agentscope.memory.memory.html new file mode 100644 index 000000000..9a24ef61d --- /dev/null +++ b/en/agentscope.memory.memory.html @@ -0,0 +1,200 @@ + + + + + + + + agentscope.memory.memory — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.memory.memory

    +

    Base class for memory

    +

    TODO: a abstract class for a piece of memory +TODO: data structure to organize multiple memory pieces in memory class

    +
    +
    +class agentscope.memory.memory.MemoryBase(config: dict | None = None)[source]
    +

    Bases: ABC

    +

    Base class for memory.

    +
    +
    +__init__(config: dict | None = None) None[source]
    +

    MemoryBase is a base class for memory of agents.

    +
    +
    Parameters:
    +

    config (Optional[dict], defaults to None) – Configuration of this memory.

    +
    +
    +
    + +
    +
    +update_config(config: dict) None[source]
    +

    Configure memory as specified in config

    +
    + +
    +
    +abstract get_memory(recent_n: int | None = None, filter_func: Callable[[int, dict], bool] | None = None) list[source]
    +

    Return a certain range (recent_n or all) of memory, filtered by +filter_func

    +
    + +
    +
    +abstract add(memories: list[dict] | dict | None) None[source]
    +

    Adding new memory fragment, depending on how the memory are stored

    +
    + +
    +
    +abstract delete(index: Iterable | int) None[source]
    +

    Delete memory fragment, depending on how the memory are stored +and matched

    +
    + +
    +
    +abstract load(memories: str | dict | list, overwrite: bool = False) None[source]
    +

    Load memory, depending on how the memory are passed, design to load +from both file or dict

    +
    + +
    +
    +abstract export(to_mem: bool = False, file_path: str | None = None) list | None[source]
    +

    Export memory, depending on how the memory are stored

    +
    + +
    +
    +abstract clear() None[source]
    +

    Clean memory, depending on how the memory are stored

    +
    + +
    +
    +abstract size() int[source]
    +

    Returns the number of memory segments in memory.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.memory.temporary_memory.html b/en/agentscope.memory.temporary_memory.html new file mode 100644 index 000000000..e5814b096 --- /dev/null +++ b/en/agentscope.memory.temporary_memory.html @@ -0,0 +1,250 @@ + + + + + + + + agentscope.memory.temporary_memory — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.memory.temporary_memory

    +

    Memory module for conversation

    +
    +
    +class agentscope.memory.temporary_memory.TemporaryMemory(config: dict | None = None, embedding_model: str | Callable | None = None)[source]
    +

    Bases: MemoryBase

    +

    In-memory memory module, not writing to hard disk

    +
    +
    +__init__(config: dict | None = None, embedding_model: str | Callable | None = None) None[source]
    +

    MemoryBase is a base class for memory of agents.

    +
    +
    Parameters:
    +

    config (Optional[dict], defaults to None) – Configuration of this memory.

    +
    +
    +
    + +
    +
    +add(memories: Sequence[dict] | dict | None, embed: bool = False) None[source]
    +

    Adding new memory fragment, depending on how the memory are stored

    +
    + +
    +
    +delete(index: Iterable | int) None[source]
    +

    Delete memory fragment, depending on how the memory are stored +and matched

    +
    + +
    +
    +export(to_mem: bool = False, file_path: str | None = None) list | None[source]
    +

    Export memory to json file

    +
    + +
    +
    +load(memories: str | dict | list, overwrite: bool = False) None[source]
    +

    Load memory, depending on how the memory are passed, design to load +from both file or dict

    +
    + +
    +
    +clear() None[source]
    +

    Clean memory, depending on how the memory are stored

    +
    + +
    +
    +size() int[source]
    +

    Returns the number of memory segments in memory.

    +
    + +
    +
    +retrieve_by_embedding(query: str | list[Number], metric: Callable[[list[Number], list[Number]], float], top_k: int = 1, preserve_order: bool = True, embedding_model: Callable[[str | dict], list[Number]] | None = None) list[dict][source]
    +

    Retrieve memory by their embeddings.

    +
    +
    Parameters:
    +
      +
    • query (Union[str, Embedding]) – Query string or embedding.

    • +
    • metric (Callable[[Embedding, Embedding], float]) – A metric to compute the relevance between embeddings of query +and memory. In default, higher relevance means better match, +and you can set reverse to True to reverse the order.

    • +
    • top_k (int, defaults to 1) – The number of memory units to retrieve.

    • +
    • preserve_order (bool, defaults to True) – Whether to preserve the original order of the retrieved memory +units.

    • +
    • embedding_model (Callable[[Union[str, dict]], Embedding], defaults to None) – A callable object to embed the memory unit. If not provided, it +will use the default embedding model.

    • +
    +
    +
    Returns:
    +

    a list of retrieved memory units in +specific order.

    +
    +
    Return type:
    +

    list[dict]

    +
    +
    +
    + +
    +
    +get_embeddings(embedding_model: Callable[[str | dict], list[Number]] | None = None) list[source]
    +

    Get embeddings of all memory units. If embedding_model is +provided, the memory units that doesn’t have embedding attribute +will be embedded. Otherwise, its embedding will be None.

    +
    +
    Parameters:
    +

    embedding_model – (Callable[[Union[str, dict]], Embedding], defaults to +None): +Embedding model or embedding vector.

    +
    +
    Returns:
    +

    List of embeddings or None.

    +
    +
    Return type:
    +

    list[Union[Embedding, None]]

    +
    +
    +
    + +
    +
    +get_memory(recent_n: int | None = None, filter_func: Callable[[int, dict], bool] | None = None) list[source]
    +

    Retrieve memory.

    +
    +
    Parameters:
    +
      +
    • recent_n (Optional[int], default None) – The last number of memories to return.

    • +
    • filter_func – (Callable[[int, dict], bool], default to None): +The function to filter memories, which take the index and +memory unit as input, and return a boolean value.

    • +
    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.message.html b/en/agentscope.message.html new file mode 100644 index 000000000..6bdf6ac71 --- /dev/null +++ b/en/agentscope.message.html @@ -0,0 +1,375 @@ + + + + + + + + agentscope.message — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.message

    +

    The base class for message unit

    +
    +
    +class agentscope.message.MessageBase(name: str, content: Any, role: Literal['user', 'system', 'assistant'] = 'assistant', url: Sequence[str] | str | None = None, timestamp: str | None = None, **kwargs: Any)[source]
    +

    Bases: dict

    +

    Base Message class, which is used to maintain information for dialog, +memory and used to construct prompt.

    +
    +
    +__init__(name: str, content: Any, role: Literal['user', 'system', 'assistant'] = 'assistant', url: Sequence[str] | str | None = None, timestamp: str | None = None, **kwargs: Any) None[source]
    +

    Initialize the message object

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of who send the message. It’s often used in +role-playing scenario to tell the name of the sender.

    • +
    • content (Any) – The content of the message.

    • +
    • role (Literal[“system”, “user”, “assistant”], defaults to “assistant”) – The role of who send the message. It can be one of the +“system”, “user”, or “assistant”. Default to +“assistant”.

    • +
    • url (Optional[Union[list[str], str]], defaults to None) – A url to file, image, video, audio or website.

    • +
    • timestamp (Optional[str], defaults to None) – The timestamp of the message, if None, it will be set to +current time.

    • +
    • **kwargs (Any) – Other attributes of the message.

    • +
    +
    +
    +
    + +
    +
    +to_str() str[source]
    +

    Return the string representation of the message

    +
    + +
    +
    +serialize() str[source]
    +

    Return the serialized message.

    +
    + +
    + +
    +
    +class agentscope.message.Msg(name: str, content: Any, role: Literal['system', 'user', 'assistant'] | None = None, url: Sequence[str] | str | None = None, timestamp: str | None = None, echo: bool = False, **kwargs: Any)[source]
    +

    Bases: MessageBase

    +

    The Message class.

    +
    +
    +__init__(name: str, content: Any, role: Literal['system', 'user', 'assistant'] | None = None, url: Sequence[str] | str | None = None, timestamp: str | None = None, echo: bool = False, **kwargs: Any) None[source]
    +

    Initialize the message object

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of who send the message.

    • +
    • content (Any) – The content of the message.

    • +
    • role (Literal[“system”, “user”, “assistant”]) – Used to identify the source of the message, e.g. the system +information, the user input, or the model response. This +argument is used to accommodate most Chat API formats.

    • +
    • url (Optional[Union[list[str], str]], defaults to None) – A url to file, image, video, audio or website.

    • +
    • timestamp (Optional[str], defaults to None) – The timestamp of the message, if None, it will be set to +current time.

    • +
    • **kwargs (Any) – Other attributes of the message.

    • +
    +
    +
    +
    + +
    +
    +to_str() str[source]
    +

    Return the string representation of the message

    +
    + +
    +
    +serialize() str[source]
    +

    Return the serialized message.

    +
    + +
    + +
    +
    +class agentscope.message.Tht(content: Any, timestamp: str | None = None)[source]
    +

    Bases: MessageBase

    +

    The Thought message is used to record the thought of the agent to +help them make decisions and responses. Generally, it shouldn’t be +passed to or seen by the other agents.

    +

    In our framework, we formulate the thought in prompt as follows: +- For OpenAI API calling:

    +
    [
    +    ...
    +    {
    +        "role": "assistant",
    +        "name": "thought",
    +        "content": "I should ..."
    +    },
    +    ...
    +]
    +
    +
    +
      +
    • For open-source models that accepts string as input:

    • +
    +
    ...
    +{self.name} thought: I should ...
    +...
    +
    +
    +

    We admit that there maybe better ways to formulate the thought. Users +are encouraged to create their own thought formulation methods by +inheriting MessageBase class and rewrite the __init__ and to_str +function.

    +
    class MyThought(MessageBase):
    +    def to_str(self) -> str:
    +        # implement your own thought formulation method
    +        pass
    +
    +
    +
    +
    +__init__(content: Any, timestamp: str | None = None) None[source]
    +

    Initialize the message object

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of who send the message. It’s often used in +role-playing scenario to tell the name of the sender.

    • +
    • content (Any) – The content of the message.

    • +
    • role (Literal[“system”, “user”, “assistant”], defaults to “assistant”) – The role of who send the message. It can be one of the +“system”, “user”, or “assistant”. Default to +“assistant”.

    • +
    • url (Optional[Union[list[str], str]], defaults to None) – A url to file, image, video, audio or website.

    • +
    • timestamp (Optional[str], defaults to None) – The timestamp of the message, if None, it will be set to +current time.

    • +
    • **kwargs (Any) – Other attributes of the message.

    • +
    +
    +
    +
    + +
    +
    +to_str() str[source]
    +

    Return the string representation of the message

    +
    + +
    +
    +serialize() str[source]
    +

    Return the serialized message.

    +
    + +
    + +
    +
    +class agentscope.message.PlaceholderMessage(name: str, content: Any, url: Sequence[str] | str | None = None, timestamp: str | None = None, host: str | None = None, port: int | None = None, task_id: int | None = None, client: RpcAgentClient | None = None, x: dict | None = None, **kwargs: Any)[source]
    +

    Bases: MessageBase

    +

    A placeholder for the return message of RpcAgent.

    +
    +
    +PLACEHOLDER_ATTRS = {'_client', '_host', '_is_placeholder', '_port', '_stub', '_task_id'}
    +
    + +
    +
    +LOCAL_ATTRS = {'_client', '_host', '_is_placeholder', '_port', '_stub', '_task_id', 'name', 'timestamp'}
    +
    + +
    +
    +__init__(name: str, content: Any, url: Sequence[str] | str | None = None, timestamp: str | None = None, host: str | None = None, port: int | None = None, task_id: int | None = None, client: RpcAgentClient | None = None, x: dict | None = None, **kwargs: Any) None[source]
    +

    A placeholder message, records the address of the real message.

    +
    +
    Parameters:
    +
      +
    • name (str) – The name of who send the message. It’s often used in +role-playing scenario to tell the name of the sender. +However, you can also only use role when calling openai api. +The usage of name refers to +https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models.

    • +
    • content (Any) – The content of the message.

    • +
    • role (Literal[“system”, “user”, “assistant”], defaults to “assistant”) – The role of the message, which can be one of the “system”, +“user”, or “assistant”.

    • +
    • url (Optional[Union[list[str], str]], defaults to None) – A url to file, image, video, audio or website.

    • +
    • timestamp (Optional[str], defaults to None) – The timestamp of the message, if None, it will be set to +current time.

    • +
    • host (str, defaults to None) – The hostname of the rpc server where the real message is +located.

    • +
    • port (int, defaults to None) – The port of the rpc server where the real message is located.

    • +
    • task_id (int, defaults to None) – The task id of the real message in the rpc server.

    • +
    • client (RpcAgentClient, defaults to None) – An RpcAgentClient instance used to connect to the generator of +this placeholder.

    • +
    • x (dict, defaults to None) – Input parameters used to call rpc methods on the client.

    • +
    +
    +
    +
    + +
    +
    +to_str() str[source]
    +

    Return the string representation of the message

    +
    + +
    +
    +update_value() MessageBase[source]
    +

    Get attribute values from rpc agent server immediately

    +
    + +
    +
    +serialize() str[source]
    +

    Return the serialized message.

    +
    + +
    + +
    +
    +agentscope.message.deserialize(s: str) MessageBase | Sequence[source]
    +

    Deserialize json string into MessageBase

    +
    + +
    +
    +agentscope.message.serialize(messages: Sequence[MessageBase] | MessageBase) str[source]
    +

    Serialize multiple MessageBase instance

    +
    + +
    + + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.config.html b/en/agentscope.models.config.html new file mode 100644 index 000000000..c20daf317 --- /dev/null +++ b/en/agentscope.models.config.html @@ -0,0 +1,129 @@ + + + + + + + + agentscope.models.config — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.config

    +

    The model config.

    +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.dashscope_model.html b/en/agentscope.models.dashscope_model.html new file mode 100644 index 000000000..41e9ab42d --- /dev/null +++ b/en/agentscope.models.dashscope_model.html @@ -0,0 +1,436 @@ + + + + + + + + agentscope.models.dashscope_model — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.dashscope_model

    +

    Model wrapper for DashScope models

    +
    +
    +class agentscope.models.dashscope_model.DashScopeWrapperBase(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    +

    Bases: ModelWrapperBase, ABC

    +

    The model wrapper for DashScope API.

    +
    +
    +__init__(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any) None[source]
    +

    Initialize the DashScope wrapper.

    +
    +
    Parameters:
    +
      +
    • config_name (str) – The name of the model config.

    • +
    • model_name (str, default None) – The name of the model to use in DashScope API.

    • +
    • api_key (str, default None) – The API key for DashScope API.

    • +
    • generate_args (dict, default None) – The extra keyword arguments used in DashScope api generation, +e.g. temperature, seed.

    • +
    +
    +
    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +

    Format the input string or dict into the format that the model +API required.

    +
    + +
    + +
    +
    +class agentscope.models.dashscope_model.DashScopeChatWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    +

    Bases: DashScopeWrapperBase

    +

    The model wrapper for DashScope’s chat API, refer to +https://help.aliyun.com/zh/dashscope/developer-reference/api-details

    +
    +
    +model_type: str = 'dashscope_chat'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +deprecated_model_type: str = 'tongyi_chat'
    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[source]
    +

    Format the messages for DashScope Chat API.

    +

    In this format function, the input messages are formatted into a +single system messages with format “{name}: {content}” for each +message. Note this strategy maybe not suitable for all scenarios, +and developers are encouraged to implement their own prompt +engineering strategies.

    +

    The following is an example:

    +
    prompt = model.format(
    +    Msg("system", "You're a helpful assistant", role="system"),
    +    Msg("Bob", "Hi, how can I help you?", role="assistant"),
    +    Msg("user", "What's the date today?", role="user")
    +)
    +
    +
    +

    The prompt will be as follows:

    +
    [
    +    {
    +        "role": "system",
    +        "content": "You're a helpful assistant",
    +    }
    +    {
    +        "role": "user",
    +        "content": (
    +            "## Dialogue History\n"
    +            "Bob: Hi, how can I help you?\n"
    +            "user: What's the date today?"
    +        )
    +    }
    +]
    +
    +
    +
    +
    Parameters:
    +

    args (Union[MessageBase, Sequence[MessageBase]]) – The input arguments to be formatted, where each argument +should be a Msg object, or a list of Msg objects. +In distribution, placeholder is also allowed.

    +
    +
    Returns:
    +

    The formatted messages.

    +
    +
    Return type:
    +

    List[dict]

    +
    +
    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.dashscope_model.DashScopeImageSynthesisWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    +

    Bases: DashScopeWrapperBase

    +

    The model wrapper for DashScope Image Synthesis API, refer to +https://help.aliyun.com/zh/dashscope/developer-reference/quick-start-1

    +
    +
    +model_type: str = 'dashscope_image_synthesis'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.dashscope_model.DashScopeTextEmbeddingWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    +

    Bases: DashScopeWrapperBase

    +

    The model wrapper for DashScope Text Embedding API.

    +
    +
    +model_type: str = 'dashscope_text_embedding'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.dashscope_model.DashScopeMultiModalWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    +

    Bases: DashScopeWrapperBase

    +

    The model wrapper for DashScope Multimodal API, refer to +https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-api

    +
    +
    +model_type: str = 'dashscope_multimodal'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[source]
    +

    Format the messages for DashScope Multimodal API.

    +

    The multimodal API has the following requirements:

    +
    +
      +
    • +
      The roles of messages must alternate between “user” and

      “assistant”.

      +
      +
      +
    • +
    • +
      The message with the role “system” should be the first message

      in the list.

      +
      +
      +
    • +
    • +
      If the system message exists, then the second message must

      have the role “user”.

      +
      +
      +
    • +
    • The last message in the list should have the role “user”.

    • +
    • In each message, more than one figure is allowed.

    • +
    +
    +

    With the above requirements, we format the messages as follows:

    +
    +
      +
    • +
      If the first message is a system message, then we will keep it as

      system prompt.

      +
      +
      +
    • +
    • +
      We merge all messages into a dialogue history prompt in a single

      message with the role “user”.

      +
      +
      +
    • +
    • +
      When there are multiple figures in the given messages, we will

      attach it to the user message by order. Note if there are +multiple figures, this strategy may cause misunderstanding for +the model. For advanced solutions, developers are encouraged to +implement their own prompt engineering strategies.

      +
      +
      +
    • +
    +
    +

    The following is an example:

    +
    prompt = model.format(
    +    Msg(
    +        "system",
    +        "You're a helpful assistant",
    +        role="system", url="figure1"
    +    ),
    +    Msg(
    +        "Bob",
    +        "How about this picture?",
    +        role="assistant", url="figure2"
    +    ),
    +    Msg(
    +        "user",
    +        "It's wonderful! How about mine?",
    +        role="user", image="figure3"
    +    )
    +)
    +
    +
    +

    The prompt will be as follows:

    +
    [
    +    {
    +        "role": "system",
    +        "content": [
    +            {"text": "You are a helpful assistant"},
    +            {"image": "figure1"}
    +        ]
    +    },
    +    {
    +        "role": "user",
    +        "content": [
    +            {"image": "figure2"},
    +            {"image": "figure3"},
    +            {
    +                "text": (
    +                    "## Dialogue History\n"
    +                    "Bob: How about this picture?\n"
    +                    "user: It's wonderful! How about mine?"
    +                )
    +            },
    +        ]
    +    }
    +]
    +
    +
    +
    +

    Note

    +

    In multimodal API, the url of local files should be prefixed with +“file://”, which will be attached in this format function.

    +
    +
    +
    Parameters:
    +

    args (Union[MessageBase, Sequence[MessageBase]]) – The input arguments to be formatted, where each argument +should be a Msg object, or a list of Msg objects. +In distribution, placeholder is also allowed.

    +
    +
    Returns:
    +

    The formatted messages.

    +
    +
    Return type:
    +

    List[dict]

    +
    +
    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.gemini_model.html b/en/agentscope.models.gemini_model.html new file mode 100644 index 000000000..4b0764a3f --- /dev/null +++ b/en/agentscope.models.gemini_model.html @@ -0,0 +1,267 @@ + + + + + + + + agentscope.models.gemini_model — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.gemini_model

    +

    Google Gemini model wrapper.

    +
    +
    +class agentscope.models.gemini_model.GeminiWrapperBase(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any)[source]
    +

    Bases: ModelWrapperBase, ABC

    +

    The base class for Google Gemini model wrapper.

    +
    +
    +__init__(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any) None[source]
    +

    Initialize the wrapper for Google Gemini model.

    +
    +
    Parameters:
    +
      +
    • model_name (str) – The name of the model.

    • +
    • api_key (str, defaults to None) – The api_key for the model. If it is not provided, it will be +loaded from environment variable.

    • +
    +
    +
    +
    + +
    +
    +list_models() Sequence[source]
    +

    List all available models for this API calling.

    +
    + +
    + +
    +
    +class agentscope.models.gemini_model.GeminiChatWrapper(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any)[source]
    +

    Bases: GeminiWrapperBase

    +

    The wrapper for Google Gemini chat model, e.g. gemini-pro

    +
    +
    +model_type: str = 'gemini_chat'
    +

    The type of the model, which is used in model configuration.

    +
    + +
    +
    +generation_method = 'generateContent'
    +

    The generation method used in __call__ function.

    +
    + +
    +
    +__init__(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any) None[source]
    +

    Initialize the wrapper for Google Gemini model.

    +
    +
    Parameters:
    +
      +
    • model_name (str) – The name of the model.

    • +
    • api_key (str, defaults to None) – The api_key for the model. If it is not provided, it will be +loaded from environment variable.

    • +
    +
    +
    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +

    This function provide a basic prompting strategy for Gemini Chat +API in multi-party conversation, which combines all input into a +single string, and wrap it into a user message.

    +

    We make the above decision based on the following constraints of the +Gemini generate API:

    +

    1. In Gemini generate_content API, the role field must be either +user or model.

    +

    2. If we pass a list of messages to the generate_content API, +the user role must speak in the beginning and end of the +messages, and user and model must alternative. This prevents +us to build a multi-party conversations, where model may keep +speaking in different names.

    +

    The above information is updated to 2024/03/21. More information +about the Gemini generate_content API can be found in +https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini

    +

    Based on the above considerations, we decide to combine all messages +into a single user message. This is a simple and straightforward +strategy, if you have any better ideas, pull request and +discussion are welcome in our GitHub repository +https://github.com/agentscope/agentscope!

    +
    +
    Parameters:
    +

    args (Union[MessageBase, Sequence[MessageBase]]) – The input arguments to be formatted, where each argument +should be a Msg object, or a list of Msg objects. +In distribution, placeholder is also allowed.

    +
    +
    Returns:
    +

    A list with one user message.

    +
    +
    Return type:
    +

    List[dict]

    +
    +
    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.gemini_model.GeminiEmbeddingWrapper(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any)[source]
    +

    Bases: GeminiWrapperBase

    +

    The wrapper for Google Gemini embedding model, +e.g. models/embedding-001

    +
    +
    +model_type: str = 'gemini_embedding'
    +

    The type of the model, which is used in model configuration.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.html b/en/agentscope.models.html index 91f8e5461..a12e2dd8c 100644 --- a/en/agentscope.models.html +++ b/en/agentscope.models.html @@ -23,8 +23,8 @@ - - + + @@ -58,8 +58,8 @@

    AgentScope API Reference

    @@ -138,6 +140,20 @@

    The name of the model, which is used in model api calling.

    +
    +
    +__init__(config_name: str, **kwargs: Any) None[source]
    +

    Base class for model wrapper.

    +

    All model wrappers should inherit this class and implement the +__call__ function.

    +
    +
    Parameters:
    +

    config_name (str) – The id of the model, which is used to extract configuration +from the config file.

    +
    +
    +
    +
    config_name: str
    @@ -146,13 +162,13 @@
    -classmethod get_wrapper(model_type: str) Type[ModelWrapperBase][source]
    +classmethod get_wrapper(model_type: str) Type[ModelWrapperBase][source]

    Get the specific model wrapper

    -format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]

    Format the input string or dict into the format that the model API required.

    @@ -182,6 +198,22 @@ json: Any | None = None
    +
    +
    +__init__(text: str | None = None, embedding: Sequence | None = None, image_urls: Sequence[str] | None = None, raw: Any | None = None) None[source]
    +

    Initialize the model response.

    +
    +
    Parameters:
    +
      +
    • text (str, optional) – The text field.

    • +
    • embedding (Sequence, optional) – The embedding returned by the model.

    • +
    • image_urls (Sequence[str], optional) – The image URLs returned by the model.

    • +
    • raw (Any, optional) – The raw data returned by the model.

    • +
    +
    +
    +
    +
    text: str | None = None
    @@ -211,14 +243,14 @@

    A class that contains several static methods to parse the response.

    -classmethod to_dict(response: ModelResponse) ModelResponse[source]
    +classmethod to_dict(response: ModelResponse) ModelResponse[source]

    Parse the response text to a dict, and feed it into the json field.

    -classmethod to_list(response: ModelResponse) ModelResponse[source]
    +classmethod to_list(response: ModelResponse) ModelResponse[source]

    Parse the response text to a list, and feed it into the json field.

    @@ -227,7 +259,7 @@
    -exception agentscope.models.ResponseParsingError(*args: Any, parse_func: Callable, error_info: str, response: ModelResponse, **kwargs: Any)[source]
    +exception agentscope.models.ResponseParsingError(*args: Any, parse_func: Callable, error_info: str, response: ModelResponse, **kwargs: Any)[source]

    Bases: Exception

    Exception raised when parsing the response fails.

    @@ -236,6 +268,21 @@

    The source code of the parsing function.

    +
    +
    +__init__(*args: Any, parse_func: Callable, error_info: str, response: ModelResponse, **kwargs: Any) None[source]
    +

    Initialize the exception.

    +
    +
    Parameters:
    +
      +
    • parse_func (str) – The source code of the parsing function.

    • +
    • error_info (str) – The detail information of the error.

    • +
    • response (ModelResponse) – The response that fails to be parsed.

    • +
    +
    +
    +
    +
    error_info: str
    @@ -244,7 +291,7 @@
    -response: ModelResponse
    +response: ModelResponse

    The response that fails to be parsed.

    @@ -253,7 +300,7 @@
    class agentscope.models.PostAPIModelWrapperBase(config_name: str, api_url: str, headers: dict | None = None, max_length: int = 2048, timeout: int = 30, json_args: dict | None = None, post_args: dict | None = None, max_retries: int = 3, messages_key: str = 'inputs', retry_interval: int = 1, **kwargs: Any)[source]
    -

    Bases: ModelWrapperBase, ABC

    +

    Bases: ModelWrapperBase, ABC

    The base model wrapper for the model deployed on the POST API.

    @@ -262,12 +309,51 @@ class in model configuration.

    +
    +
    +__init__(config_name: str, api_url: str, headers: dict | None = None, max_length: int = 2048, timeout: int = 30, json_args: dict | None = None, post_args: dict | None = None, max_retries: int = 3, messages_key: str = 'inputs', retry_interval: int = 1, **kwargs: Any) None[source]
    +

    Initialize the model wrapper.

    +
    +
    Parameters:
    +
      +
    • config_name (str) – The id of the model.

    • +
    • api_url (str) – The url of the post request api.

    • +
    • headers (dict, defaults to None) – The headers of the api. Defaults to None.

    • +
    • max_length (int, defaults to 2048) – The maximum length of the model.

    • +
    • timeout (int, defaults to 30) – The timeout of the api. Defaults to 30.

    • +
    • json_args (dict, defaults to None) – The json arguments of the api. Defaults to None.

    • +
    • post_args (dict, defaults to None) – The post arguments of the api. Defaults to None.

    • +
    • max_retries (int, defaults to 3) – The maximum number of retries when the parse_func raise an +exception.

    • +
    • messages_key (str, defaults to inputs) – The key of the input messages in the json argument.

    • +
    • retry_interval (int, defaults to 1) – The interval between retries when a request fails.

    • +
    +
    +
    +
    +

    Note

    +

    When an object of PostApiModelWrapper is called, the arguments +will of post requests will be used as follows:

    +
    request.post(
    +    url=api_url,
    +    headers=headers,
    +    json={
    +        messages_key: messages,
    +        **json_args
    +    },
    +    **post_args
    +)
    +
    +
    +
    +
    +
    class agentscope.models.PostAPIChatWrapper(config_name: str, api_url: str, headers: dict | None = None, max_length: int = 2048, timeout: int = 30, json_args: dict | None = None, post_args: dict | None = None, max_retries: int = 3, messages_key: str = 'inputs', retry_interval: int = 1, **kwargs: Any)[source]
    -

    Bases: PostAPIModelWrapperBase

    +

    Bases: PostAPIModelWrapperBase

    A post api model wrapper compatilble with openai chat, e.g., vLLM, FastChat.

    @@ -279,7 +365,7 @@
    -format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]

    Format the input messages into a list of dict, which is compatible to OpenAI Chat API.

    @@ -302,11 +388,34 @@
    class agentscope.models.OpenAIWrapperBase(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    -

    Bases: ModelWrapperBase, ABC

    +

    Bases: ModelWrapperBase, ABC

    The model wrapper for OpenAI API.

    +
    +
    +__init__(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any) None[source]
    +

    Initialize the openai client.

    +
    +
    Parameters:
    +
      +
    • config_name (str) – The name of the model config.

    • +
    • model_name (str, default None) – The name of the model to use in OpenAI API.

    • +
    • api_key (str, default None) – The API key for OpenAI API. If not specified, it will +be read from the environment variable OPENAI_API_KEY.

    • +
    • organization (str, default None) – The organization ID for OpenAI API. If not specified, it will +be read from the environment variable OPENAI_ORGANIZATION.

    • +
    • client_args (dict, default None) – The extra keyword arguments to initialize the OpenAI client.

    • +
    • generate_args (dict, default None) – The extra keyword arguments used in openai api generation, +e.g. temperature, seed.

    • +
    • budget (float, default None) – The total budget using this model. Set to None means no +limit.

    • +
    +
    +
    +
    +
    -format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]

    Format the input string or dict into the format that the model API required.

    @@ -316,7 +425,7 @@
    class agentscope.models.OpenAIChatWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    -

    Bases: OpenAIWrapperBase

    +

    Bases: OpenAIWrapperBase

    The model wrapper for OpenAI’s chat API.

    @@ -332,7 +441,7 @@
    -format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]

    Format the input string and dictionary into the format that OpenAI Chat API required.

    @@ -356,7 +465,7 @@
    class agentscope.models.OpenAIDALLEWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    -

    Bases: OpenAIWrapperBase

    +

    Bases: OpenAIWrapperBase

    The model wrapper for OpenAI’s DALL·E API.

    @@ -370,7 +479,7 @@
    class agentscope.models.OpenAIEmbeddingWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    -

    Bases: OpenAIWrapperBase

    +

    Bases: OpenAIWrapperBase

    The model wrapper for OpenAI embedding API.

    @@ -384,7 +493,7 @@
    class agentscope.models.DashScopeChatWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    -

    Bases: DashScopeWrapperBase

    +

    Bases: DashScopeWrapperBase

    The model wrapper for DashScope’s chat API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/api-details

    @@ -401,7 +510,7 @@
    -format(*args: MessageBase | Sequence[MessageBase]) List[source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[source]

    Format the messages for DashScope Chat API.

    In this format function, the input messages are formatted into a single system messages with format “{name}: {content}” for each @@ -453,7 +562,7 @@

    class agentscope.models.DashScopeImageSynthesisWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    -

    Bases: DashScopeWrapperBase

    +

    Bases: DashScopeWrapperBase

    The model wrapper for DashScope Image Synthesis API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/quick-start-1

    @@ -468,7 +577,7 @@
    class agentscope.models.DashScopeTextEmbeddingWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    -

    Bases: DashScopeWrapperBase

    +

    Bases: DashScopeWrapperBase

    The model wrapper for DashScope Text Embedding API.

    @@ -482,7 +591,7 @@
    class agentscope.models.DashScopeMultiModalWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, generate_args: dict | None = None, **kwargs: Any)[source]
    -

    Bases: DashScopeWrapperBase

    +

    Bases: DashScopeWrapperBase

    The model wrapper for DashScope Multimodal API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-api

    @@ -494,7 +603,7 @@
    -format(*args: MessageBase | Sequence[MessageBase]) List[source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[source]

    Format the messages for DashScope Multimodal API.

    The multimodal API has the following requirements:

    @@ -612,7 +721,7 @@
    class agentscope.models.OllamaChatWrapper(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any)[source]
    -

    Bases: OllamaWrapperBase

    +

    Bases: OllamaWrapperBase

    The model wrapper for Ollama chat API.

    @@ -623,7 +732,7 @@
    -format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]

    A basic strategy to format the input into the required format of Ollama Chat API.

    Note for ollama chat api, the content field shouldn’t be empty string.

    @@ -647,7 +756,7 @@
    class agentscope.models.OllamaEmbeddingWrapper(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any)[source]
    -

    Bases: OllamaWrapperBase

    +

    Bases: OllamaWrapperBase

    The model wrapper for Ollama embedding API.

    @@ -658,7 +767,7 @@
    -format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]

    Format the input string or dict into the format that the model API required.

    @@ -668,7 +777,7 @@
    class agentscope.models.OllamaGenerationWrapper(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any)[source]
    -

    Bases: OllamaWrapperBase

    +

    Bases: OllamaWrapperBase

    The model wrapper for Ollama generation API.

    @@ -679,7 +788,7 @@
    -format(*args: MessageBase | Sequence[MessageBase]) str[source]
    +format(*args: MessageBase | Sequence[MessageBase]) str[source]

    Forward the input to the model.

    Parameters:
    @@ -701,7 +810,7 @@
    class agentscope.models.GeminiChatWrapper(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any)[source]
    -

    Bases: GeminiWrapperBase

    +

    Bases: GeminiWrapperBase

    The wrapper for Google Gemini chat model, e.g. gemini-pro

    @@ -715,9 +824,24 @@

    The generation method used in __call__ function.

    +
    +
    +__init__(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any) None[source]
    +

    Initialize the wrapper for Google Gemini model.

    +
    +
    Parameters:
    +
      +
    • model_name (str) – The name of the model.

    • +
    • api_key (str, defaults to None) – The api_key for the model. If it is not provided, it will be +loaded from environment variable.

    • +
    +
    +
    +
    +
    -format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]

    This function provide a basic prompting strategy for Gemini Chat API in multi-party conversation, which combines all input into a single string, and wrap it into a user message.

    @@ -758,7 +882,7 @@
    class agentscope.models.GeminiEmbeddingWrapper(config_name: str, model_name: str, api_key: str | None = None, **kwargs: Any)[source]
    -

    Bases: GeminiWrapperBase

    +

    Bases: GeminiWrapperBase

    The wrapper for Google Gemini embedding model, e.g. models/embedding-001

    @@ -771,7 +895,7 @@
    -agentscope.models.load_model_by_config_name(config_name: str) ModelWrapperBase[source]
    +agentscope.models.load_model_by_config_name(config_name: str) ModelWrapperBase[source]

    Load the model by config name.

    @@ -808,8 +932,8 @@

    diff --git a/en/agentscope.models.model.html b/en/agentscope.models.model.html new file mode 100644 index 000000000..d42ce57bb --- /dev/null +++ b/en/agentscope.models.model.html @@ -0,0 +1,243 @@ + + + + + + + + agentscope.models.model — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.model

    +

    The configuration file should contain one or a list of model configs, +and each model config should follow the following format.

    +
    {
    +    "config_name": "{config_name}",
    +    "model_type": "openai_chat" | "post_api" | ...,
    +    ...
    +}
    +
    +
    +

    After that, you can specify model by {config_name}.

    +
    +

    Note

    +

    The parameters for different types of models are different. For OpenAI API, +the format is:

    +
    +
    {
    +    "config_name": "{id of your model}",
    +    "model_type": "openai_chat",
    +    "model_name": "{model_name_for_openai, e.g. gpt-3.5-turbo}",
    +    "api_key": "{your_api_key}",
    +    "organization": "{your_organization, if needed}",
    +    "client_args": {
    +        # ...
    +    },
    +    "generate_args": {
    +        # ...
    +    }
    +}
    +
    +
    +
    +

    For Post API, toking huggingface inference API as an example, its format +is:

    +
    +
    {
    +    "config_name": "{config_name}",
    +    "model_type": "post_api",
    +    "api_url": "{api_url}",
    +    "headers": {"Authorization": "Bearer {API_TOKEN}"},
    +    "max_length": {max_length_of_model},
    +    "timeout": {timeout},
    +    "max_retries": {max_retries},
    +    "generate_args": {
    +        "temperature": 0.5,
    +        # ...
    +    }
    +}
    +
    +
    +
    +
    +
    +
    +class agentscope.models.model.ModelWrapperBase(config_name: str, **kwargs: Any)[source]
    +

    Bases: object

    +

    The base class for model wrapper.

    +
    +
    +model_type: str
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    +
    +__init__(config_name: str, **kwargs: Any) None[source]
    +

    Base class for model wrapper.

    +

    All model wrappers should inherit this class and implement the +__call__ function.

    +
    +
    Parameters:
    +

    config_name (str) – The id of the model, which is used to extract configuration +from the config file.

    +
    +
    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +classmethod get_wrapper(model_type: str) Type[ModelWrapperBase][source]
    +

    Get the specific model wrapper

    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +

    Format the input string or dict into the format that the model +API required.

    +
    + +
    +
    +update_monitor(**kwargs: Any) None[source]
    +

    Update the monitor with the given values.

    +
    +
    Parameters:
    +

    kwargs (dict) – The values to be updated to the monitor.

    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.ollama_model.html b/en/agentscope.models.ollama_model.html new file mode 100644 index 000000000..1ccd80534 --- /dev/null +++ b/en/agentscope.models.ollama_model.html @@ -0,0 +1,352 @@ + + + + + + + + agentscope.models.ollama_model — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.ollama_model

    +

    Model wrapper for Ollama models.

    +
    +
    +class agentscope.models.ollama_model.OllamaWrapperBase(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any)[source]
    +

    Bases: ModelWrapperBase, ABC

    +

    The base class for Ollama model wrappers.

    +

    To use Ollama API, please +1. First install ollama server from https://ollama.com/download and +start the server +2. Pull the model by ollama pull {model_name} in terminal +After that, you can use the ollama API.

    +
    +
    +model_type: str
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +__init__(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any) None[source]
    +

    Initialize the model wrapper for Ollama API.

    +
    +
    Parameters:
    +
      +
    • model_name (str) – The model name used in ollama API.

    • +
    • options (dict, default None) – The extra keyword arguments used in Ollama api generation, +e.g. {“temperature”: 0., “seed”: 123}.

    • +
    • keep_alive (str, default 5m) – Controls how long the model will stay loaded into memory +following the request.

    • +
    +
    +
    +
    + +
    +
    +model_name: str
    +

    The model name used in ollama API.

    +
    + +
    +
    +options: dict
    +

    A dict contains the options for ollama generation API, +e.g. {“temperature”: 0, “seed”: 123}

    +
    + +
    +
    +keep_alive: str
    +

    Controls how long the model will stay loaded into memory following +the request.

    +
    + +
    + +
    +
    +class agentscope.models.ollama_model.OllamaChatWrapper(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any)[source]
    +

    Bases: OllamaWrapperBase

    +

    The model wrapper for Ollama chat API.

    +
    +
    +model_type: str = 'ollama_chat'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +

    A basic strategy to format the input into the required format of +Ollama Chat API.

    +

    Note for ollama chat api, the content field shouldn’t be empty string.

    +
    +
    Parameters:
    +

    args (Union[MessageBase, Sequence[MessageBase]]) – The input arguments to be formatted, where each argument +should be a Msg object, or a list of Msg objects. +In distribution, placeholder is also allowed.

    +
    +
    Returns:
    +

    The formatted messages.

    +
    +
    Return type:
    +

    List[dict]

    +
    +
    +
    + +
    +
    +model_name: str
    +

    The model name used in ollama API.

    +
    + +
    +
    +options: dict
    +

    A dict contains the options for ollama generation API, +e.g. {“temperature”: 0, “seed”: 123}

    +
    + +
    +
    +keep_alive: str
    +

    Controls how long the model will stay loaded into memory following +the request.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    + +
    +
    +class agentscope.models.ollama_model.OllamaEmbeddingWrapper(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any)[source]
    +

    Bases: OllamaWrapperBase

    +

    The model wrapper for Ollama embedding API.

    +
    +
    +model_type: str = 'ollama_embedding'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +model_name: str
    +

    The model name used in ollama API.

    +
    + +
    +
    +options: dict
    +

    A dict contains the options for ollama generation API, +e.g. {“temperature”: 0, “seed”: 123}

    +
    + +
    +
    +keep_alive: str
    +

    Controls how long the model will stay loaded into memory following +the request.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +

    Format the input string or dict into the format that the model +API required.

    +
    + +
    + +
    +
    +class agentscope.models.ollama_model.OllamaGenerationWrapper(config_name: str, model_name: str, options: dict | None = None, keep_alive: str = '5m', **kwargs: Any)[source]
    +

    Bases: OllamaWrapperBase

    +

    The model wrapper for Ollama generation API.

    +
    +
    +model_name: str
    +

    The model name used in ollama API.

    +
    + +
    +
    +options: dict
    +

    A dict contains the options for ollama generation API, +e.g. {“temperature”: 0, “seed”: 123}

    +
    + +
    +
    +keep_alive: str
    +

    Controls how long the model will stay loaded into memory following +the request.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_type: str = 'ollama_generate'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) str[source]
    +

    Forward the input to the model.

    +
    +
    Parameters:
    +

    args (Union[MessageBase, Sequence[MessageBase]]) – The input arguments to be formatted, where each argument +should be a Msg object, or a list of Msg objects. +In distribution, placeholder is also allowed.

    +
    +
    Returns:
    +

    The formatted string prompt.

    +
    +
    Return type:
    +

    str

    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.openai_model.html b/en/agentscope.models.openai_model.html new file mode 100644 index 000000000..ec586e032 --- /dev/null +++ b/en/agentscope.models.openai_model.html @@ -0,0 +1,270 @@ + + + + + + + + agentscope.models.openai_model — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.openai_model

    +

    Model wrapper for OpenAI models

    +
    +
    +class agentscope.models.openai_model.OpenAIWrapperBase(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    +

    Bases: ModelWrapperBase, ABC

    +

    The model wrapper for OpenAI API.

    +
    +
    +__init__(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any) None[source]
    +

    Initialize the openai client.

    +
    +
    Parameters:
    +
      +
    • config_name (str) – The name of the model config.

    • +
    • model_name (str, default None) – The name of the model to use in OpenAI API.

    • +
    • api_key (str, default None) – The API key for OpenAI API. If not specified, it will +be read from the environment variable OPENAI_API_KEY.

    • +
    • organization (str, default None) – The organization ID for OpenAI API. If not specified, it will +be read from the environment variable OPENAI_ORGANIZATION.

    • +
    • client_args (dict, default None) – The extra keyword arguments to initialize the OpenAI client.

    • +
    • generate_args (dict, default None) – The extra keyword arguments used in openai api generation, +e.g. temperature, seed.

    • +
    • budget (float, default None) – The total budget using this model. Set to None means no +limit.

    • +
    +
    +
    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +

    Format the input string or dict into the format that the model +API required.

    +
    + +
    + +
    +
    +class agentscope.models.openai_model.OpenAIChatWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    +

    Bases: OpenAIWrapperBase

    +

    The model wrapper for OpenAI’s chat API.

    +
    +
    +model_type: str = 'openai_chat'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +deprecated_model_type: str = 'openai'
    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +

    Format the input string and dictionary into the format that +OpenAI Chat API required.

    +
    +
    Parameters:
    +

    args (Union[MessageBase, Sequence[MessageBase]]) – The input arguments to be formatted, where each argument +should be a Msg object, or a list of Msg objects. +In distribution, placeholder is also allowed.

    +
    +
    Returns:
    +

    The formatted messages in the format that OpenAI Chat API +required.

    +
    +
    Return type:
    +

    List[dict]

    +
    +
    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.openai_model.OpenAIDALLEWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    +

    Bases: OpenAIWrapperBase

    +

    The model wrapper for OpenAI’s DALL·E API.

    +
    +
    +model_type: str = 'openai_dall_e'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.openai_model.OpenAIEmbeddingWrapper(config_name: str, model_name: str | None = None, api_key: str | None = None, organization: str | None = None, client_args: dict | None = None, generate_args: dict | None = None, budget: float | None = None, **kwargs: Any)[source]
    +

    Bases: OpenAIWrapperBase

    +

    The model wrapper for OpenAI embedding API.

    +
    +
    +model_type: str = 'openai_embedding'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.post_model.html b/en/agentscope.models.post_model.html new file mode 100644 index 000000000..e41489bee --- /dev/null +++ b/en/agentscope.models.post_model.html @@ -0,0 +1,267 @@ + + + + + + + + agentscope.models.post_model — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.post_model

    +

    Model wrapper for post-based inference apis.

    +
    +
    +class agentscope.models.post_model.PostAPIModelWrapperBase(config_name: str, api_url: str, headers: dict | None = None, max_length: int = 2048, timeout: int = 30, json_args: dict | None = None, post_args: dict | None = None, max_retries: int = 3, messages_key: str = 'inputs', retry_interval: int = 1, **kwargs: Any)[source]
    +

    Bases: ModelWrapperBase, ABC

    +

    The base model wrapper for the model deployed on the POST API.

    +
    +
    +model_type: str = 'post_api'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +__init__(config_name: str, api_url: str, headers: dict | None = None, max_length: int = 2048, timeout: int = 30, json_args: dict | None = None, post_args: dict | None = None, max_retries: int = 3, messages_key: str = 'inputs', retry_interval: int = 1, **kwargs: Any) None[source]
    +

    Initialize the model wrapper.

    +
    +
    Parameters:
    +
      +
    • config_name (str) – The id of the model.

    • +
    • api_url (str) – The url of the post request api.

    • +
    • headers (dict, defaults to None) – The headers of the api. Defaults to None.

    • +
    • max_length (int, defaults to 2048) – The maximum length of the model.

    • +
    • timeout (int, defaults to 30) – The timeout of the api. Defaults to 30.

    • +
    • json_args (dict, defaults to None) – The json arguments of the api. Defaults to None.

    • +
    • post_args (dict, defaults to None) – The post arguments of the api. Defaults to None.

    • +
    • max_retries (int, defaults to 3) – The maximum number of retries when the parse_func raise an +exception.

    • +
    • messages_key (str, defaults to inputs) – The key of the input messages in the json argument.

    • +
    • retry_interval (int, defaults to 1) – The interval between retries when a request fails.

    • +
    +
    +
    +
    +

    Note

    +

    When an object of PostApiModelWrapper is called, the arguments +will of post requests will be used as follows:

    +
    request.post(
    +    url=api_url,
    +    headers=headers,
    +    json={
    +        messages_key: messages,
    +        **json_args
    +    },
    +    **post_args
    +)
    +
    +
    +
    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.post_model.PostAPIChatWrapper(config_name: str, api_url: str, headers: dict | None = None, max_length: int = 2048, timeout: int = 30, json_args: dict | None = None, post_args: dict | None = None, max_retries: int = 3, messages_key: str = 'inputs', retry_interval: int = 1, **kwargs: Any)[source]
    +

    Bases: PostAPIModelWrapperBase

    +

    A post api model wrapper compatilble with openai chat, e.g., vLLM, +FastChat.

    +
    +
    +model_type: str = 'post_api_chat'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict][source]
    +

    Format the input messages into a list of dict, which is +compatible to OpenAI Chat API.

    +
    +
    Parameters:
    +

    args (Union[MessageBase, Sequence[MessageBase]]) – The input arguments to be formatted, where each argument +should be a Msg object, or a list of Msg objects. +In distribution, placeholder is also allowed.

    +
    +
    Returns:
    +

    The formatted messages.

    +
    +
    Return type:
    +

    Union[List[dict]]

    +
    +
    +
    + +
    +
    +config_name: str
    +

    The name of the model configuration.

    +
    + +
    +
    +model_name: str
    +

    The name of the model, which is used in model api calling.

    +
    + +
    + +
    +
    +class agentscope.models.post_model.PostAPIDALLEWrapper(config_name: str, api_url: str, headers: dict | None = None, max_length: int = 2048, timeout: int = 30, json_args: dict | None = None, post_args: dict | None = None, max_retries: int = 3, messages_key: str = 'inputs', retry_interval: int = 1, **kwargs: Any)[source]
    +

    Bases: PostAPIModelWrapperBase

    +

    A post api model wrapper compatible with openai dall_e

    +
    +
    +model_type: str = 'post_api_dall_e'
    +

    The type of the model wrapper, which is to identify the model wrapper +class in model configuration.

    +
    + +
    +
    +deprecated_model_type: str = 'post_api_dalle'
    +
    + +
    +
    +format(*args: MessageBase | Sequence[MessageBase]) List[dict] | str[source]
    +

    Format the input string or dict into the format that the model +API required.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.models.response.html b/en/agentscope.models.response.html new file mode 100644 index 000000000..60ab5f556 --- /dev/null +++ b/en/agentscope.models.response.html @@ -0,0 +1,240 @@ + + + + + + + + agentscope.models.response — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.models.response

    +

    Parser for model response.

    +
    +
    +class agentscope.models.response.ModelResponse(text: str | None = None, embedding: Sequence | None = None, image_urls: Sequence[str] | None = None, raw: Any | None = None)[source]
    +

    Bases: object

    +

    Encapsulation of data returned by the model.

    +

    The main purpose of this class is to align the return formats of different +models and act as a bridge between models and agents.

    +
    +
    +json: Any | None = None
    +
    + +
    +
    +__init__(text: str | None = None, embedding: Sequence | None = None, image_urls: Sequence[str] | None = None, raw: Any | None = None) None[source]
    +

    Initialize the model response.

    +
    +
    Parameters:
    +
      +
    • text (str, optional) – The text field.

    • +
    • embedding (Sequence, optional) – The embedding returned by the model.

    • +
    • image_urls (Sequence[str], optional) – The image URLs returned by the model.

    • +
    • raw (Any, optional) – The raw data returned by the model.

    • +
    +
    +
    +
    + +
    +
    +text: str | None = None
    +
    + +
    +
    +embedding: Sequence | None = None
    +
    + +
    +
    +image_urls: Sequence[str] | None = None
    +
    + +
    +
    +raw: Any | None = None
    +
    + +
    + +
    +
    +class agentscope.models.response.ResponseParser[source]
    +

    Bases: object

    +

    A class that contains several static methods to parse the response.

    +
    +
    +classmethod to_dict(response: ModelResponse) ModelResponse[source]
    +

    Parse the response text to a dict, and feed it into the json +field.

    +
    + +
    +
    +classmethod to_list(response: ModelResponse) ModelResponse[source]
    +

    Parse the response text to a list, and feed it into the json +field.

    +
    + +
    + +
    +
    +exception agentscope.models.response.ResponseParsingError(*args: Any, parse_func: Callable, error_info: str, response: ModelResponse, **kwargs: Any)[source]
    +

    Bases: Exception

    +

    Exception raised when parsing the response fails.

    +
    +
    +parse_func: str
    +

    The source code of the parsing function.

    +
    + +
    +
    +__init__(*args: Any, parse_func: Callable, error_info: str, response: ModelResponse, **kwargs: Any) None[source]
    +

    Initialize the exception.

    +
    +
    Parameters:
    +
      +
    • parse_func (str) – The source code of the parsing function.

    • +
    • error_info (str) – The detail information of the error.

    • +
    • response (ModelResponse) – The response that fails to be parsed.

    • +
    +
    +
    +
    + +
    +
    +error_info: str
    +

    The detail information of the error.

    +
    + +
    +
    +response: ModelResponse
    +

    The response that fails to be parsed.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.msghub.html b/en/agentscope.msghub.html new file mode 100644 index 000000000..82cd96ca3 --- /dev/null +++ b/en/agentscope.msghub.html @@ -0,0 +1,211 @@ + + + + + + + + agentscope.msghub — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.msghub

    +

    MsgHub is designed to share messages among a group of agents.

    +
    +
    +class agentscope.msghub.MsgHubManager(participants: Sequence[AgentBase], announcement: Sequence[dict] | dict | None = None)[source]
    +

    Bases: object

    +

    MsgHub manager class for sharing dialog among a group of agents.

    +
    +
    +__init__(participants: Sequence[AgentBase], announcement: Sequence[dict] | dict | None = None) None[source]
    +

    Initialize a msghub manager from the given arguments.

    +
    +
    Parameters:
    +
      +
    • participants (Sequence[AgentBase]) – The Sequence of participants in the msghub.

    • +
    • announcement – (Optional[Union[list[dict], dict]], defaults to None): +The message that will be broadcast to all participants at +the first without requiring response.

    • +
    +
    +
    +
    + +
    +
    +add(new_participant: Sequence[AgentBase] | AgentBase) None[source]
    +

    Add new participant into this hub

    +
    + +
    +
    +delete(participant: Sequence[AgentBase] | AgentBase) None[source]
    +

    Delete agents from participant.

    +
    + +
    +
    +broadcast(msg: dict | list[dict]) None[source]
    +

    Broadcast the message to all participants.

    +
    +
    Parameters:
    +

    msg (Union[dict, list[dict]]) – One or a list of dict messages to broadcast among all +participants.

    +
    +
    +
    + +
    + +
    +
    +agentscope.msghub.msghub(participants: Sequence[AgentBase], announcement: Sequence[dict] | dict | None = None) MsgHubManager[source]
    +

    msghub is used to share messages among a group of agents.

    +
    +
    Parameters:
    +
      +
    • participants (Sequence[AgentBase]) – A Sequence of participated agents in the msghub.

    • +
    • announcement (Optional[Union[list[dict], dict]], defaults to None) – The message that will be broadcast to all participants at the +very beginning without requiring response.

    • +
    +
    +
    +

    Example

    +

    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)
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.pipelines.functional.html b/en/agentscope.pipelines.functional.html new file mode 100644 index 000000000..44cb8a4c1 --- /dev/null +++ b/en/agentscope.pipelines.functional.html @@ -0,0 +1,256 @@ + + + + + + + + agentscope.pipelines.functional — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.pipelines.functional

    +

    Functional counterpart for Pipeline

    +
    +
    +agentscope.pipelines.functional.placeholder(x: dict | None = None) dict[source]
    +

    A placeholder that do nothing.

    +

    Acts as a placeholder in branches that do not require any operations in +flow control like if-else/switch

    +
    + +
    +
    +agentscope.pipelines.functional.sequentialpipeline(operators: Sequence[Operator], x: dict | None = None) dict[source]
    +

    Functional version of SequentialPipeline.

    +
    +
    Parameters:
    +
      +
    • operators (Sequence[Operator]) – Participating operators.

    • +
    • x (Optional[dict], defaults to None) – The input dictionary.

    • +
    +
    +
    Returns:
    +

    the output dictionary.

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +agentscope.pipelines.functional.ifelsepipeline(condition_func: ~typing.Callable, if_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], else_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>, x: dict | None = None) dict[source]
    +

    Functional version of IfElsePipeline.

    +
    +
    Parameters:
    +
      +
    • condition_func (Callable) – A function that determines whether to exeucte if_body_operator +or else_body_operator based on x.

    • +
    • if_body_operator (Operators) – Operators executed when condition_func returns True.

    • +
    • else_body_operator (Operators, defaults to placeholder) – Operators executed when condition_func returns False, +does nothing and just return the input by default.

    • +
    • x (Optional[dict], defaults to None) – The input dictionary.

    • +
    +
    +
    Returns:
    +

    the output dictionary.

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +agentscope.pipelines.functional.switchpipeline(condition_func: ~typing.Callable[[~typing.Any], ~typing.Any], case_operators: ~typing.Mapping[~typing.Any, ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator]], default_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>, x: dict | None = None) dict[source]
    +

    Functional version of SwitchPipeline.

    +
    +
    Parameters:
    +
      +
    • condition_func (Callable[[Any], Any]) – A function that determines which case_operator to execute based +on the input x.

    • +
    • case_operators (Mapping[Any, Operator]) – A dictionary containing multiple operators and their +corresponding trigger conditions.

    • +
    • default_operators (Operators, defaults to placeholder) – Operators that are executed when the actual condition do not +meet any of the case_operators, does nothing and just return the +input by default.

    • +
    • x (Optional[dict], defaults to None) – The input dictionary.

    • +
    +
    +
    Returns:
    +

    the output dictionary.

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +agentscope.pipelines.functional.forlooppipeline(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], max_loop: int, break_func: ~typing.Callable[[dict], bool] = <function <lambda>>, x: dict | None = None) dict[source]
    +

    Functional version of ForLoopPipeline.

    +
    +
    Parameters:
    +
      +
    • loop_body_operators (Operators) – Operators executed as the body of the loop.

    • +
    • max_loop (int) – maximum number of loop executions.

    • +
    • break_func (Callable[[dict], bool]) – A function used to determine whether to break out of the loop +based on the output of the loop_body_operator, defaults to +lambda _: False

    • +
    • x (Optional[dict], defaults to None) – The input dictionary.

    • +
    +
    +
    Returns:
    +

    The output dictionary.

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +agentscope.pipelines.functional.whilelooppipeline(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], condition_func: ~typing.Callable[[int, ~typing.Any], bool] = <function <lambda>>, x: dict | None = None) dict[source]
    +

    Functional version of WhileLoopPipeline.

    +
    +
    Parameters:
    +
      +
    • loop_body_operators (Operators) – Operators executed as the body of +the loop.

    • +
    • condition_func (Callable[[int, Any], bool], optional) – A function +that determines whether to continue executing the loop body based +on the current loop number and output of the loop_body_operator, +defaults to lambda _,__: False

    • +
    • x (Optional[dict], defaults to None) – The input dictionary.

    • +
    +
    +
    Returns:
    +

    the output dictionary.

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.pipelines.html b/en/agentscope.pipelines.html index c903a31c1..78a642c51 100644 --- a/en/agentscope.pipelines.html +++ b/en/agentscope.pipelines.html @@ -24,7 +24,7 @@ - + @@ -58,9 +58,11 @@

    AgentScope API Reference

    @@ -112,16 +114,21 @@
    class agentscope.pipelines.PipelineBase[source]
    -

    Bases: Operator

    +

    Bases: Operator

    Base interface of all pipelines.

    The pipeline is a special kind of operator that includes multiple operators and the interaction logic among them.

    +
    +
    +__init__() None[source]
    +
    +
    -class agentscope.pipelines.SequentialPipeline(operators: Sequence[Operator])[source]
    -

    Bases: PipelineBase

    +class agentscope.pipelines.SequentialPipeline(operators: Sequence[Operator])[source] +

    Bases: PipelineBase

    A template pipeline for implementing sequential logic.

    Sequential(operators) represents the following workflow:

    x = operators[0](x)
    @@ -130,12 +137,23 @@
     x = operators[n](x)
     
    +
    +
    +__init__(operators: Sequence[Operator]) None[source]
    +

    Initialize a Sequential pipeline.

    +
    +
    Parameters:
    +

    operators (Sequence[Operator]) – A Sequence of operators to be executed sequentially.

    +
    +
    +
    +
    class agentscope.pipelines.IfElsePipeline(condition_func: ~typing.Callable[[dict], bool], if_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], else_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>)[source]
    -

    Bases: PipelineBase

    +

    Bases: PipelineBase

    A template pipeline for implementing control flow like if-else.

    IfElsePipeline(condition_func, if_body_operators, else_body_operators) represents the following workflow:

    @@ -145,12 +163,29 @@ else_body_operators(x)
    +
    +
    +__init__(condition_func: ~typing.Callable[[dict], bool], if_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], else_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>) None[source]
    +

    Initialize an IfElsePipeline.

    +
    +
    Parameters:
    +
      +
    • condition_func (Callable[[dict], bool]) – A function that determines whether to execute +if_body_operators or else_body_operators based on the input x.

    • +
    • if_body_operators (Operators) – Operators executed when condition_func returns True.

    • +
    • else_body_operators (Operators) – Operators executed when condition_func returns False, +does nothing and just return the input by default.

    • +
    +
    +
    +
    +
    class agentscope.pipelines.SwitchPipeline(condition_func: ~typing.Callable[[dict], ~typing.Any], case_operators: ~typing.Mapping[~typing.Any, ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator]], default_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>)[source]
    -

    Bases: PipelineBase

    +

    Bases: PipelineBase

    A template pipeline for implementing control flow like switch-case.

    SwitchPipeline(condition_func, case_operators, default_operators) represents the following workflow:

    @@ -161,12 +196,31 @@ default: return default_operators(x)
    +
    +
    +__init__(condition_func: ~typing.Callable[[dict], ~typing.Any], case_operators: ~typing.Mapping[~typing.Any, ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator]], default_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>) None[source]
    +

    Initialize a SwitchPipeline.

    +
    +
    Parameters:
    +
      +
    • condition_func (Callable[[dict], Any]) – A function that determines which case_operator to execute +based on the input x.

    • +
    • case_operators (dict[Any, Operators]) – A dictionary containing multiple operators and their +corresponding trigger conditions.

    • +
    • default_operators (Operators, defaults to placeholder) – Operators that are executed when the actual condition do +not meet any of the case_operators, does nothing and just +return the input by default.

    • +
    +
    +
    +
    +
    class agentscope.pipelines.ForLoopPipeline(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], max_loop: int, break_func: ~typing.Callable[[dict], bool] = <function ForLoopPipeline.<lambda>>)[source]
    -

    Bases: PipelineBase

    +

    Bases: PipelineBase

    A template pipeline for implementing control flow like for-loop

    ForLoopPipeline(loop_body_operators, max_loop) represents the following workflow:

    @@ -182,12 +236,31 @@ break
    +
    +
    +__init__(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], max_loop: int, break_func: ~typing.Callable[[dict], bool] = <function ForLoopPipeline.<lambda>>)[source]
    +

    Initialize a ForLoopPipeline.

    +
    +
    Parameters:
    +
      +
    • loop_body_operators (Operators) – Operators executed as the body of the loop.

    • +
    • max_loop (int) – Maximum number of loop executions.

    • +
    • (`Callable[[dict] (break_func) –

    • +
    • bool]`

    • +
    • _ (defaults to `lambda) –

    • +
    • False`) – A function used to determine whether to break out of the +loop based on the output of the loop_body_operators.

    • +
    +
    +
    +
    +
    class agentscope.pipelines.WhileLoopPipeline(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], condition_func: ~typing.Callable[[int, dict], bool] = <function WhileLoopPipeline.<lambda>>)[source]
    -

    Bases: PipelineBase

    +

    Bases: PipelineBase

    A template pipeline for implementing control flow like while-loop

    WhileLoopPipeline(loop_body_operators, condition_operator, condition_func) represents the following workflow:

    @@ -197,11 +270,37 @@ i += 1
    +
    +
    +__init__(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], condition_func: ~typing.Callable[[int, dict], bool] = <function WhileLoopPipeline.<lambda>>)[source]
    +

    Initialize a WhileLoopPipeline.

    +
    +
    Parameters:
    +
      +
    • loop_body_operators (Operators) – Operators executed as the body of the loop.

    • +
    • (`Callable[[int (condition_func) –

    • +
    • dict]

    • +
    • bool]`

    • +
    • to (defaults)

    • +
    • _ (`lambda) –

      False`): +A function that determines whether to continue executing the +loop body based on the current loop number and output of the +loop_body_operator

      +

    • +
    • __ – False`): +A function that determines whether to continue executing the +loop body based on the current loop number and output of the +loop_body_operator

    • +
    +
    +
    +
    +
    -agentscope.pipelines.sequentialpipeline(operators: Sequence[Operator], x: dict | None = None) dict[source]
    +agentscope.pipelines.sequentialpipeline(operators: Sequence[Operator], x: dict | None = None) dict[source]

    Functional version of SequentialPipeline.

    Parameters:
    @@ -324,7 +423,7 @@
    diff --git a/en/agentscope.pipelines.pipeline.html b/en/agentscope.pipelines.pipeline.html new file mode 100644 index 000000000..6d38e1fa9 --- /dev/null +++ b/en/agentscope.pipelines.pipeline.html @@ -0,0 +1,316 @@ + + + + + + + + agentscope.pipelines.pipeline — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.pipelines.pipeline

    +

    Base class for Pipeline

    +
    +
    +class agentscope.pipelines.pipeline.PipelineBase[source]
    +

    Bases: Operator

    +

    Base interface of all pipelines.

    +

    The pipeline is a special kind of operator that includes +multiple operators and the interaction logic among them.

    +
    +
    +__init__() None[source]
    +
    + +
    + +
    +
    +class agentscope.pipelines.pipeline.IfElsePipeline(condition_func: ~typing.Callable[[dict], bool], if_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], else_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>)[source]
    +

    Bases: PipelineBase

    +

    A template pipeline for implementing control flow like if-else.

    +

    IfElsePipeline(condition_func, if_body_operators, else_body_operators) +represents the following workflow:

    +
    if condition_func(x):
    +    if_body_operators(x)
    +else:
    +    else_body_operators(x)
    +
    +
    +
    +
    +__init__(condition_func: ~typing.Callable[[dict], bool], if_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], else_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>) None[source]
    +

    Initialize an IfElsePipeline.

    +
    +
    Parameters:
    +
      +
    • condition_func (Callable[[dict], bool]) – A function that determines whether to execute +if_body_operators or else_body_operators based on the input x.

    • +
    • if_body_operators (Operators) – Operators executed when condition_func returns True.

    • +
    • else_body_operators (Operators) – Operators executed when condition_func returns False, +does nothing and just return the input by default.

    • +
    +
    +
    +
    + +
    + +
    +
    +class agentscope.pipelines.pipeline.SwitchPipeline(condition_func: ~typing.Callable[[dict], ~typing.Any], case_operators: ~typing.Mapping[~typing.Any, ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator]], default_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>)[source]
    +

    Bases: PipelineBase

    +

    A template pipeline for implementing control flow like switch-case.

    +

    SwitchPipeline(condition_func, case_operators, default_operators) +represents the following workflow:

    +
    switch condition_func(x):
    +    case k1: return case_operators[k1](x)
    +    case k2: return case_operators[k2](x)
    +    ...
    +    default: return default_operators(x)
    +
    +
    +
    +
    +__init__(condition_func: ~typing.Callable[[dict], ~typing.Any], case_operators: ~typing.Mapping[~typing.Any, ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator]], default_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator] = <function placeholder>) None[source]
    +

    Initialize a SwitchPipeline.

    +
    +
    Parameters:
    +
      +
    • condition_func (Callable[[dict], Any]) – A function that determines which case_operator to execute +based on the input x.

    • +
    • case_operators (dict[Any, Operators]) – A dictionary containing multiple operators and their +corresponding trigger conditions.

    • +
    • default_operators (Operators, defaults to placeholder) – Operators that are executed when the actual condition do +not meet any of the case_operators, does nothing and just +return the input by default.

    • +
    +
    +
    +
    + +
    + +
    +
    +class agentscope.pipelines.pipeline.ForLoopPipeline(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], max_loop: int, break_func: ~typing.Callable[[dict], bool] = <function ForLoopPipeline.<lambda>>)[source]
    +

    Bases: PipelineBase

    +

    A template pipeline for implementing control flow like for-loop

    +

    ForLoopPipeline(loop_body_operators, max_loop) represents the following +workflow:

    +
    for i in range(max_loop):
    +    x = loop_body_operators(x)
    +
    +
    +

    ForLoopPipeline(loop_body_operators, max_loop, break_func) +represents the following workflow:

    +
    for i in range(max_loop):
    +    x = loop_body_operators(x)
    +    if break_func(x):
    +        break
    +
    +
    +
    +
    +__init__(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], max_loop: int, break_func: ~typing.Callable[[dict], bool] = <function ForLoopPipeline.<lambda>>)[source]
    +

    Initialize a ForLoopPipeline.

    +
    +
    Parameters:
    +
      +
    • loop_body_operators (Operators) – Operators executed as the body of the loop.

    • +
    • max_loop (int) – Maximum number of loop executions.

    • +
    • (`Callable[[dict] (break_func) –

    • +
    • bool]`

    • +
    • _ (defaults to `lambda) –

    • +
    • False`) – A function used to determine whether to break out of the +loop based on the output of the loop_body_operators.

    • +
    +
    +
    +
    + +
    + +
    +
    +class agentscope.pipelines.pipeline.WhileLoopPipeline(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], condition_func: ~typing.Callable[[int, dict], bool] = <function WhileLoopPipeline.<lambda>>)[source]
    +

    Bases: PipelineBase

    +

    A template pipeline for implementing control flow like while-loop

    +

    WhileLoopPipeline(loop_body_operators, condition_operator, condition_func) +represents the following workflow:

    +
    i = 0
    +while (condition_func(i, x))
    +    x = loop_body_operators(x)
    +    i += 1
    +
    +
    +
    +
    +__init__(loop_body_operators: ~agentscope.agents.operator.Operator | ~typing.Sequence[~agentscope.agents.operator.Operator], condition_func: ~typing.Callable[[int, dict], bool] = <function WhileLoopPipeline.<lambda>>)[source]
    +

    Initialize a WhileLoopPipeline.

    +
    +
    Parameters:
    +
      +
    • loop_body_operators (Operators) – Operators executed as the body of the loop.

    • +
    • (`Callable[[int (condition_func) –

    • +
    • dict]

    • +
    • bool]`

    • +
    • to (defaults)

    • +
    • _ (`lambda) –

      False`): +A function that determines whether to continue executing the +loop body based on the current loop number and output of the +loop_body_operator

      +

    • +
    • __ – False`): +A function that determines whether to continue executing the +loop body based on the current loop number and output of the +loop_body_operator

    • +
    +
    +
    +
    + +
    + +
    +
    +class agentscope.pipelines.pipeline.SequentialPipeline(operators: Sequence[Operator])[source]
    +

    Bases: PipelineBase

    +

    A template pipeline for implementing sequential logic.

    +

    Sequential(operators) represents the following workflow:

    +
    x = operators[0](x)
    +x = operators[1](x)
    +...
    +x = operators[n](x)
    +
    +
    +
    +
    +__init__(operators: Sequence[Operator]) None[source]
    +

    Initialize a Sequential pipeline.

    +
    +
    Parameters:
    +

    operators (Sequence[Operator]) – A Sequence of operators to be executed sequentially.

    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.prompt.html b/en/agentscope.prompt.html new file mode 100644 index 000000000..d7357a78d --- /dev/null +++ b/en/agentscope.prompt.html @@ -0,0 +1,242 @@ + + + + + + + + agentscope.prompt — AgentScope documentation + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.prompt

    +

    Prompt engineering module.

    +
    +
    +class agentscope.prompt.PromptType(value)[source]
    +

    Bases: IntEnum

    +

    Enum for prompt types.

    +
    +
    +STRING = 0
    +
    + +
    +
    +LIST = 1
    +
    + +
    + +
    +
    +class agentscope.prompt.PromptEngine(model: ModelWrapperBase, shrink_policy: ShrinkPolicy = ShrinkPolicy.TRUNCATE, max_length: int | None = None, prompt_type: PromptType | None = None, max_summary_length: int = 200, summarize_model: ModelWrapperBase | None = None)[source]
    +

    Bases: object

    +

    Prompt engineering module for both list and string prompt

    +
    +
    +__init__(model: ModelWrapperBase, shrink_policy: ShrinkPolicy = ShrinkPolicy.TRUNCATE, max_length: int | None = None, prompt_type: PromptType | None = None, max_summary_length: int = 200, summarize_model: ModelWrapperBase | None = None) None[source]
    +

    Init PromptEngine.

    +
    +
    Parameters:
    +
      +
    • model (ModelWrapperBase) – The target model for prompt engineering.

    • +
    • (ShrinkPolicy (shrink_policy)

    • +
    • to (defaults)

    • +
    • ShrinkPolicy.TRUNCATE) – The shrink policy for prompt engineering, defaults to +ShrinkPolicy.TRUNCATE.

    • +
    • max_length (Optional[int], defaults to None) – The max length of context, if it is None, it will be set to the +max length of the model.

    • +
    • prompt_type (Optional[MsgType], defaults to None) – The type of prompt, if it is None, it will be set according to +the model.

    • +
    • max_summary_length (int, defaults to 200) – The max length of summary, if it is None, it will be set to the +max length of the model.

    • +
    • summarize_model (Optional[ModelWrapperBase], defaults to None) – The model used for summarization, if it is None, it will be +set to model.

    • +
    +
    +
    +
    +

    Note

    +
      +
    1. TODO: Shrink function is still under development.

    2. +
    +

    2. If the argument max_length and prompt_type are not given, +they will be set according to the given model.

    +

    3. shrink_policy is used when the prompt is too long, it can +be set to ShrinkPolicy.TRUNCATE or ShrinkPolicy.SUMMARIZE.

    +
    +

    a. ShrinkPolicy.TRUNCATE will truncate the prompt to the +desired length.

    +

    b. ShrinkPolicy.SUMMARIZE will summarize partial of the +dialog history to save space. The summarization model +defaults to model if not given.

    +
    +
    +

    Example

    +

    With prompt engine, we encapsulate different operations for +string- and list-style prompt, and block the prompt engineering +process from the user. +As a user, you can just combine you prompt as follows.

    +
    # prepare the component
    +system_prompt = "You're a helpful assistant ..."
    +hint_prompt = "You should response in Json format."
    +prefix = "assistant: "
    +
    +# initialize the prompt engine and join the prompt
    +engine = PromptEngine(model)
    +prompt = engine.join(system_prompt, memory.get_memory(),
    +hint_prompt, prefix)
    +
    +
    +
    + +
    +
    +join(*args: Any, format_map: dict | None = None) str | list[dict][source]
    +

    Join prompt components according to its type. The join function can +accept any number and type of arguments. If prompt type is +PromptType.STRING, the arguments will be joined by “\n”. If +prompt type is PromptType.LIST, the string arguments will be +converted to Msg from system.

    +
    + +
    +
    +join_to_str(*args: Any, format_map: dict | None) str[source]
    +

    Join prompt components to a string.

    +
    + +
    +
    +join_to_list(*args: Any, format_map: dict | None) list[source]
    +

    Join prompt components to a list of Msg objects.

    +
    + +
    + +
    + + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.rpc.html b/en/agentscope.rpc.html index dd75f0fc6..57f77bffd 100644 --- a/en/agentscope.rpc.html +++ b/en/agentscope.rpc.html @@ -23,7 +23,7 @@ - + @@ -58,9 +58,11 @@

    AgentScope API Reference

    @@ -110,6 +112,23 @@ class agentscope.rpc.RpcAgentClient(host: str, port: int, agent_id: str = '')[source]

    Bases: object

    A client of Rpc agent server

    +
    +
    +__init__(host: str, port: int, agent_id: str = '') None[source]
    +

    Init a rpc agent client

    +
    +
    Parameters:
    +
      +
    • host (str) – the hostname of the rpc agent server which the

    • +
    • connected. (is)

    • +
    • port (int) – the port of the rpc agent server which the client

    • +
    • connected.

    • +
    • agent_id (str) – the agent id of the agent being called.

    • +
    +
    +
    +
    +
    call_func(func_name: str, value: str | None = None, timeout: int = 300) str[source]
    @@ -149,6 +168,11 @@ class agentscope.rpc.ResponseStub[source]

    Bases: object

    A stub used to save the response of an rpc call in a sub-thread.

    +
    +
    +__init__() None[source]
    +
    +
    set_response(response: str) None[source]
    @@ -192,11 +216,22 @@ class agentscope.rpc.RpcAgentStub(channel)[source]

    Bases: object

    Servicer for rpc agent server

    +
    +
    +__init__(channel)[source]
    +

    Constructor.

    +
    +
    Parameters:
    +

    channel – A grpc.Channel.

    +
    +
    +
    +
    -agentscope.rpc.call_in_thread(client: RpcAgentClient, x: dict, func_name: str) ResponseStub[source]
    +agentscope.rpc.call_in_thread(client: RpcAgentClient, x: dict, func_name: str) ResponseStub[source]

    Call rpc function in a sub-thread.

    Parameters:
    @@ -227,7 +262,7 @@

    diff --git a/en/agentscope.rpc.rpc_agent_client.html b/en/agentscope.rpc.rpc_agent_client.html new file mode 100644 index 000000000..b46ba09ed --- /dev/null +++ b/en/agentscope.rpc.rpc_agent_client.html @@ -0,0 +1,230 @@ + + + + + + + + agentscope.rpc.rpc_agent_client — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.rpc.rpc_agent_client

    +

    Client of rpc agent server

    +
    +
    +class agentscope.rpc.rpc_agent_client.RpcAgentClient(host: str, port: int, agent_id: str = '')[source]
    +

    Bases: object

    +

    A client of Rpc agent server

    +
    +
    +__init__(host: str, port: int, agent_id: str = '') None[source]
    +

    Init a rpc agent client

    +
    +
    Parameters:
    +
      +
    • host (str) – the hostname of the rpc agent server which the

    • +
    • connected. (is)

    • +
    • port (int) – the port of the rpc agent server which the client

    • +
    • connected.

    • +
    • agent_id (str) – the agent id of the agent being called.

    • +
    +
    +
    +
    + +
    +
    +call_func(func_name: str, value: str | None = None, timeout: int = 300) str[source]
    +

    Call the specific function of rpc server.

    +
    +
    Parameters:
    +
      +
    • func_name (str) – the name of the function being called.

    • +
    • x (str, optional) – the seralized input value. Defaults to None.

    • +
    +
    +
    Returns:
    +

    serialized return data.

    +
    +
    Return type:
    +

    str

    +
    +
    +
    + +
    +
    +create_agent(agent_configs: dict | None) None[source]
    +

    Create a new agent for this client.

    +
    + +
    +
    +delete_agent() None[source]
    +

    Delete the agent created by this client.

    +
    + +
    + +
    +
    +class agentscope.rpc.rpc_agent_client.ResponseStub[source]
    +

    Bases: object

    +

    A stub used to save the response of an rpc call in a sub-thread.

    +
    +
    +__init__() None[source]
    +
    + +
    +
    +set_response(response: str) None[source]
    +

    Set the message.

    +
    + +
    +
    +get_response() str[source]
    +

    Get the message.

    +
    + +
    + +
    +
    +agentscope.rpc.rpc_agent_client.call_in_thread(client: RpcAgentClient, x: dict, func_name: str) ResponseStub[source]
    +

    Call rpc function in a sub-thread.

    +
    +
    Parameters:
    +
      +
    • client (RpcAgentClient) – the rpc client.

    • +
    • x (dict) – the value of the reqeust.

    • +
    • func_name (str) – the name of the function being called.

    • +
    +
    +
    Returns:
    +

    a stub to get the response.

    +
    +
    Return type:
    +

    ResponseStub

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.rpc.rpc_agent_pb2.html b/en/agentscope.rpc.rpc_agent_pb2.html new file mode 100644 index 000000000..42666617d --- /dev/null +++ b/en/agentscope.rpc.rpc_agent_pb2.html @@ -0,0 +1,129 @@ + + + + + + + + agentscope.rpc.rpc_agent_pb2 — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.rpc.rpc_agent_pb2

    +

    Generated protocol buffer code.

    +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.rpc.rpc_agent_pb2_grpc.html b/en/agentscope.rpc.rpc_agent_pb2_grpc.html new file mode 100644 index 000000000..38b6765aa --- /dev/null +++ b/en/agentscope.rpc.rpc_agent_pb2_grpc.html @@ -0,0 +1,177 @@ + + + + + + + + agentscope.rpc.rpc_agent_pb2_grpc — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.rpc.rpc_agent_pb2_grpc

    +

    Client and server classes corresponding to protobuf-defined services.

    +
    +
    +class agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentStub(channel)[source]
    +

    Bases: object

    +

    Servicer for rpc agent server

    +
    +
    +__init__(channel)[source]
    +

    Constructor.

    +
    +
    Parameters:
    +

    channel – A grpc.Channel.

    +
    +
    +
    + +
    + +
    +
    +class agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentServicer[source]
    +

    Bases: object

    +

    Servicer for rpc agent server

    +
    +
    +call_func(request, context)[source]
    +

    Missing associated documentation comment in .proto file.

    +
    + +
    + +
    +
    +agentscope.rpc.rpc_agent_pb2_grpc.add_RpcAgentServicer_to_server(servicer, server)[source]
    +
    + +
    +
    +class agentscope.rpc.rpc_agent_pb2_grpc.RpcAgent[source]
    +

    Bases: object

    +

    Servicer for rpc agent server

    +
    +
    +static call_func(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.execute_code.exec_python.html b/en/agentscope.service.execute_code.exec_python.html new file mode 100644 index 000000000..ee9f2beab --- /dev/null +++ b/en/agentscope.service.execute_code.exec_python.html @@ -0,0 +1,188 @@ + + + + + + + + agentscope.service.execute_code.exec_python — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.execute_code.exec_python

    +

    Service to execute python code.

    +
    +
    +agentscope.service.execute_code.exec_python.execute_python_code(code: str, timeout: int | float | None = 300, use_docker: bool | str | None = None, maximum_memory_bytes: int | None = None) ServiceResponse[source]
    +

    Execute a piece of python code.

    +

    This function can run Python code provided in string format. It has the +option to execute the code within a Docker container to provide an +additional layer of security, especially important when running +untrusted code.

    +

    WARNING: If use_docker is set to False, the code will be run +directly in the host system’s environment. This poses a potential +security risk if the code is untrusted. Only disable Docker if you are +confident in the safety of the code being executed.

    +
    +
    Parameters:
    +
      +
    • code (str, optional) – The Python code to be executed.

    • +
    • timeout (Optional[Union[int, float]], defaults to 300) – The maximum time (in seconds) allowed for the code to run. If +the code execution time exceeds this limit, it will be +terminated. Set to None for no time limit. Default is 300.

    • +
    • use_docker (Optional[Union[bool, str]], defaults to None) – Determines whether to execute the code within a Docker +container. If False, the system’s native Python environment is +used. When set to None, the function checks for Docker’s +availability and uses it if present. When set to some string, +will use the docker with string as the image name. Default is +None.

    • +
    • maximum_memory_bytes (Optional[int], defaults to None) – The memory limit in bytes for the code execution. If not +specified, there is no memory limit imposed.

    • +
    +
    +
    Returns:
    +

    A ServiceResponse containing two elements: +output and error. Both output and error are strings that +capture the standard output and standard error of the code +execution, respectively.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    +

    Note

    +

    IPython-specific operations such as plt.show() for displaying +matplotlib plots are currently not supported. This limitation stems +from the non-interactive nature of the execution environment.

    +

    The argument timeout is not available in Windows OS, since the +since signal.setitimer is only available in Unix.

    +
    +
    + +
    +
    +agentscope.service.execute_code.exec_python.sys_python_guard(maximum_memory_bytes: int | None = None) None[source]
    +

    This disables various destructive functions and prevents the generated code +from interfering with the test (e.g. fork bomb, killing other processes, +removing filesystem files, etc.)

    +

    The implementation of this function are modified from +https://github.com/openai/human-eval/blob/master/human_eval/execution.py

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.execute_code.exec_shell.html b/en/agentscope.service.execute_code.exec_shell.html new file mode 100644 index 000000000..7d454076c --- /dev/null +++ b/en/agentscope.service.execute_code.exec_shell.html @@ -0,0 +1,158 @@ + + + + + + + + agentscope.service.execute_code.exec_shell — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.execute_code.exec_shell

    +

    Service to execute shell commands.

    +
    +
    +agentscope.service.execute_code.exec_shell.execute_shell_command(command: str) ServiceResponse[source]
    +

    Executes a given shell command.

    +
    +
    Parameters:
    +

    command (str) – The shell command to execute.

    +
    +
    Returns:
    +

    Contains either the output from the shell command as a +string if sucessful, or an error message include the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    +

    Note

    +

    Use any bash/shell commands you want (e.g. find, grep, cat, ls), +but note that : +1. interactive session commands (e.g. python, vim) or commands that +change current state (e.g. cd that change the current directory) +are NOT supported yet, so please do not invoke them. +2. be VERY CAREFUL when using commands that will +change/edit the files current directory (e.g. rm, sed).

    +
    +

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.execute_code.html b/en/agentscope.service.execute_code.html index a1634b946..486434046 100644 --- a/en/agentscope.service.execute_code.html +++ b/en/agentscope.service.execute_code.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/agentscope.service.file.common.html b/en/agentscope.service.file.common.html new file mode 100644 index 000000000..d821d783a --- /dev/null +++ b/en/agentscope.service.file.common.html @@ -0,0 +1,279 @@ + + + + + + + + agentscope.service.file.common — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.file.common

    +

    Common operators for file and directory.

    +
    +
    +agentscope.service.file.common.create_file(file_path: str, content: str = '') ServiceResponse[source]
    +

    Create a file and write content to it.

    +
    +
    Parameters:
    +
      +
    • file_path (str) – The path where the file will be created.

    • +
    • content (str) – Content to write into the file.

    • +
    +
    +
    Returns:
    +

    Where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.common.delete_file(file_path: str) ServiceResponse[source]
    +

    Delete a file specified by the file path.

    +
    +
    Parameters:
    +

    file_path (str) – The path of the file to be deleted.

    +
    +
    Returns:
    +

    Where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.common.move_file(source_path: str, destination_path: str) ServiceResponse[source]
    +

    Move a file from a source path to a destination path.

    +
    +
    Parameters:
    +
      +
    • source_path (str) – The current path of the file.

    • +
    • destination_path (str) – The new path for the file.

    • +
    +
    +
    Returns:
    +

    Where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.common.create_directory(directory_path: str) ServiceResponse[source]
    +

    Create a directory at the specified path.

    +
    +
    Parameters:
    +

    directory_path (str) – The path where the directory will be created.

    +
    +
    Returns:
    +

    where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.common.delete_directory(directory_path: str) ServiceResponse[source]
    +

    Delete a directory and all of its contents.

    +
    +
    Parameters:
    +

    directory_path (str) – The path of the directory to be deleted.

    +
    +
    Returns:
    +

    Where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.common.move_directory(source_path: str, destination_path: str) ServiceResponse[source]
    +

    Move a directory from a source path to a destination path.

    +
    +
    Parameters:
    +
      +
    • source_path (str) – The current path of the directory.

    • +
    • destination_path (str) – The new path for the directory.

    • +
    +
    +
    Returns:
    +

    Where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.common.list_directory_content(directory_path: str) ServiceResponse[source]
    +

    List the contents of a directory. i.e. ls -a

    +
    +
    Parameters:
    +

    directory_path (str) – The path of the directory to show.

    +
    +
    Returns:
    +

    The results contain a list of direcotry contents, +or an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.common.get_current_directory() ServiceResponse[source]
    +

    Get the current working directory path.

    +
    +
    Returns:
    +

    The current working directory path, or an error +message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.file.html b/en/agentscope.service.file.html index 287a33e75..7c69101fb 100644 --- a/en/agentscope.service.file.html +++ b/en/agentscope.service.file.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/agentscope.service.file.json.html b/en/agentscope.service.file.json.html new file mode 100644 index 000000000..b903c569f --- /dev/null +++ b/en/agentscope.service.file.json.html @@ -0,0 +1,170 @@ + + + + + + + + agentscope.service.file.json — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.file.json

    +

    Operators for json file and directory.

    +
    +
    +agentscope.service.file.json.read_json_file(file_path: str) ServiceResponse[source]
    +

    Read and parse a JSON file.

    +
    +
    Parameters:
    +

    file_path (str) – The path to the JSON file to be read.

    +
    +
    Returns:
    +

    Where the boolean indicates success, the +Any is the parsed JSON content (typically a dict), and the str contains +an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.json.write_json_file(file_path: str, data: Any, overwrite: bool = False) ServiceResponse[source]
    +

    Serialize data to a JSON file.

    +
    +
    Parameters:
    +
      +
    • file_path (str) – The path to the file where the JSON data will be written.

    • +
    • data (Any) – The data to serialize to JSON.

    • +
    • overwrite (bool) – Whether to overwrite the file if it already exists.

    • +
    +
    +
    Returns:
    +

    where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.file.text.html b/en/agentscope.service.file.text.html new file mode 100644 index 000000000..3d922fd83 --- /dev/null +++ b/en/agentscope.service.file.text.html @@ -0,0 +1,170 @@ + + + + + + + + agentscope.service.file.text — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.file.text

    +

    Operators for txt file and directory.

    +
    +
    +agentscope.service.file.text.read_text_file(file_path: str) ServiceResponse[source]
    +

    Read the content of the text file.

    +
    +
    Parameters:
    +

    file_path (str) – The path to the text file to be read.

    +
    +
    Returns:
    +

    A tuple (bool, str) where the boolean indicates +success, and the str contains the file content or an error message +if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.file.text.write_text_file(file_path: str, content: str, overwrite: bool = False) ServiceResponse[source]
    +

    Write content to a text file.

    +
    +
    Parameters:
    +
      +
    • file_path (str) – The path to the file where content will be written.

    • +
    • content (str) – Content to write into the file.

    • +
    • overwrite (bool, defaults to False) – Whether to overwrite the file if it already exists.

    • +
    +
    +
    Returns:
    +

    where the boolean indicates success, and the +str contains an error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.html b/en/agentscope.service.html index a95bbcc7b..51fb96fdd 100644 --- a/en/agentscope.service.html +++ b/en/agentscope.service.html @@ -58,9 +58,11 @@

    AgentScope API Reference

    @@ -131,9 +133,26 @@

    Import all service-related modules in the package.

    -class agentscope.service.ServiceResponse(status: ServiceExecStatus, content: Any)[source]
    +class agentscope.service.ServiceResponse(status: ServiceExecStatus, content: Any)[source]

    Bases: dict

    Used to wrap the execution results of the services

    +
    +
    +__init__(status: ServiceExecStatus, content: Any)[source]
    +

    Constructor of ServiceResponse

    +
    +
    Parameters:
    +
      +
    • status (ServiceExeStatus) – The execution status of the service.

    • +
    • content (Any) – If the argument`status` is SUCCESS, content is the +response. We use object here to support various objects, +e.g. str, dict, image, video, etc. +Otherwise, content is the error message.

    • +
    +
    +
    +
    +
    @@ -209,7 +228,7 @@
    -agentscope.service.execute_python_code(code: str, timeout: int | float | None = 300, use_docker: bool | str | None = None, maximum_memory_bytes: int | None = None) ServiceResponse[source]
    +agentscope.service.execute_python_code(code: str, timeout: int | float | None = 300, use_docker: bool | str | None = None, maximum_memory_bytes: int | None = None) ServiceResponse[source]

    Execute a piece of python code.

    This function can run Python code provided in string format. It has the option to execute the code within a Docker container to provide an @@ -258,7 +277,7 @@

    -agentscope.service.execute_shell_command(command: str) ServiceResponse[source]
    +agentscope.service.execute_shell_command(command: str) ServiceResponse[source]

    Executes a given shell command.

    Parameters:
    @@ -287,7 +306,7 @@
    -agentscope.service.create_file(file_path: str, content: str = '') ServiceResponse[source]
    +agentscope.service.create_file(file_path: str, content: str = '') ServiceResponse[source]

    Create a file and write content to it.

    Parameters:
    @@ -308,7 +327,7 @@
    -agentscope.service.delete_file(file_path: str) ServiceResponse[source]
    +agentscope.service.delete_file(file_path: str) ServiceResponse[source]

    Delete a file specified by the file path.

    Parameters:
    @@ -326,7 +345,7 @@
    -agentscope.service.move_file(source_path: str, destination_path: str) ServiceResponse[source]
    +agentscope.service.move_file(source_path: str, destination_path: str) ServiceResponse[source]

    Move a file from a source path to a destination path.

    Parameters:
    @@ -347,7 +366,7 @@
    -agentscope.service.create_directory(directory_path: str) ServiceResponse[source]
    +agentscope.service.create_directory(directory_path: str) ServiceResponse[source]

    Create a directory at the specified path.

    Parameters:
    @@ -365,7 +384,7 @@
    -agentscope.service.delete_directory(directory_path: str) ServiceResponse[source]
    +agentscope.service.delete_directory(directory_path: str) ServiceResponse[source]

    Delete a directory and all of its contents.

    Parameters:
    @@ -383,7 +402,7 @@
    -agentscope.service.move_directory(source_path: str, destination_path: str) ServiceResponse[source]
    +agentscope.service.move_directory(source_path: str, destination_path: str) ServiceResponse[source]

    Move a directory from a source path to a destination path.

    Parameters:
    @@ -404,7 +423,7 @@
    -agentscope.service.list_directory_content(directory_path: str) ServiceResponse[source]
    +agentscope.service.list_directory_content(directory_path: str) ServiceResponse[source]

    List the contents of a directory. i.e. ls -a

    Parameters:
    @@ -422,7 +441,7 @@
    -agentscope.service.get_current_directory() ServiceResponse[source]
    +agentscope.service.get_current_directory() ServiceResponse[source]

    Get the current working directory path.

    Returns:
    @@ -437,7 +456,7 @@
    -agentscope.service.read_text_file(file_path: str) ServiceResponse[source]
    +agentscope.service.read_text_file(file_path: str) ServiceResponse[source]

    Read the content of the text file.

    Parameters:
    @@ -456,7 +475,7 @@
    -agentscope.service.write_text_file(file_path: str, content: str, overwrite: bool = False) ServiceResponse[source]
    +agentscope.service.write_text_file(file_path: str, content: str, overwrite: bool = False) ServiceResponse[source]

    Write content to a text file.

    Parameters:
    @@ -478,7 +497,7 @@
    -agentscope.service.read_json_file(file_path: str) ServiceResponse[source]
    +agentscope.service.read_json_file(file_path: str) ServiceResponse[source]

    Read and parse a JSON file.

    Parameters:
    @@ -497,7 +516,7 @@
    -agentscope.service.write_json_file(file_path: str, data: Any, overwrite: bool = False) ServiceResponse[source]
    +agentscope.service.write_json_file(file_path: str, data: Any, overwrite: bool = False) ServiceResponse[source]

    Serialize data to a JSON file.

    Parameters:
    @@ -519,7 +538,7 @@
    +agentscope.service.bing_search(question: str, api_key: str, num_results: int = 10, **kwargs: Any) ServiceResponse[source]

    Search question in Bing Search API and return the searching results

    Parameters:
    @@ -585,7 +604,7 @@
    +agentscope.service.google_search(question: str, api_key: str, cse_id: str, num_results: int = 10, **kwargs: Any) ServiceResponse[source]

    Search question in Google Search API and return the searching results

    Parameters:
    @@ -628,7 +647,7 @@
    +agentscope.service.arxiv_search(search_query: str, id_list: List[str] | None = None, start: int = 0, max_results: int | None = None) ServiceResponse[source]

    Search arXiv paper by a given query string.

    Parameters:
    @@ -657,7 +676,7 @@
    -agentscope.service.query_mysql(database: str, query: str, host: str, user: str, password: str, port: int, allow_change_data: bool = False, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]
    +agentscope.service.query_mysql(database: str, query: str, host: str, user: str, password: str, port: int, allow_change_data: bool = False, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]

    Execute query within MySQL database.

    Parameters:
    @@ -686,7 +705,7 @@
    -agentscope.service.query_sqlite(database: str, query: str, allow_change_data: bool = False, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]
    +agentscope.service.query_sqlite(database: str, query: str, allow_change_data: bool = False, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]

    Executes query within sqlite database.

    Parameters:
    @@ -710,7 +729,7 @@
    -agentscope.service.query_mongodb(database: str, collection: str, query: dict, host: str, port: int, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]
    +agentscope.service.query_mongodb(database: str, collection: str, query: dict, host: str, port: int, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]

    Execute query within MongoDB database.

    Parameters:
    @@ -743,7 +762,7 @@
    -agentscope.service.cos_sim(a: list[Number], b: list[Number]) ServiceResponse[source]
    +agentscope.service.cos_sim(a: list[Number], b: list[Number]) ServiceResponse[source]

    Compute the cosine similarity between two different embeddings

    Parameters:
    @@ -763,7 +782,7 @@
    -agentscope.service.summarization(model: ModelWrapperBase, text: str, system_prompt: str = '\nYou are a helpful agent to summarize the text.\nYou need to keep all the key information of the text in the summary.\n', max_return_token: int = -1, token_limit_prompt: str = '\nSummarize the text after TEXT in less than {} tokens:\n') ServiceResponse[source]
    +agentscope.service.summarization(model: ModelWrapperBase, text: str, system_prompt: str = '\nYou are a helpful agent to summarize the text.\nYou need to keep all the key information of the text in the summary.\n', max_return_token: int = -1, token_limit_prompt: str = '\nSummarize the text after TEXT in less than {} tokens:\n') ServiceResponse[source]

    Summarize the input text.

    Summarization function (Notice: current version of token limitation is built with Open AI API)

    @@ -814,7 +833,7 @@
    -agentscope.service.retrieve_from_list(query: Any, knowledge: Sequence, score_func: Callable[[Any, Any], float], top_k: int | None = None, embedding_model: ModelWrapperBase | None = None, preserve_order: bool = True) ServiceResponse[source]
    +agentscope.service.retrieve_from_list(query: Any, knowledge: Sequence, score_func: Callable[[Any, Any], float], top_k: int | None = None, embedding_model: ModelWrapperBase | None = None, preserve_order: bool = True) ServiceResponse[source]

    Retrieve data in a list.

    Memory retrieval with user-defined score function. The score function is expected to take the query and one of the element in ‘knowledge’ (a @@ -844,7 +863,7 @@

    -agentscope.service.digest_webpage(web_text_or_url: str, model: ModelWrapperBase | None = None, html_selected_tags: Sequence[str] = ('h', 'p', 'li', 'div', 'a'), digest_prompt: str = "You're a web page analyser. You job is to extract importantand useful information from html or webpage description.\n") ServiceResponse[source]
    +agentscope.service.digest_webpage(web_text_or_url: str, model: ModelWrapperBase | None = None, html_selected_tags: Sequence[str] = ('h', 'p', 'li', 'div', 'a'), digest_prompt: str = "You're a web page analyser. You job is to extract importantand useful information from html or webpage description.\n") ServiceResponse[source]

    Digest the given webpage.

    Parameters:
    @@ -869,7 +888,7 @@
    -agentscope.service.load_web(url: str, keep_raw: bool = True, html_selected_tags: Sequence[str] | None = None, self_parse_func: Callable[[Response], Any] | None = None, timeout: int = 5) ServiceResponse[source]
    +agentscope.service.load_web(url: str, keep_raw: bool = True, html_selected_tags: Sequence[str] | None = None, self_parse_func: Callable[[Response], Any] | None = None, timeout: int = 5) ServiceResponse[source]

    Function for parsing and digesting the web page.

    Parameters:
    @@ -941,7 +960,7 @@
    -agentscope.service.download_from_url(url: str, filepath: str, timeout: int = 120, retries: int = 3) ServiceResponse[source]
    +agentscope.service.download_from_url(url: str, filepath: str, timeout: int = 120, retries: int = 3) ServiceResponse[source]

    Download file from the given url to the specified location.

    Parameters:
    diff --git a/en/agentscope.service.retrieval.html b/en/agentscope.service.retrieval.html index 68f321181..03c06441e 100644 --- a/en/agentscope.service.retrieval.html +++ b/en/agentscope.service.retrieval.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/agentscope.service.retrieval.retrieval_from_list.html b/en/agentscope.service.retrieval.retrieval_from_list.html new file mode 100644 index 000000000..0c16155d6 --- /dev/null +++ b/en/agentscope.service.retrieval.retrieval_from_list.html @@ -0,0 +1,159 @@ + + + + + + + + agentscope.service.retrieval.retrieval_from_list — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.retrieval.retrieval_from_list

    +

    Retrieve service working with memory specially.

    +
    +
    +agentscope.service.retrieval.retrieval_from_list.retrieve_from_list(query: Any, knowledge: Sequence, score_func: Callable[[Any, Any], float], top_k: int | None = None, embedding_model: ModelWrapperBase | None = None, preserve_order: bool = True) ServiceResponse[source]
    +

    Retrieve data in a list.

    +

    Memory retrieval with user-defined score function. The score function is +expected to take the query and one of the element in ‘knowledge’ (a +list). This function retrieves top-k elements in ‘knowledge’ with +HIGHEST scores. If the ‘query’ is a dict but has no embedding, +we use the embedding model to embed the query.

    +
    +
    Parameters:
    +
      +
    • query (Any) – A message to be retrieved.

    • +
    • knowledge (Sequence) – Data/knowledge to be retrieved from.

    • +
    • score_func (Callable[[Any, Any], float]) – User-defined function for comparing two messages.

    • +
    • top_k (int, defaults to None) – Maximum number of messages returned.

    • +
    • embedding_model (Optional[ModelWrapperBase], defaults to None) – A model to embed the query/message.

    • +
    • preserve_order (bool, defaults to True) – Whether to preserve the original order of the retrieved data. +Defaults to True.

    • +
    +
    +
    Returns:
    +

    The top-k retrieved messages with HIGHEST scores.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.retrieval.similarity.html b/en/agentscope.service.retrieval.similarity.html new file mode 100644 index 000000000..570e43307 --- /dev/null +++ b/en/agentscope.service.retrieval.similarity.html @@ -0,0 +1,149 @@ + + + + + + + + agentscope.service.retrieval.similarity — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.retrieval.similarity

    +

    Similarity functions for retrieval

    +
    +
    +agentscope.service.retrieval.similarity.cos_sim(a: list[Number], b: list[Number]) ServiceResponse[source]
    +

    Compute the cosine similarity between two different embeddings

    +
    +
    Parameters:
    +
      +
    • a (Embedding) – Embedding

    • +
    • b (Embedding) – Embedding

    • +
    +
    +
    Returns:
    +

    A float.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.service_factory.html b/en/agentscope.service.service_factory.html new file mode 100644 index 000000000..68e7cb74a --- /dev/null +++ b/en/agentscope.service.service_factory.html @@ -0,0 +1,177 @@ + + + + + + + + agentscope.service.service_factory — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.service_factory

    +

    Service factory for model prompt.

    +
    +
    +class agentscope.service.service_factory.ServiceFactory[source]
    +

    Bases: object

    +

    A service factory class that turns service function into string +prompt format.

    +
    +
    +classmethod get(service_func: Callable[[...], Any], **kwargs: Any) Tuple[Callable[[...], Any], dict][source]
    +

    Covnert a service function into a tool function that agent can +use, and generate a dictionary in JSON Schema format that can be +used in OpenAI API directly. While for open-source model, developers +should handle the conversation from json dictionary to prompt.

    +
    +
    Parameters:
    +
      +
    • service_func (Callable[…, Any]) – The service function to be called.

    • +
    • kwargs (Any) – The arguments to be passed to the service function.

    • +
    +
    +
    Returns:
    +

    A tuple of tool function and +a dict in JSON Schema format to describe the function.

    +
    +
    Return type:
    +

    Tuple(Callable[…, Any], dict)

    +
    +
    +
    +

    Note

    +

    The description of the function and arguments are extracted from +its docstring automatically, which should be well-formatted in +Google style. Otherwise, their descriptions in the returned +dictionary will be empty.

    +
    +
    +
    Suggestions:

    1. The name of the service function should be self-explanatory, +so that the agent can understand the function and use it properly. +2. The typing of the arguments should be provided when defining +the function (e.g. def func(a: int, b: str, c: bool)), so that +the agent can specify the arguments properly.

    +
    +
    +

    Example:

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.service_response.html b/en/agentscope.service.service_response.html new file mode 100644 index 000000000..e73659e4f --- /dev/null +++ b/en/agentscope.service.service_response.html @@ -0,0 +1,153 @@ + + + + + + + + agentscope.service.service_response — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.service_response

    +

    Service response module

    +
    +
    +class agentscope.service.service_response.ServiceResponse(status: ServiceExecStatus, content: Any)[source]
    +

    Bases: dict

    +

    Used to wrap the execution results of the services

    +
    +
    +__init__(status: ServiceExecStatus, content: Any)[source]
    +

    Constructor of ServiceResponse

    +
    +
    Parameters:
    +
      +
    • status (ServiceExeStatus) – The execution status of the service.

    • +
    • content (Any) – If the argument`status` is SUCCESS, content is the +response. We use object here to support various objects, +e.g. str, dict, image, video, etc. +Otherwise, content is the error message.

    • +
    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.service_status.html b/en/agentscope.service.service_status.html new file mode 100644 index 000000000..173dac88d --- /dev/null +++ b/en/agentscope.service.service_status.html @@ -0,0 +1,146 @@ + + + + + + + + agentscope.service.service_status — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.service_status

    +

    Enum for service execution status.

    +
    +
    +class agentscope.service.service_status.ServiceExecStatus(value)[source]
    +

    Bases: IntEnum

    +

    Enum for service execution status.

    +
    +
    +SUCCESS = 1
    +
    + +
    +
    +ERROR = -1
    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.sql_query.html b/en/agentscope.service.sql_query.html index 1bf22c196..1f96b159b 100644 --- a/en/agentscope.service.sql_query.html +++ b/en/agentscope.service.sql_query.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/agentscope.service.sql_query.mongodb.html b/en/agentscope.service.sql_query.mongodb.html new file mode 100644 index 000000000..ecfa88b1b --- /dev/null +++ b/en/agentscope.service.sql_query.mongodb.html @@ -0,0 +1,162 @@ + + + + + + + + agentscope.service.sql_query.mongodb — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.sql_query.mongodb

    +

    query in MongoDB

    +
    +
    +agentscope.service.sql_query.mongodb.query_mongodb(database: str, collection: str, query: dict, host: str, port: int, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]
    +

    Execute query within MongoDB database.

    +
    +
    Parameters:
    +
      +
    • database (str) – The name of the database to use.

    • +
    • collection (str) – The name of the collection to use in mongodb.

    • +
    • query (dict) – The mongodb query to execute.

    • +
    • host (str) – The hostname or IP address of the MongoDB server.

    • +
    • port (int) – The port number of MongoDB server.

    • +
    • maxcount_results (int, defaults to None) – The maximum number of results to return. Defaults to 100 to +avoid too many results.

    • +
    • **kwargs

    • +
    +
    +
    Returns:
    +

    A ServiceResponse object that contains execution +results or error message.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    +

    Note

    +

    MongoDB is a little different from mysql and sqlite, for its +operations corresponds to different functions. Now we only support +find query and leave other operations in the future.

    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.sql_query.mysql.html b/en/agentscope.service.sql_query.mysql.html new file mode 100644 index 000000000..1b98a23af --- /dev/null +++ b/en/agentscope.service.sql_query.mysql.html @@ -0,0 +1,158 @@ + + + + + + + + agentscope.service.sql_query.mysql — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.sql_query.mysql

    +

    query in Mysql

    +
    +
    +agentscope.service.sql_query.mysql.query_mysql(database: str, query: str, host: str, user: str, password: str, port: int, allow_change_data: bool = False, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]
    +

    Execute query within MySQL database.

    +
    +
    Parameters:
    +
      +
    • database (str) – The name of the database to use.

    • +
    • query (str) – SQL query to execute.

    • +
    • host (str) – The host name or IP address of the MySQL server, e.g. “localhost”.

    • +
    • user (str) – The username of the MySQL account to use.

    • +
    • password (str) – The password of the MySQL account to use.

    • +
    • port (str) – The port number of the MySQL server, e.g. 3306.

    • +
    • allow_change_data (bool, defaults to False) – Whether to allow changing data in the database. Defaults to +False to avoid accidental changes to the database.

    • +
    • maxcount_results (int, defaults to None) – The maximum number of results to return. Defaults to 100 to +avoid too many results.

    • +
    +
    +
    Returns:
    +

    A ServiceResponse object that contains +execution results or error message.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.sql_query.sqlite.html b/en/agentscope.service.sql_query.sqlite.html new file mode 100644 index 000000000..62853d186 --- /dev/null +++ b/en/agentscope.service.sql_query.sqlite.html @@ -0,0 +1,153 @@ + + + + + + + + agentscope.service.sql_query.sqlite — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.sql_query.sqlite

    +

    Query in sqlite

    +
    +
    +agentscope.service.sql_query.sqlite.query_sqlite(database: str, query: str, allow_change_data: bool = False, maxcount_results: int | None = None, **kwargs: Any) ServiceResponse[source]
    +

    Executes query within sqlite database.

    +
    +
    Parameters:
    +
      +
    • database (str) – The name of the database to use.

    • +
    • query (str) – The query to execute.

    • +
    • allow_change_data (bool, defaults to False) – Whether to allow changing data in the database. Defaults to +False to avoid accidental changes to the database.

    • +
    • maxcount_results (int, defaults to None) – The maximum number of results to return.

    • +
    +
    +
    Returns:
    +

    A ServiceResponse object that contains +execution results or error message.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.text_processing.html b/en/agentscope.service.text_processing.html index 2ab785a8a..bb1c6abe2 100644 --- a/en/agentscope.service.text_processing.html +++ b/en/agentscope.service.text_processing.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/agentscope.service.text_processing.summarization.html b/en/agentscope.service.text_processing.summarization.html new file mode 100644 index 000000000..3ce4c207a --- /dev/null +++ b/en/agentscope.service.text_processing.summarization.html @@ -0,0 +1,180 @@ + + + + + + + + agentscope.service.text_processing.summarization — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.text_processing.summarization

    +

    Service for text processing

    +
    +
    +agentscope.service.text_processing.summarization.summarization(model: ModelWrapperBase, text: str, system_prompt: str = '\nYou are a helpful agent to summarize the text.\nYou need to keep all the key information of the text in the summary.\n', max_return_token: int = -1, token_limit_prompt: str = '\nSummarize the text after TEXT in less than {} tokens:\n') ServiceResponse[source]
    +

    Summarize the input text.

    +

    Summarization function (Notice: current version of token limitation is +built with Open AI API)

    +
    +
    Parameters:
    +
      +
    • model (ModelWrapperBase) – Model used to summarize provided text.

    • +
    • text (str) – Text to be summarized by the model.

    • +
    • system_prompt (str, defaults to _DEFAULT_SYSTEM_PROMPT) – Prompts as instruction for the system, will be as an instruction +for the model.

    • +
    • max_return_token (int, defaults to -1) – Whether provide additional prompting instruction to limit the +number of tokens in summarization returned by the model.

    • +
    • token_limit_prompt (str, defaults to _DEFAULT_TOKEN_LIMIT_PROMPT) – Prompt to instruct the model follow token limitation.

    • +
    +
    +
    Returns:
    +

    If the model successfully summarized the text, and +the summarization satisfies the provided token limitation, return +ServiceResponse with ServiceExecStatus.SUCCESS; otherwise return +ServiceResponse with ServiceExecStatus.ERROR (if the summary is +return successfully but exceed the token limits, the content +contains the summary as well).

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +

    Example:

    +

    The default message with text to be summarized:

    +
    [
    +    {
    +        "role": "system",
    +        "name": "system",
    +        "content": "You are a helpful agent to summarize the text.\
    +        You need to keep all the key information of the text in the\
    +        summary."
    +    },
    +    {
    +        "role": "user",
    +        "name": "user",
    +        "content": text
    +    },
    +]
    +
    +
    +

    Messages will be processed by model.format() before feeding to models.

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.web.arxiv.html b/en/agentscope.service.web.arxiv.html new file mode 100644 index 000000000..7485da114 --- /dev/null +++ b/en/agentscope.service.web.arxiv.html @@ -0,0 +1,159 @@ + + + + + + + + agentscope.service.web.arxiv — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.web.arxiv

    +

    Search papers in arXiv API. This implementation refers to the repository +https://github.com/lukasschwab/arxiv.py, which is MIT licensed.

    +
    + +

    Search arXiv paper by a given query string.

    +
    +
    Parameters:
    +
      +
    • search_query (str) – The query string, supporting prefixes “all:”, “ti:”, “au:”, +“abs:”, “co:”, “jr:”, “cat:”, and “rn:”, boolean operators “AND”, +“OR” and “ANDNOT”. For example, searching for papers with +title “Deep Learning” and author “LeCun” by a +search_query ti:”Deep Learning” AND au:”LeCun”

    • +
    • id_list (List[str], defaults to None) – A list of arXiv IDs to search.

    • +
    • start (int, defaults to 0) – The index of the first search result to return.

    • +
    • max_results (Optional[int], defaults to None) – The maximum number of search results to return.

    • +
    +
    +
    Returns:
    +

    A dictionary with two variables: status and +content. The status variable is from the ServiceExecStatus enum, +and content is a list of search results or error information, +which depends on the status variable.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.web.download.html b/en/agentscope.service.web.download.html new file mode 100644 index 000000000..2c668b181 --- /dev/null +++ b/en/agentscope.service.web.download.html @@ -0,0 +1,152 @@ + + + + + + + + agentscope.service.web.download — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.web.download

    +

    Download file from URL.

    +
    +
    +agentscope.service.web.download.download_from_url(url: str, filepath: str, timeout: int = 120, retries: int = 3) ServiceResponse[source]
    +

    Download file from the given url to the specified location.

    +
    +
    Parameters:
    +
      +
    • url (str) – The URL of the file to download.

    • +
    • filepath (str) – The path to save the downloaded file.

    • +
    • timeout (int, defaults to 120) – The timeout for the download request.

    • +
    • retries (int, defaults to 3) – The number of retries for the download request.

    • +
    +
    +
    Returns:
    +

    A ServiceResponse object that contains execution +results or error message.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.web.html b/en/agentscope.service.web.html index f758a8b3c..c41954e30 100644 --- a/en/agentscope.service.web.html +++ b/en/agentscope.service.web.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/agentscope.service.web.search.html b/en/agentscope.service.web.search.html new file mode 100644 index 000000000..b59582f6a --- /dev/null +++ b/en/agentscope.service.web.search.html @@ -0,0 +1,238 @@ + + + + + + + + agentscope.service.web.search — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.web.search

    +

    Search question in the web

    +
    + +

    Search question in Bing Search API and return the searching results

    +
    +
    Parameters:
    +
    +
    +
    Returns:
    +

    A dictionary with two variables: status and +content. The status variable is from the ServiceExecStatus enum, +and content is a list of search results or error information, +which depends on the status variable. +For each searching result, it is a dictionary with keys ‘title’, +‘link’, and ‘snippet’.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +

    Example

    +
    results = bing_search(question="What is an agent?",
    +                     bing_api_key="your bing api key",
    +                     num_results=2,
    +                     mkt="en-US")
    +print(results)
    +
    +
    +

    It returns the following dict.

    +
    {
    +    'status': <ServiceExecStatus.SUCCESS: 1>,
    +    'content': [
    +        {
    +            'title': 'What Is an Agent? Definition, Types of
    +                Agents, and Examples - Investopedia',
    +            'link':
    +            'https://www.investopedia.com/terms/a/agent.asp',
    +            'snippet': "An agent is someone that is given
    +                permission (either explicitly or assumed) to act
    +                on an individual's behalf and may do so in a
    +                variety of capacities. This could include
    +                selling a home, executing..."},
    +        {
    +            'title': 'AGENT Definition & Usage Examples |
    +                        Dictionary.com',
    +            'link': 'https://www.dictionary.com/browse/agent',
    +            'snippet': 'noun. a person who acts on behalf of
    +                another person, group, business, government,
    +                etc; representative. a person or thing that acts
    +                or has the power to act. a phenomenon,
    +                substance, or organism that exerts some force or
    +                effect: a chemical agent.'
    +        }
    +    ]
    +}
    +
    +
    +
    + +
    + +

    Search question in Google Search API and return the searching results

    +
    +
    Parameters:
    +
      +
    • question (str) – The search query string.

    • +
    • api_key (str) – The API key provided for authenticating with the Google Custom +Search JSON API.

    • +
    • cse_id (str) – The unique identifier of a programmable search engine to use.

    • +
    • num_results (int, defaults to 10) – The number of search results to return.

    • +
    • **kwargs (Any) – Additional keyword arguments to be included in the search query. +For more details, please refer to +https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list

    • +
    +
    +
    Returns:
    +

    A dictionary with two variables: status and +content. The status variable is from the ServiceExecStatus enum, +and content is a list of search results or error information, +which depends on the status variable. +For each searching result, it is a dictionary with keys ‘title’, +‘link’, and ‘snippet’.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +

    Example

    +
    results = google_search(
    +    'Python programming',
    +    'your_google_api_key',
    +    'your_cse_id',
    +    num_results=2
    +)
    +if results.status == ServiceExecStatus.SUCCESS:
    +    for result in results.content:
    +        print(result['title'], result['link'], result['snippet'])
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.service.web.web_digest.html b/en/agentscope.service.web.web_digest.html new file mode 100644 index 000000000..ba1d71996 --- /dev/null +++ b/en/agentscope.service.web.web_digest.html @@ -0,0 +1,242 @@ + + + + + + + + agentscope.service.web.web_digest — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.service.web.web_digest

    +

    parsing and digesting the web pages

    +
    +
    +agentscope.service.web.web_digest.is_valid_url(url: str) bool[source]
    +

    Use urlparse to check if a URL is valid +:param url: string to be checked +:type url: str

    +
    +
    Returns:
    +

    True if url is valid, False otherwise

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +agentscope.service.web.web_digest.load_web(url: str, keep_raw: bool = True, html_selected_tags: Sequence[str] | None = None, self_parse_func: Callable[[Response], Any] | None = None, timeout: int = 5) ServiceResponse[source]
    +

    Function for parsing and digesting the web page.

    +
    +
    Parameters:
    +
      +
    • url (str) – the url of the web page

    • +
    • keep_raw (bool) – Whether to keep raw HTML. If True, the content is +stored with key “raw”.

    • +
    • html_selected_tags (Optional[Sequence[str]]) – the text in elements of html_selected_tags will +be extracted and stored with “html_to_text” +key in return.

    • +
    • self_parse_func (Optional[Callable]) – if “self_parse_func” is not None, then the +function will be invoked with the +requests.Response as input. +The result is stored with self_define_func +key

    • +
    • timeout (int) – timeout parameter for requests.

    • +
    +
    +
    Returns:
    +

    If successful, ServiceResponse object is returned +with content field is a dict, where keys are subset of:

    +
    +
    +

    ”raw”: exists if keep_raw is True, store raw HTML content`;

    +

    ”self_define_func”: exists if self_parse_func is provided, +store the return of self_define_func;

    +

    ”html_to_text”: exists if html_selected_tags is provided +and not empty;

    +

    ”json”: exists if url links to a json webpage, then it is +parsed as json.

    +
    +

    For example, ServiceResponse.content field is

    +
    +
    {
    +    "raw": xxxxx,
    +    "selected_tags_text": xxxxx
    +}
    +
    +
    +

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.web.web_digest.parse_html_to_text(html_text: str, html_selected_tags: Sequence[str] | None = None) str[source]
    +

    Parse the obtained HTML file.

    +
    +
    Parameters:
    +
      +
    • html_text (str) – HTML source code

    • +
    • html_selected_tags (Optional[Sequence[str]]) – the text in elements of html_selected_tags will +be extracted and returned.

    • +
    +
    +
    Returns:
    +

    If successful, ServiceResponse object is returned +with content field is processed text content of the selected tags,

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    +
    +agentscope.service.web.web_digest.digest_webpage(web_text_or_url: str, model: ModelWrapperBase | None = None, html_selected_tags: Sequence[str] = ('h', 'p', 'li', 'div', 'a'), digest_prompt: str = "You're a web page analyser. You job is to extract importantand useful information from html or webpage description.\n") ServiceResponse[source]
    +

    Digest the given webpage.

    +
    +
    Parameters:
    +
      +
    • web_text_or_url (str) – preprocessed web text or url to the web page

    • +
    • model (ModelWrapperBase) – the model to digest the web content

    • +
    • html_selected_tags (Sequence[str]) – the text in elements of html_selected_tags will +be extracted and feed to the model

    • +
    • digest_prompt (str) – system prompt for the model to digest +the web content

    • +
    +
    +
    Returns:
    +

    If successful, ServiceResponse object is returned +with content field filled with the model output.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.utils.common.html b/en/agentscope.utils.common.html new file mode 100644 index 000000000..8d6938396 --- /dev/null +++ b/en/agentscope.utils.common.html @@ -0,0 +1,227 @@ + + + + + + + + agentscope.utils.common — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.utils.common

    +

    Common utils.

    +
    +
    +agentscope.utils.common.timer(seconds: int | float | None = None) Generator[source]
    +

    A context manager that limits the execution time of a code block to a +given number of seconds. +The implementation of this contextmanager are borrowed from +https://github.com/openai/human-eval/blob/master/human_eval/execution.py

    +
    +

    Note

    +

    This function only works in Unix and MainThread, +since signal.setitimer is only available in Unix.

    +
    +
    + +
    +
    +agentscope.utils.common.create_tempdir() Generator[source]
    +

    A context manager that creates a temporary directory and changes the +current working directory to it. +The implementation of this contextmanager are borrowed from +https://github.com/openai/human-eval/blob/master/human_eval/execution.py

    +
    + +
    +
    +agentscope.utils.common.chdir(path: str) Generator[source]
    +

    A context manager that changes the current working directory to the +given path. +The implementation of this contextmanager are borrowed from +https://github.com/openai/human-eval/blob/master/human_eval/execution.py

    +
    + +
    +
    +agentscope.utils.common.write_file(content: str, file_path: str) ServiceResponse[source]
    +

    Write content to a file.

    +
    +
    Parameters:
    +
      +
    • content (str) – The content to be written to the file.

    • +
    • file_path (str) – The path to the file where the content will be +written.

    • +
    +
    +
    Returns:
    +

    where the boolean indicates the success of the +operation, and the str contains an empty string if successful or an +error message if any, including the error type.

    +
    +
    Return type:
    +

    ServiceResponse

    +
    +
    +

    This function attempts to open the file in write mode and write the +provided content to it. If the file does not exist, it will be created. +If the file exists, its content will be overwritten. If a +PermissionError occurs, indicating a lack of necessary permissions, +or an IOError occurs, signaling additional issues such as an invalid +file path or hardware-related I/O error, the function will catch the +exception and return False along with the error message.

    +
    + +
    +
    +agentscope.utils.common.requests_get(url: str, params: dict, headers: dict | None = None) dict | str[source]
    +

    Sends a GET request to the specified URL with the provided query parameters +and headers. Returns the JSON response as a dictionary.

    +
    +
    This function handles the request, checks for errors, logs exceptions,

    and parses the JSON response.

    +
    +
    +
    +
    Parameters:
    +
      +
    • url (str) – The URL to which the GET request is sent.

    • +
    • params (Dict) – A dictionary containing query parameters to be included +in the request.

    • +
    • headers (Optional[Dict]) – An optional dictionary of HTTP headers to +send with the request.

    • +
    +
    +
    Returns:
    +

    If the request is successful, returns a dictionary containing the +parsed JSON data. +If the request fails, returns the error string.

    +
    +
    Return type:
    +

    Dict or str

    +
    +
    +
    + +
    +
    +agentscope.utils.common.if_change_database(sql_query: str) bool[source]
    +

    Check whether SQL query only contains SELECT query

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.utils.html b/en/agentscope.utils.html index 6423211c4..44a7540c1 100644 --- a/en/agentscope.utils.html +++ b/en/agentscope.utils.html @@ -23,8 +23,7 @@ - - + @@ -58,12 +57,16 @@

    AgentScope API Reference

    @@ -381,6 +382,17 @@ exception agentscope.utils.QuotaExceededError(name: str)[source]

    Bases: Exception

    An Exception used to indicate that a certain metric exceeds quota

    +
    +
    +__init__(name: str) None[source]
    +

    Init a QuotaExceedError instance.

    +
    +
    Parameters:
    +

    name (str) – name of the metric which exceeds quota.

    +
    +
    +
    +
    @@ -395,7 +407,7 @@
    -classmethod get_monitor(impl_type: str | None = None, db_path: str = 'agentscope.db') MonitorBase[source]
    +classmethod get_monitor(impl_type: str | None = None, db_path: str = 'agentscope.db') MonitorBase[source]

    Get the monitor instance.

    Parameters:
    @@ -429,8 +441,7 @@

    diff --git a/en/agentscope.utils.logging_utils.html b/en/agentscope.utils.logging_utils.html new file mode 100644 index 000000000..15ad5c47b --- /dev/null +++ b/en/agentscope.utils.logging_utils.html @@ -0,0 +1,161 @@ + + + + + + + + agentscope.utils.logging_utils — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.utils.logging_utils

    +

    Logging utilities.

    +
    +
    +agentscope.utils.logging_utils.log_studio(message: dict, uid: str, **kwargs: Any) None[source]
    +

    Send chat message to studio.

    +
    +
    Parameters:
    +
      +
    • message (dict) – The message to be logged. It should have “name”(or “role”) and +“content” keys, and the message will be logged as “<name/role>: +<content>”.

    • +
    • uid (str) – The local value ‘uid’ of the thread.

    • +
    +
    +
    +
    + +
    +
    +agentscope.utils.logging_utils.setup_logger(path_log: str | None = None, level: Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO') None[source]
    +

    Setup loguru.logger and redirect stderr to logging.

    +
    +
    Parameters:
    +
      +
    • path_log (str, defaults to “”) – The directory of log files.

    • +
    • level (str, defaults to “INFO”) – The logging level, which is one of the following: “TRACE”, +“DEBUG”, “INFO”, “SUCCESS”, “WARNING”, “ERROR”, +“CRITICAL”.

    • +
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.utils.monitor.html b/en/agentscope.utils.monitor.html new file mode 100644 index 000000000..8ccd5c759 --- /dev/null +++ b/en/agentscope.utils.monitor.html @@ -0,0 +1,774 @@ + + + + + + + + agentscope.utils.monitor — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.utils.monitor

    +

    Monitor for agentscope

    +
    +
    +class agentscope.utils.monitor.MonitorBase[source]
    +

    Bases: ABC

    +

    Base interface of Monitor

    +
    +
    +abstract register(metric_name: str, metric_unit: str | None = None, quota: float | None = None) bool[source]
    +

    Register a metric to the monitor with value initialized to 0.

    +
    +
    Parameters:
    +
      +
    • metric_name (str) – Name of the metric, must be unique.

    • +
    • metric_unit (Optional[str]) – Unit of the metric.

    • +
    • quota (Optional[str]) – The quota of the metric. An alert is triggered when metrics +accumulate above this value.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +abstract exists(metric_name: str) bool[source]
    +

    Determine whether a metric exists in the monitor.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    Whether the metric exists.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +abstract add(metric_name: str, value: float) bool[source]
    +

    Add value to a specific metric.

    +
    +
    Parameters:
    +
      +
    • metric_name (str) – Name of the metric.

    • +
    • value (float) – Increased value.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +update(values: dict, prefix: str | None = None) None[source]
    +

    Update multiple metrics at once.

    +
    + +
    +
    +abstract clear(metric_name: str) bool[source]
    +

    Clear the values of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +abstract remove(metric_name: str) bool[source]
    +

    Remove a specific metric from the monitor.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    Whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +abstract get_value(metric_name: str) float | None[source]
    +

    Get the value of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    the value of the metric.

    +
    +
    Return type:
    +

    Optional[float]

    +
    +
    +
    + +
    +
    +abstract get_unit(metric_name: str) str | None[source]
    +

    Get the unit of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    The unit of the metric.

    +
    +
    Return type:
    +

    Optional[str]

    +
    +
    +
    + +
    +
    +abstract get_quota(metric_name: str) float | None[source]
    +

    Get the quota of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    The quota of the metric.

    +
    +
    Return type:
    +

    Optional[float]

    +
    +
    +
    + +
    +
    +abstract set_quota(metric_name: str, quota: float) bool[source]
    +

    Set the quota of a specific metric

    +
    +
    Parameters:
    +
      +
    • metric_name (str) – Name of the metric.

    • +
    • quota (float) – New quota of the metric.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +abstract get_metric(metric_name: str) dict | None[source]
    +

    Get the specific metric

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    A dictionary of metric with following format:

    +
    {
    +    metric_value: [float],
    +    metric_unit: [str],
    +    quota: [float]
    +}
    +
    +
    +

    +
    +
    Return type:
    +

    Optional[dict]

    +
    +
    +
    + +
    +
    +abstract get_metrics(filter_regex: str | None = None) dict[source]
    +

    Get a dictionary of metrics.

    +
    +
    Parameters:
    +

    filter_regex (Optional[str]) – Regular expression for filtering metric names, get all +metrics if not provided.

    +
    +
    Returns:
    +

    a dictionary of metric with following format:

    +
    {
    +    metric_name_A: {
    +        metric_value: [float],
    +        metric_unit: [str],
    +        quota: [float]
    +    },
    +    metric_name_B: {
    +        ...
    +    },
    +    ...
    +}
    +
    +
    +

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +abstract register_budget(model_name: str, value: float, prefix: str | None = 'local') bool[source]
    +

    Register model call budget to the monitor, the monitor will raise +QuotaExceededError, when budget is exceeded.

    +
    +
    Parameters:
    +
      +
    • model_name (str) – model that requires budget.

    • +
    • value (float) – the budget value.

    • +
    • prefix (Optional[str], default None) – used to distinguish +multiple budget registrations. For multiple registrations with +the same prefix, only the first time will take effect.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    + +
    +
    +agentscope.utils.monitor.get_full_name(name: str, prefix: str | None = None) str[source]
    +

    Get the full name of a metric.

    +
    +
    Parameters:
    +
      +
    • metric_name (str) – name of a metric.

    • +
    • prefix (` Optional[str]`, default None) – metric prefix.

    • +
    +
    +
    Returns:
    +

    the full name of the metric

    +
    +
    Return type:
    +

    str

    +
    +
    +
    + +
    +
    +exception agentscope.utils.monitor.QuotaExceededError(name: str)[source]
    +

    Bases: Exception

    +

    An Exception used to indicate that a certain metric exceeds quota

    +
    +
    +__init__(name: str) None[source]
    +

    Init a QuotaExceedError instance.

    +
    +
    Parameters:
    +

    name (str) – name of the metric which exceeds quota.

    +
    +
    +
    + +
    + +
    +
    +agentscope.utils.monitor.sqlite_transaction(db_path: str, timeout: float = 30.0) Generator[source]
    +

    Get a sqlite transaction cursor.

    +
    +
    Parameters:
    +
      +
    • db_path (str) – path to the sqlite db file

    • +
    • timeout (float) – timeout of the connection

    • +
    +
    +
    Yields:
    +

    Generator – a cursor with transaction

    +
    +
    +
    + +
    +
    +agentscope.utils.monitor.sqlite_cursor(db_path: str, timeout: float = 30.0) Generator[source]
    +

    Get a sqlite cursor.

    +
    +
    Parameters:
    +
      +
    • db_path (str) – path to the sqlite db file

    • +
    • timeout (float) – timeout of the connection

    • +
    +
    +
    Yields:
    +

    Generator – a cursor

    +
    +
    +
    + +
    +
    +class agentscope.utils.monitor.SqliteMonitor(db_path: str, table_name: str = 'monitor_metrics', drop_exists: bool = False)[source]
    +

    Bases: MonitorBase

    +

    A monitor based on sqlite

    +
    +
    +__init__(db_path: str, table_name: str = 'monitor_metrics', drop_exists: bool = False) None[source]
    +

    Initialize a SqliteMonitor.

    +
    +
    Parameters:
    +
      +
    • db_path (str) – path to the sqlite db file.

    • +
    • table_name (str, optional) – the table name used by the monitor. +Defaults to _DEFAULT_MONITOR_TABLE_NAME.

    • +
    • drop_exists (bool, optional) – whether to delete the original table

    • +
    • False. (when the table already exists. Defaults to)

    • +
    +
    +
    +
    + +
    +
    +register(metric_name: str, metric_unit: str | None = None, quota: float | None = None) bool[source]
    +

    Register a metric to the monitor with value initialized to 0.

    +
    +
    Parameters:
    +
      +
    • metric_name (str) – Name of the metric, must be unique.

    • +
    • metric_unit (Optional[str]) – Unit of the metric.

    • +
    • quota (Optional[str]) – The quota of the metric. An alert is triggered when metrics +accumulate above this value.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +add(metric_name: str, value: float) bool[source]
    +

    Add value to a specific metric.

    +
    +
    Parameters:
    +
      +
    • metric_name (str) – Name of the metric.

    • +
    • value (float) – Increased value.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +clear(metric_name: str) bool[source]
    +

    Clear the values of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +remove(metric_name: str) bool[source]
    +

    Remove a specific metric from the monitor.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    Whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +get_value(metric_name: str) float | None[source]
    +

    Get the value of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    the value of the metric.

    +
    +
    Return type:
    +

    Optional[float]

    +
    +
    +
    + +
    +
    +get_quota(metric_name: str) float | None[source]
    +

    Get the quota of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    The quota of the metric.

    +
    +
    Return type:
    +

    Optional[float]

    +
    +
    +
    + +
    +
    +set_quota(metric_name: str, quota: float) bool[source]
    +

    Set the quota of a specific metric

    +
    +
    Parameters:
    +
      +
    • metric_name (str) – Name of the metric.

    • +
    • quota (float) – New quota of the metric.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +get_unit(metric_name: str) str | None[source]
    +

    Get the unit of a specific metric.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    The unit of the metric.

    +
    +
    Return type:
    +

    Optional[str]

    +
    +
    +
    + +
    +
    +get_metric(metric_name: str) dict | None[source]
    +

    Get the specific metric

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    A dictionary of metric with following format:

    +
    {
    +    metric_value: [float],
    +    metric_unit: [str],
    +    quota: [float]
    +}
    +
    +
    +

    +
    +
    Return type:
    +

    Optional[dict]

    +
    +
    +
    + +
    +
    +get_metrics(filter_regex: str | None = None) dict[source]
    +

    Get a dictionary of metrics.

    +
    +
    Parameters:
    +

    filter_regex (Optional[str]) – Regular expression for filtering metric names, get all +metrics if not provided.

    +
    +
    Returns:
    +

    a dictionary of metric with following format:

    +
    {
    +    metric_name_A: {
    +        metric_value: [float],
    +        metric_unit: [str],
    +        quota: [float]
    +    },
    +    metric_name_B: {
    +        ...
    +    },
    +    ...
    +}
    +
    +
    +

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +exists(metric_name: str) bool[source]
    +

    Determine whether a metric exists in the monitor.

    +
    +
    Parameters:
    +

    metric_name (str) – Name of the metric.

    +
    +
    Returns:
    +

    Whether the metric exists.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +update(values: dict, prefix: str | None = None) None[source]
    +

    Update multiple metrics at once.

    +
    + +
    +
    +register_budget(model_name: str, value: float, prefix: str | None = None) bool[source]
    +

    Register model call budget to the monitor, the monitor will raise +QuotaExceededError, when budget is exceeded.

    +
    +
    Parameters:
    +
      +
    • model_name (str) – model that requires budget.

    • +
    • value (float) – the budget value.

    • +
    • prefix (Optional[str], default None) – used to distinguish +multiple budget registrations. For multiple registrations with +the same prefix, only the first time will take effect.

    • +
    +
    +
    Returns:
    +

    whether the operation success.

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    + +
    +
    +class agentscope.utils.monitor.MonitorFactory[source]
    +

    Bases: object

    +

    Factory of Monitor.

    +

    Get the singleton monitor using:

    +
    from agentscope.utils import MonitorFactory
    +monitor = MonitorFactory.get_monitor()
    +
    +
    +
    +
    +classmethod get_monitor(impl_type: str | None = None, db_path: str = 'agentscope.db') MonitorBase[source]
    +

    Get the monitor instance.

    +
    +
    Parameters:
    +
      +
    • impl_type (Optional[str], optional) – the type of monitor, +currently supports sqlite only.

    • +
    • db_path (Optional[str], optional) – path to the sqlite db file.

    • +
    +
    +
    Returns:
    +

    the monitor instance.

    +
    +
    Return type:
    +

    MonitorBase

    +
    +
    +
    + +
    +
    +classmethod flush() None[source]
    +

    Only for unittest usage. Don’t use this function in your code. +Flush the monitor singleton.

    +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.utils.token_utils.html b/en/agentscope.utils.token_utils.html new file mode 100644 index 000000000..b404e9c89 --- /dev/null +++ b/en/agentscope.utils.token_utils.html @@ -0,0 +1,147 @@ + + + + + + + + agentscope.utils.token_utils — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.utils.token_utils

    +

    Token utils.

    +
    +
    +agentscope.utils.token_utils.get_openai_max_length(model_name: str) int[source]
    +

    Get the max length of the OpenAi models.

    +
    + +
    +
    +agentscope.utils.token_utils.count_openai_token(content: str | list, model: str) int[source]
    +

    Count token in format of OpenAI API

    +
    + +
    +
    +agentscope.utils.token_utils.num_tokens_from_content(content: list, model: str) int[source]
    +

    Count token in format of OpenAI Chat API

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.utils.tools.html b/en/agentscope.utils.tools.html new file mode 100644 index 000000000..e5890f34f --- /dev/null +++ b/en/agentscope.utils.tools.html @@ -0,0 +1,141 @@ + + + + + + + + agentscope.utils.tools — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.utils.tools

    +

    Tools for agentscope

    +
    +
    +agentscope.utils.tools.to_openai_dict(item: dict) dict[source]
    +

    Convert Msg to dict for OpenAI API.

    +
    + +
    +
    +agentscope.utils.tools.to_dialog_str(item: dict) str[source]
    +

    Convert a dict into string prompt style.

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.web.html b/en/agentscope.web.html index e199df577..aa8db7a77 100644 --- a/en/agentscope.web.html +++ b/en/agentscope.web.html @@ -23,8 +23,8 @@ - - + + @@ -58,18 +58,20 @@

    AgentScope API Reference

    @@ -111,8 +113,8 @@
    diff --git a/en/agentscope.web.studio.studio.html b/en/agentscope.web.studio.studio.html new file mode 100644 index 000000000..56cfcedef --- /dev/null +++ b/en/agentscope.web.studio.studio.html @@ -0,0 +1,183 @@ + + + + + + + + agentscope.web.studio.studio — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.web.studio.studio

    +

    run web ui

    +
    +
    +agentscope.web.studio.studio.init_uid_list() list[source]
    +

    Initialize an empty list for storing user IDs.

    +
    + +
    +
    +agentscope.web.studio.studio.reset_glb_var(uid: str) None[source]
    +

    Reset global variables for a given user ID.

    +
    + +
    +
    +agentscope.web.studio.studio.get_chat(uid: str) list[list][source]
    +

    Retrieve chat messages for a given user ID.

    +
    + +
    +
    +agentscope.web.studio.studio.send_audio(audio_term: str, uid: str) None[source]
    +

    Convert audio input to text and send as a chat message.

    +
    + +
    +
    +agentscope.web.studio.studio.send_image(image_term: str, uid: str) None[source]
    +

    Send an image as a chat message.

    +
    + +
    +
    +agentscope.web.studio.studio.send_message(msg: str, uid: str) str[source]
    +

    Send a generic message to the player.

    +
    + +
    +
    +agentscope.web.studio.studio.fn_choice(data: EventData, uid: str) None[source]
    +

    Handle a selection event from the chatbot interface.

    +
    + +
    +
    +agentscope.web.studio.studio.import_function_from_path(module_path: str, function_name: str, module_name: str | None = None) Callable[source]
    +

    Import a function from the given module path.

    +
    + +
    +
    +agentscope.web.studio.studio.run_app() None[source]
    +

    Entry point for the web UI application.

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.web.studio.utils.html b/en/agentscope.web.studio.utils.html new file mode 100644 index 000000000..df3ebf2ac --- /dev/null +++ b/en/agentscope.web.studio.utils.html @@ -0,0 +1,208 @@ + + + + + + + + agentscope.web.studio.utils — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.web.studio.utils

    +

    web ui utils

    +
    +
    +agentscope.web.studio.utils.init_uid_queues() dict[source]
    +

    Initializes and returns a dictionary of user-specific queues.

    +
    + +
    +
    +agentscope.web.studio.utils.send_msg(msg: str, is_player: bool = False, role: str | None = None, uid: str | None = None, flushing: bool = False, avatar: str | None = None, msg_id: str | None = None) None[source]
    +

    Sends a message to the web UI.

    +
    + +
    +
    +agentscope.web.studio.utils.get_chat_msg(uid: str | None = None) list[source]
    +

    Retrieves the next chat message from the queue, if available.

    +
    + +
    +
    +agentscope.web.studio.utils.send_player_input(msg: str, uid: str | None = None) None[source]
    +

    Sends player input to the web UI.

    +
    + +
    +
    +agentscope.web.studio.utils.get_player_input(timeout: int | None = None, uid: str | None = None) str[source]
    +

    Gets player input from the web UI or command line.

    +
    + +
    +
    +agentscope.web.studio.utils.send_reset_msg(uid: str | None = None) None[source]
    +

    Sends a reset message to the web UI.

    +
    + +
    +
    +agentscope.web.studio.utils.get_reset_msg(uid: str | None = None) None[source]
    +

    Retrieves a reset message from the queue, if available.

    +
    + +
    +
    +exception agentscope.web.studio.utils.ResetException[source]
    +

    Bases: Exception

    +

    Custom exception to signal a reset action in the application.

    +
    + +
    +
    +agentscope.web.studio.utils.check_uuid(uid: str | None) str[source]
    +

    Checks whether a UUID is provided or generates a default one.

    +
    + +
    +
    +agentscope.web.studio.utils.generate_image_from_name(name: str) str[source]
    +

    Generates an image based on the hash of the given name.

    +
    + +
    +
    +agentscope.web.studio.utils.audio2text(audio_path: str) str[source]
    +

    Converts audio file at the given path to text using ASR.

    +
    + +
    +
    +agentscope.web.studio.utils.cycle_dots(text: str, num_dots: int = 3) str[source]
    +

    display thinking dots before agent reply

    +
    + +
    +
    +agentscope.web.studio.utils.user_input(prefix: str = 'User input: ', timeout: int | None = None) str[source]
    +

    get user input

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.web.workstation.html b/en/agentscope.web.workstation.html index 5fbea17ea..ab55e70e4 100644 --- a/en/agentscope.web.workstation.html +++ b/en/agentscope.web.workstation.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/agentscope.web.workstation.workflow.html b/en/agentscope.web.workstation.workflow.html new file mode 100644 index 000000000..8dab8196a --- /dev/null +++ b/en/agentscope.web.workstation.workflow.html @@ -0,0 +1,179 @@ + + + + + + + + agentscope.web.workstation.workflow — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.web.workstation.workflow

    +

    Workflow

    +
    +
    +agentscope.web.workstation.workflow.load_config(config_path: str) dict[source]
    +

    Load a JSON configuration file.

    +
    +
    Parameters:
    +

    config_path – A string path to the JSON configuration file.

    +
    +
    Returns:
    +

    A dictionary containing the loaded configuration.

    +
    +
    +
    + +
    +
    +agentscope.web.workstation.workflow.start_workflow(config: dict) None[source]
    +

    Start the application workflow based on the given configuration.

    +
    +
    Parameters:
    +

    config – A dictionary containing the application configuration.

    +
    +
    +

    This function will initialize and launch the application.

    +
    + +
    +
    +agentscope.web.workstation.workflow.compile_workflow(config: dict, compiled_filename: str = 'main.py') None[source]
    +

    Generates Python code based on the given configuration.

    +
    +
    Parameters:
    +
      +
    • config – A dictionary containing the application configuration.

    • +
    • compiled_filename – complied file name.

    • +
    +
    +
    +
    + +
    +
    +agentscope.web.workstation.workflow.main() None[source]
    +

    Parse command-line arguments and launch the application workflow.

    +

    This function sets up command-line argument parsing and checks if a +configuration file path is provided. If the configuration file is +found, it proceeds to load it and start the workflow.

    +

    If no configuration file is provided, a FileNotFoundError is raised.

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.web.workstation.workflow_dag.html b/en/agentscope.web.workstation.workflow_dag.html new file mode 100644 index 000000000..79db5322f --- /dev/null +++ b/en/agentscope.web.workstation.workflow_dag.html @@ -0,0 +1,271 @@ + + + + + + + + agentscope.web.workstation.workflow_dag — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.web.workstation.workflow_dag

    +

    AgentScope workstation DAG running engine.

    +

    This module defines various workflow nodes that can be used to construct +a computational DAG. Each node represents a step in the DAG and +can perform certain actions when called.

    +
    +
    +agentscope.web.workstation.workflow_dag.remove_duplicates_from_end(lst: list) list[source]
    +

    remove duplicates element from end on a list

    +
    + +
    +
    +class agentscope.web.workstation.workflow_dag.ASDiGraph(*args, **kwargs)[source]
    +

    Bases: DiGraph

    +

    A class that represents a directed graph, extending the functionality of +networkx’s DiGraph to suit specific workflow requirements in AgentScope.

    +

    This graph supports operations such as adding nodes with associated +computations and executing these computations in a topological order.

    +
    +
    +nodes_not_in_graph
    +

    A set of nodes that are not included in

    +
    +
    Type:
    +

    set

    +
    +
    +
    + +
    +
    +the computation graph.
    +
    + +
    +
    +__init__(*args, **kwargs)[source]
    +

    Initialize the ASDiGraph instance.

    +
    + +
    +
    +run() None[source]
    +

    Execute the computations associated with each node in the graph.

    +

    The method initializes AgentScope, performs a topological sort of +the nodes, and then runs each node’s computation sequentially using +the outputs from its predecessors as inputs.

    +
    + +
    +
    +compile(compiled_filename: str = '') str[source]
    +

    Compile DAG to a runnable python code

    +
    + +
    +
    +add_as_node(node_id: str, node_info: dict, config: dict) Any[source]
    +

    Add a node to the graph based on provided node information and +configuration.

    +
    +
    Parameters:
    +
      +
    • node_id (str) – The identifier for the node being added.

    • +
    • node_info (dict) – A dictionary containing information about the +node.

    • +
    • config (dict) – Configuration information for the node dependencies.

    • +
    +
    +
    Returns:
    +

    The computation object associated with the added node.

    +
    +
    +
    + +
    +
    +exec_node(node_id: str, x_in: Any | None = None) Any[source]
    +

    Execute the computation associated with a given node in the graph.

    +
    +
    Parameters:
    +
      +
    • node_id (str) – The identifier of the node whose computation is +to be executed.

    • +
    • x_in – The input to the node’s computation. Defaults to None.

    • +
    +
    +
    Returns:
    +

    The output of the node’s computation.

    +
    +
    +
    + +
    + +
    +
    +agentscope.web.workstation.workflow_dag.sanitize_node_data(raw_info: dict) dict[source]
    +

    Clean and validate node data, evaluating callable expressions where +necessary.

    +

    Processes the raw node information, removes empty arguments, and evaluates +any callable expressions provided as string literals.

    +
    +
    Parameters:
    +

    raw_info (dict) – The raw node information dictionary that may contain +callable expressions as strings.

    +
    +
    Returns:
    +

    +
    The sanitized node information with callable expressions

    evaluated.

    +
    +
    +

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +agentscope.web.workstation.workflow_dag.build_dag(config: dict) ASDiGraph[source]
    +

    Construct a Directed Acyclic Graph (DAG) from the provided configuration.

    +

    Initializes the graph nodes based on the configuration, adds model nodes +first, then non-model nodes, and finally adds edges between the nodes.

    +
    +
    Parameters:
    +

    config (dict) – The configuration to build the graph from, containing +node info such as name, type, arguments, and connections.

    +
    +
    Returns:
    +

    The constructed directed acyclic graph.

    +
    +
    Return type:
    +

    ASDiGraph

    +
    +
    Raises:
    +

    ValueError – If the resulting graph is not acyclic.

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.web.workstation.workflow_node.html b/en/agentscope.web.workstation.workflow_node.html new file mode 100644 index 000000000..f7be8b32e --- /dev/null +++ b/en/agentscope.web.workstation.workflow_node.html @@ -0,0 +1,739 @@ + + + + + + + + agentscope.web.workstation.workflow_node — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.web.workstation.workflow_node

    +

    Workflow node opt.

    +
    +
    +class agentscope.web.workstation.workflow_node.WorkflowNodeType(value)[source]
    +

    Bases: IntEnum

    +

    Enum for workflow node.

    +
    +
    +MODEL = 0
    +
    + +
    +
    +AGENT = 1
    +
    + +
    +
    +PIPELINE = 2
    +
    + +
    +
    +SERVICE = 3
    +
    + +
    +
    +MESSAGE = 4
    +
    + +
    +
    +COPY = 5
    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.WorkflowNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: ABC

    +

    Abstract base class representing a generic node in a workflow.

    +

    WorkflowNode is designed to be subclassed with specific logic implemented +in the subclass methods. It provides an interface for initialization and +execution of operations when the node is called.

    +
    +
    +node_type = None
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +abstract compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.ModelNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node that represents a model in a workflow.

    +

    The ModelNode can be used to load and execute a model as part of the +workflow node. It initializes model configurations and performs +model-related operations when called.

    +
    +
    +node_type = 0
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.MsgNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node that manages messaging within a workflow.

    +

    MsgNode is responsible for handling messages, creating message objects, +and performing message-related operations when the node is invoked.

    +
    +
    +node_type = 4
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.DialogAgentNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a DialogAgent within a workflow.

    +
    +
    +node_type = 1
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.UserAgentNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a UserAgent within a workflow.

    +
    +
    +node_type = 1
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.TextToImageAgentNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a TextToImageAgent within a workflow.

    +
    +
    +node_type = 1
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.DictDialogAgentNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a DictDialogAgent within a workflow.

    +
    +
    +node_type = 1
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.ReActAgentNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a ReActAgent within a workflow.

    +
    +
    +node_type = 1
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.MsgHubNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node that serves as a messaging hub within a workflow.

    +

    MsgHubNode is responsible for broadcasting announcements to participants +and managing the flow of messages within a workflow’s node.

    +
    +
    +node_type = 2
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.PlaceHolderNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A placeholder node within a workflow.

    +

    This node acts as a placeholder and can be used to pass through information +or data without performing any significant operation.

    +
    +
    +node_type = 2
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.SequentialPipelineNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a sequential node within a workflow.

    +

    SequentialPipelineNode executes a series of operators or nodes in a +sequence, where the output of one node is the input to the next.

    +
    +
    +node_type = 2
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.ForLoopPipelineNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a for-loop structure in a workflow.

    +

    ForLoopPipelineNode allows the execution of a pipeline node multiple times, +iterating over a given set of inputs or a specified range.

    +
    +
    +node_type = 2
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.WhileLoopPipelineNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a while-loop structure in a workflow.

    +

    WhileLoopPipelineNode enables conditional repeated execution of a node +node based on a specified condition.

    +
    +
    +node_type = 2
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.IfElsePipelineNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing an if-else conditional structure in a workflow.

    +

    IfElsePipelineNode directs the flow of execution to different node +nodes based on a specified condition.

    +
    +
    +node_type = 2
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.SwitchPipelineNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node representing a switch-case structure within a workflow.

    +

    SwitchPipelineNode routes the execution to different node nodes +based on the evaluation of a specified key or condition.

    +
    +
    +node_type = 2
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.CopyNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    A node that duplicates the output of another node in the workflow.

    +

    CopyNode is used to replicate the results of a parent node and can be +useful in workflows where the same output is needed for multiple +subsequent operations.

    +
    +
    +node_type = 5
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.BingSearchServiceNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    Bing Search Node

    +
    +
    +node_type = 3
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.GoogleSearchServiceNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    Google Search Node

    +
    +
    +node_type = 3
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.PythonServiceNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    Execute python Node

    +
    +
    +node_type = 3
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.ReadTextServiceNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    Read Text Service Node

    +
    +
    +node_type = 3
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +class agentscope.web.workstation.workflow_node.WriteTextServiceNode(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list)[source]
    +

    Bases: WorkflowNode

    +

    Write Text Service Node

    +
    +
    +node_type = 3
    +
    + +
    +
    +__init__(node_id: str, opt_kwargs: dict, source_kwargs: dict, dep_opts: list) None[source]
    +

    Initialize nodes. Implement specific initialization logic in +subclasses.

    +
    + +
    +
    +compile() dict[source]
    +

    Compile Node to python executable code dict

    +
    + +
    + +
    +
    +agentscope.web.workstation.workflow_node.get_all_agents(node: WorkflowNode, seen_agents: set | None = None, return_var: bool = False) List[source]
    +

    Retrieve all unique agent objects from a pipeline.

    +

    Recursively traverses the pipeline to collect all distinct agent-based +participants. Prevents duplication by tracking already seen agents.

    +
    +
    Parameters:
    +
      +
    • node (WorkflowNode) – The WorkflowNode from which to extract agents.

    • +
    • seen_agents (set, optional) – A set of agents that have already been +seen to avoid duplication. Defaults to None.

    • +
    +
    +
    Returns:
    +

    A list of unique agent objects found in the pipeline.

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/agentscope.web.workstation.workflow_utils.html b/en/agentscope.web.workstation.workflow_utils.html new file mode 100644 index 000000000..c90e4cbb5 --- /dev/null +++ b/en/agentscope.web.workstation.workflow_utils.html @@ -0,0 +1,153 @@ + + + + + + + + agentscope.web.workstation.workflow_utils — AgentScope documentation + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    agentscope.web.workstation.workflow_utils

    +

    Workflow node utils.

    +
    +
    +agentscope.web.workstation.workflow_utils.is_callable_expression(s: str) bool[source]
    +

    Check a expression whether a callable expression

    +
    + +
    +
    +agentscope.web.workstation.workflow_utils.kwarg_converter(kwargs: dict) str[source]
    +

    Convert a kwarg dict to a string.

    +
    + +
    +
    +agentscope.web.workstation.workflow_utils.deps_converter(dep_vars: list) str[source]
    +

    Convert a dep_vars list to a string.

    +
    + +
    +
    +agentscope.web.workstation.workflow_utils.dict_converter(dictionary: dict) str[source]
    +

    Convert a dictionary to a string.

    +
    + +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Alibaba Tongyi Lab.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/en/genindex.html b/en/genindex.html index 1903cd1f8..469c4cff3 100644 --- a/en/genindex.html +++ b/en/genindex.html @@ -57,15 +57,17 @@

    AgentScope API Reference

    @@ -95,7 +97,8 @@

    Index

    - A + _ + | A | B | C | D @@ -104,8 +107,10 @@

    Index

    | G | I | J + | K | L | M + | N | O | P | Q @@ -116,23 +121,231 @@

    Index

    | W
    +

    _

    + + +
    +

    A

    - -
  • - agentscope.memory + agentscope.agents.agent
  • - agentscope.models + agentscope.agents.dialog_agent
  • - agentscope.pipelines + agentscope.agents.dict_dialog_agent
  • - agentscope.rpc + agentscope.agents.operator
  • - agentscope.service + agentscope.agents.react_agent
  • -
    +
  • + agentscope.models.config -

    B

    - - -
    - -

    C

    - - - -
    +
  • + agentscope.models.dashscope_model
  • -
  • call_in_thread() (in module agentscope.rpc) -
  • -
  • clear() (agentscope.memory.MemoryBase method) +
  • + agentscope.models.gemini_model
  • -
  • clear_audience() (agentscope.agents.AgentBase method) -
  • -
    +
  • +
  • + agentscope.models.response -

    D

    - - - + +
    +
  • + agentscope.rpc.rpc_agent_client + +
  • +
  • + agentscope.rpc.rpc_agent_pb2
  • -
  • DESCRIPTOR (agentscope.rpc.RpcMsg attribute) +
  • + agentscope.rpc.rpc_agent_pb2_grpc + +
  • +
  • + agentscope.service + +
  • +
      +
    • + agentscope.service.execute_code + +
    • +
    • + agentscope.service.execute_code.exec_python + +
    • +
    • + agentscope.service.execute_code.exec_shell + +
    • +
    • + agentscope.service.file + +
    • +
    • + agentscope.service.file.common + +
    • +
    • + agentscope.service.file.json + +
    • +
    • + agentscope.service.file.text + +
    • +
    • + agentscope.service.retrieval + +
    • +
    • + agentscope.service.retrieval.retrieval_from_list + +
    • +
    • + agentscope.service.retrieval.similarity + +
    • +
    • + agentscope.service.service_factory + +
    • +
    • + agentscope.service.service_response + +
    • +
    • + agentscope.service.service_status + +
    • +
    • + agentscope.service.sql_query + +
    • +
    • + agentscope.service.sql_query.mongodb + +
    • +
    • + agentscope.service.sql_query.mysql + +
    • +
    • + agentscope.service.sql_query.sqlite + +
    • +
    • + agentscope.service.text_processing + +
    • +
    • + agentscope.service.text_processing.summarization + +
    • +
    • + agentscope.service.web + +
    • +
    • + agentscope.service.web.arxiv + +
    • +
    • + agentscope.service.web.download + +
    • +
    • + agentscope.service.web.search + +
    • +
    • + agentscope.service.web.web_digest + +
    • +
    • + agentscope.utils + +
    • +
    • + agentscope.utils.common + +
    • +
    • + agentscope.utils.logging_utils + +
    • +
    • + agentscope.utils.monitor + +
    • +
    • + agentscope.utils.token_utils + +
    • +
    • + agentscope.utils.tools + +
    • +
    • + agentscope.web + +
    • +
    • + agentscope.web.studio + +
    • +
    • + agentscope.web.studio.constants + +
    • +
    • + agentscope.web.studio.studio + +
    • +
    • + agentscope.web.studio.utils + +
    • +
    • + agentscope.web.workstation + +
    • +
    • + agentscope.web.workstation.workflow + +
    • +
    • + agentscope.web.workstation.workflow_dag + +
    • +
    • + agentscope.web.workstation.workflow_node + +
    • +
    • + agentscope.web.workstation.workflow_utils + +
    • +
    • arxiv_search() (in module agentscope.service) + +
    • +
    • ASDiGraph (class in agentscope.web.workstation.workflow_dag) +
    • +
    • audio2text() (in module agentscope.web.studio.utils) +
    • +
    + +

    B

    + + + +
    + +

    C

    + + + +
    + +

    D

    + + +
    @@ -355,59 +1208,141 @@

    E

    F

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    AgentScope API Reference

    diff --git a/en/objects.inv b/en/objects.inv index 724a7b8bc..13e62ed11 100644 Binary files a/en/objects.inv and b/en/objects.inv differ diff --git a/en/py-modindex.html b/en/py-modindex.html index 98da1b1fe..78c3f25ed 100644 --- a/en/py-modindex.html +++ b/en/py-modindex.html @@ -60,15 +60,17 @@

    AgentScope API Reference

    @@ -116,26 +118,166 @@

    Python Module Index

        agentscope.agents
        + agentscope.agents.agent +
        + agentscope.agents.dialog_agent +
        + agentscope.agents.dict_dialog_agent +
        + agentscope.agents.operator +
        + agentscope.agents.react_agent +
        + agentscope.agents.rpc_agent +
        + agentscope.agents.text_to_image_agent +
        + agentscope.agents.user_agent +
        + agentscope.constants +
        + agentscope.file_manager +
        agentscope.memory
        + agentscope.memory.memory +
        + agentscope.memory.temporary_memory +
        + agentscope.message +
        agentscope.models
        + agentscope.models.config +
        + agentscope.models.dashscope_model +
        + agentscope.models.gemini_model +
        + agentscope.models.model +
        + agentscope.models.ollama_model +
        + agentscope.models.openai_model +
        + agentscope.models.post_model +
        + agentscope.models.response +
        + agentscope.msghub +
        agentscope.pipelines
        + agentscope.pipelines.functional +
        + agentscope.pipelines.pipeline +
        + agentscope.prompt +
        agentscope.rpc
        + agentscope.rpc.rpc_agent_client +
        + agentscope.rpc.rpc_agent_pb2 +
        + agentscope.rpc.rpc_agent_pb2_grpc +
        @@ -146,36 +288,151 @@

    Python Module Index

        agentscope.service.execute_code
        + agentscope.service.execute_code.exec_python +
        + agentscope.service.execute_code.exec_shell +
        agentscope.service.file
        + agentscope.service.file.common +
        + agentscope.service.file.json +
        + agentscope.service.file.text +
        agentscope.service.retrieval
        + agentscope.service.retrieval.retrieval_from_list +
        + agentscope.service.retrieval.similarity +
        + agentscope.service.service_factory +
        + agentscope.service.service_response +
        + agentscope.service.service_status +
        agentscope.service.sql_query
        + agentscope.service.sql_query.mongodb +
        + agentscope.service.sql_query.mysql +
        + agentscope.service.sql_query.sqlite +
        agentscope.service.text_processing
        + agentscope.service.text_processing.summarization +
        agentscope.service.web
        + agentscope.service.web.arxiv +
        + agentscope.service.web.download +
        + agentscope.service.web.search +
        + agentscope.service.web.web_digest +
        agentscope.utils
        + agentscope.utils.common +
        + agentscope.utils.logging_utils +
        + agentscope.utils.monitor +
        + agentscope.utils.token_utils +
        + agentscope.utils.tools +
        @@ -186,11 +443,46 @@

    Python Module Index

        agentscope.web.studio
        + agentscope.web.studio.constants +
        + agentscope.web.studio.studio +
        + agentscope.web.studio.utils +
        agentscope.web.workstation
        + agentscope.web.workstation.workflow +
        + agentscope.web.workstation.workflow_dag +
        + agentscope.web.workstation.workflow_node +
        + agentscope.web.workstation.workflow_utils +
    diff --git a/en/search.html b/en/search.html index 3ff88a193..9fbefbf92 100644 --- a/en/search.html +++ b/en/search.html @@ -60,15 +60,17 @@

    AgentScope API Reference

  • diff --git a/en/searchindex.js b/en/searchindex.js index cb37a916c..639f3327b 100644 --- a/en/searchindex.js +++ b/en/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"About AgentScope": [[19, "about-agentscope"]], "About Implementation": [[31, "about-implementation"]], "About Memory": [[28, "about-memory"]], "About Message": [[28, "about-message"]], "About PromptEngine Class": [[29, "about-promptengine-class"]], "About Service Factory": [[27, "about-service-factory"]], "About ServiceResponse": [[27, "about-serviceresponse"]], "Actor Model": [[31, "actor-model"]], "Adding and Deleting Participants": [[25, "adding-and-deleting-participants"]], "Advanced Exploration": [[17, "advanced-exploration"], [34, "advanced-exploration"], [36, "advanced-exploration"]], "Advanced Usage": [[30, "advanced-usage"]], "Agent": [[19, "agent"]], "AgentScope API Reference": [[17, null]], "AgentScope Code Structure": [[19, "agentscope-code-structure"]], "AgentScope Documentation": [[17, "agentscope-documentation"]], "Basic Parameters": [[26, "basic-parameters"]], "Basic Usage": [[30, "basic-usage"]], "Broadcast message in MsgHub": [[25, "broadcast-message-in-msghub"]], "Build Model Service from Scratch": [[26, "build-model-service-from-scratch"]], "Built-in Prompt Strategies": [[29, "built-in-prompt-strategies"]], "Built-in Service Functions": [[27, "built-in-service-functions"]], "Category": [[25, "category"]], "Challenges in Prompt Construction": [[29, "challenges-in-prompt-construction"]], "Code Review": [[33, "code-review"]], "Commit Your Changes": [[33, "commit-your-changes"]], "Configuration": [[26, "configuration"]], "Configuration Format": [[26, "configuration-format"]], "Contribute to AgentScope": [[33, "contribute-to-agentscope"]], "Contribute to Codebase": [[33, "contribute-to-codebase"]], "Crafting Your First Application": [[22, "crafting-your-first-application"]], "Creat Your Own Model Wrapper": [[26, "creat-your-own-model-wrapper"]], "Create a New Branch": [[33, "create-a-new-branch"]], "Create a Virtual Environment": [[20, "create-a-virtual-environment"]], "Creating a MsgHub": [[25, "creating-a-msghub"]], "Customizing Agents from the AgentPool": [[24, "customizing-agents-from-the-agentpool"]], "Customizing Your Own Agent": [[24, "customizing-your-own-agent"]], "DashScope API": [[26, "dashscope-api"]], "DashScopeChatWrapper": [[29, "dashscopechatwrapper"]], "DashScopeMultiModalWrapper": [[29, "dashscopemultimodalwrapper"]], "Detailed Parameters": [[26, "detailed-parameters"]], "DialogAgent": [[24, "dialogagent"]], "DingTalk (\u9489\u9489)": [[32, "dingtalk"]], "Discord": [[32, "discord"]], "Distribution": [[31, "distribution"]], "Example": [[27, "example"]], "Exploring the AgentPool": [[24, "exploring-the-agentpool"]], "ForLoopPipeline": [[25, "forlooppipeline"]], "Fork and Clone the Repository": [[33, "fork-and-clone-the-repository"]], "Formatting Prompts in Dynamic Way": [[29, "formatting-prompts-in-dynamic-way"]], "Gemini API": [[26, "gemini-api"]], "GeminiChatWrapper": [[29, "geminichatwrapper"]], "Get Involved": [[35, "get-involved"]], "Get a Monitor Instance": [[30, "get-a-monitor-instance"]], "Getting Involved": [[17, "getting-involved"], [36, "getting-involved"]], "Getting Started": [[17, "getting-started"], [22, "getting-started"], [36, "getting-started"], [37, "getting-started"]], "GitHub": [[32, "github"]], "Handling Quotas": [[30, "handling-quotas"]], "How is AgentScope designed?": [[19, "how-is-agentscope-designed"]], "How to use Service Functions": [[27, "how-to-use-service-functions"]], "IfElsePipeline": [[25, "ifelsepipeline"]], "Implement Werewolf Pipeline": [[22, "implement-werewolf-pipeline"]], "Indices and tables": [[17, "indices-and-tables"]], "Initialization": [[29, "initialization"]], "Install from Source": [[20, "install-from-source"]], "Install with Pip": [[20, "install-with-pip"]], "Installation": [[20, "installation"]], "Installing AgentScope": [[20, "installing-agentscope"]], "Integrating logging with WebUI": [[23, "integrating-logging-with-webui"]], "Joining AgentScope Community": [[32, "joining-agentscope-community"]], "Joining Prompt Components": [[29, "joining-prompt-components"]], "Key Concepts": [[19, "key-concepts"]], "Key Features of PromptEngine": [[29, "key-features-of-promptengine"]], "Leverage Pipeline and MsgHub": [[22, "leverage-pipeline-and-msghub"]], "Logging": [[23, "logging"]], "Logging a Chat Message": [[23, "logging-a-chat-message"]], "Logging a System information": [[23, "logging-a-system-information"]], "Logging and WebUI": [[23, "logging-and-webui"]], "Making Changes": [[33, "making-changes"]], "Master-Slave Mode": [[31, "master-slave-mode"]], "Memory": [[28, "memory"]], "MemoryBase Class": [[28, "memorybase-class"]], "Message": [[19, "message"]], "MessageBase Class": [[28, "messagebase-class"]], "Model": [[26, "model"]], "Monitor": [[30, "monitor"]], "Msg Class": [[28, "msg-class"]], "MsgHub": [[25, "msghub"]], "Next step": [[22, "next-step"]], "Note": [[23, "note"]], "Ollama API": [[26, "ollama-api"]], "OllamaChatWrapper": [[29, "ollamachatwrapper"]], "OllamaGenerationWrapper": [[29, "ollamagenerationwrapper"]], "OpenAI API": [[26, "openai-api"]], "OpenAIChatWrapper": [[29, "openaichatwrapper"]], "Output List Type Prompt": [[29, "output-list-type-prompt"]], "Output String Type Prompt": [[29, "output-string-type-prompt"]], "Peer-to-Peer Mode": [[31, "peer-to-peer-mode"]], "Pipeline Combination": [[25, "pipeline-combination"]], "Pipeline and MsgHub": [[25, "pipeline-and-msghub"]], "Pipelines": [[25, "pipelines"]], "PlaceHolder": [[31, "placeholder"]], "Post Request API": [[26, "post-request-api"]], "Prompt Engine (Will be deprecated in the future)": [[29, "prompt-engine-will-be-deprecated-in-the-future"]], "Prompt Engineering": [[29, "prompt-engineering"]], "Prompt Strategy": [[29, "prompt-strategy"], [29, "id1"], [29, "id2"], [29, "id3"], [29, "id4"], [29, "id5"]], "Quick Running": [[23, "quick-running"]], "Quick Start": [[21, "quick-start"]], "Register a budget for an API": [[30, "register-a-budget-for-an-api"]], "Registering API Usage Metrics": [[30, "registering-api-usage-metrics"]], "Report Bugs and Ask For New Features?": [[33, "report-bugs-and-ask-for-new-features"]], "Resetting and Removing Metrics": [[30, "resetting-and-removing-metrics"]], "Retrieving Metrics": [[30, "retrieving-metrics"]], "SequentialPipeline": [[25, "sequentialpipeline"]], "Service": [[19, "service"], [27, "service"]], "Setting Up the Logger": [[23, "setting-up-the-logger"]], "Step 1: Create a Distributed Agent": [[31, "step-1-create-a-distributed-agent"]], "Step 1: Prepare Model API and Set Model Configs": [[22, "step-1-prepare-model-api-and-set-model-configs"]], "Step 2: Define the Roles of Each Agent": [[22, "step-2-define-the-roles-of-each-agent"]], "Step 2: Orchestrate Distributed Application Flow": [[31, "step-2-orchestrate-distributed-application-flow"]], "Step 3: Initialize AgentScope and the Agents": [[22, "step-3-initialize-agentscope-and-the-agents"]], "Step 4: Set Up the Game Logic": [[22, "step-4-set-up-the-game-logic"]], "Step 5: Run the Application": [[22, "step-5-run-the-application"]], "Step1: Prepare Model": [[21, "step1-prepare-model"]], "Step2: Create Agents": [[21, "step2-create-agents"]], "Step3: Agent Conversation": [[21, "step3-agent-conversation"]], "Submit a Pull Request": [[33, "submit-a-pull-request"]], "Supported Models": [[26, "supported-models"]], "SwitchPipeline": [[25, "switchpipeline"]], "TemporaryMemory": [[28, "temporarymemory"]], "Tutorial Navigator": [[17, "tutorial-navigator"], [36, "tutorial-navigator"]], "Understanding AgentBase": [[24, "understanding-agentbase"]], "Understanding the Monitor in AgentScope": [[30, "understanding-the-monitor-in-agentscope"]], "Updating Metrics": [[30, "updating-metrics"]], "Usage": [[25, "usage"], [25, "id1"], [31, "usage"]], "UserAgent": [[24, "useragent"]], "Using Conda": [[20, "using-conda"]], "Using Virtualenv": [[20, "using-virtualenv"]], "Using prefix to Distinguish Metrics": [[30, "using-prefix-to-distinguish-metrics"]], "Using the Monitor": [[30, "using-the-monitor"]], "Welcome to AgentScope Tutorial Hub": [[17, "welcome-to-agentscope-tutorial-hub"], [36, "welcome-to-agentscope-tutorial-hub"]], "What is AgentScope?": [[19, "what-is-agentscope"]], "WhileLoopPipeline": [[25, "whilelooppipeline"]], "Why AgentScope?": [[19, "why-agentscope"]], "Workflow": [[19, "workflow"]], "agentscope": [[0, "module-agentscope"], [18, "agentscope"]], "agentscope.agents": [[1, "module-agentscope.agents"]], "agentscope.memory": [[2, "module-agentscope.memory"]], "agentscope.models": [[3, "module-agentscope.models"]], "agentscope.pipelines": [[4, "module-agentscope.pipelines"]], "agentscope.rpc": [[5, "module-agentscope.rpc"]], "agentscope.service": [[6, "module-agentscope.service"]], "agentscope.service.execute_code": [[7, "module-agentscope.service.execute_code"]], "agentscope.service.file": [[8, "module-agentscope.service.file"]], "agentscope.service.retrieval": [[9, "module-agentscope.service.retrieval"]], "agentscope.service.sql_query": [[10, "module-agentscope.service.sql_query"]], "agentscope.service.text_processing": [[11, "module-agentscope.service.text_processing"]], "agentscope.service.web": [[12, "module-agentscope.service.web"]], "agentscope.utils": [[13, "module-agentscope.utils"]], "agentscope.web": [[14, "module-agentscope.web"]], "agentscope.web.studio": [[15, "module-agentscope.web.studio"]], "agentscope.web.workstation": [[16, "module-agentscope.web.workstation"]]}, "docnames": ["agentscope", "agentscope.agents", "agentscope.memory", "agentscope.models", "agentscope.pipelines", "agentscope.rpc", "agentscope.service", "agentscope.service.execute_code", "agentscope.service.file", "agentscope.service.retrieval", "agentscope.service.sql_query", "agentscope.service.text_processing", "agentscope.service.web", "agentscope.utils", "agentscope.web", "agentscope.web.studio", "agentscope.web.workstation", "index", "modules", "tutorial/101-agentscope", "tutorial/102-installation", "tutorial/103-example", "tutorial/104-usecase", "tutorial/105-logging", "tutorial/201-agent", "tutorial/202-pipeline", "tutorial/203-model", "tutorial/204-service", "tutorial/205-memory", "tutorial/206-prompt", "tutorial/207-monitor", "tutorial/208-distribute", "tutorial/301-community", "tutorial/302-contribute", "tutorial/advance", "tutorial/contribute", "tutorial/main", "tutorial/quick_start"], "envversion": {"sphinx": 61, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["agentscope.rst", "agentscope.agents.rst", "agentscope.memory.rst", "agentscope.models.rst", "agentscope.pipelines.rst", "agentscope.rpc.rst", "agentscope.service.rst", "agentscope.service.execute_code.rst", "agentscope.service.file.rst", "agentscope.service.retrieval.rst", "agentscope.service.sql_query.rst", "agentscope.service.text_processing.rst", "agentscope.service.web.rst", "agentscope.utils.rst", "agentscope.web.rst", "agentscope.web.studio.rst", "agentscope.web.workstation.rst", "index.rst", "modules.rst", "tutorial/101-agentscope.md", "tutorial/102-installation.md", "tutorial/103-example.md", "tutorial/104-usecase.md", "tutorial/105-logging.md", "tutorial/201-agent.md", "tutorial/202-pipeline.md", "tutorial/203-model.md", "tutorial/204-service.md", "tutorial/205-memory.md", "tutorial/206-prompt.md", "tutorial/207-monitor.md", "tutorial/208-distribute.md", "tutorial/301-community.md", "tutorial/302-contribute.md", "tutorial/advance.rst", "tutorial/contribute.rst", "tutorial/main.md", "tutorial/quick_start.rst"], "indexentries": {"add() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.add", false]], "add() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.add", false]], "add() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.add", false]], "add_rpcagentservicer_to_server() (in module agentscope.rpc)": [[5, "agentscope.rpc.add_RpcAgentServicer_to_server", false]], "agent_id (agentscope.agents.agentbase property)": [[1, "agentscope.agents.AgentBase.agent_id", false]], "agentbase (class in agentscope.agents)": [[1, "agentscope.agents.AgentBase", false]], "agentscope": [[0, "module-agentscope", false]], "agentscope.agents": [[1, "module-agentscope.agents", false]], "agentscope.memory": [[2, "module-agentscope.memory", false]], "agentscope.models": [[3, "module-agentscope.models", false]], "agentscope.pipelines": [[4, "module-agentscope.pipelines", false]], "agentscope.rpc": [[5, "module-agentscope.rpc", false]], "agentscope.service": [[6, "module-agentscope.service", false]], "agentscope.service.execute_code": [[7, "module-agentscope.service.execute_code", false]], "agentscope.service.file": [[8, "module-agentscope.service.file", false]], "agentscope.service.retrieval": [[9, "module-agentscope.service.retrieval", false]], "agentscope.service.sql_query": [[10, "module-agentscope.service.sql_query", false]], "agentscope.service.text_processing": [[11, "module-agentscope.service.text_processing", false]], "agentscope.service.web": [[12, "module-agentscope.service.web", false]], "agentscope.utils": [[13, "module-agentscope.utils", false]], "agentscope.web": [[14, "module-agentscope.web", false]], "agentscope.web.studio": [[15, "module-agentscope.web.studio", false]], "agentscope.web.workstation": [[16, "module-agentscope.web.workstation", false]], "arxiv_search() (in module agentscope.service)": [[6, "agentscope.service.arxiv_search", false]], "bing_search() (in module agentscope.service)": [[6, "agentscope.service.bing_search", false]], "call_func() (agentscope.rpc.rpcagentclient method)": [[5, "agentscope.rpc.RpcAgentClient.call_func", false]], "call_func() (agentscope.rpc.rpcagentservicer method)": [[5, "agentscope.rpc.RpcAgentServicer.call_func", false]], "call_in_thread() (in module agentscope.rpc)": [[5, "agentscope.rpc.call_in_thread", false]], "clear() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.clear", false]], "clear() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.clear", false]], "clear() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.clear", false]], "clear_audience() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.clear_audience", false]], "clear_model_configs() (in module agentscope.models)": [[3, "agentscope.models.clear_model_configs", false]], "clone_instances() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.clone_instances", false]], "config_name (agentscope.models.modelwrapperbase attribute)": [[3, "agentscope.models.ModelWrapperBase.config_name", false]], "cos_sim() (in module agentscope.service)": [[6, "agentscope.service.cos_sim", false]], "create_agent() (agentscope.rpc.rpcagentclient method)": [[5, "agentscope.rpc.RpcAgentClient.create_agent", false]], "create_directory() (in module agentscope.service)": [[6, "agentscope.service.create_directory", false]], "create_file() (in module agentscope.service)": [[6, "agentscope.service.create_file", false]], "dashscopechatwrapper (class in agentscope.models)": [[3, "agentscope.models.DashScopeChatWrapper", false]], "dashscopeimagesynthesiswrapper (class in agentscope.models)": [[3, "agentscope.models.DashScopeImageSynthesisWrapper", false]], "dashscopemultimodalwrapper (class in agentscope.models)": [[3, "agentscope.models.DashScopeMultiModalWrapper", false]], "dashscopetextembeddingwrapper (class in agentscope.models)": [[3, "agentscope.models.DashScopeTextEmbeddingWrapper", false]], "delete() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.delete", false]], "delete() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.delete", false]], "delete_agent() (agentscope.rpc.rpcagentclient method)": [[5, "agentscope.rpc.RpcAgentClient.delete_agent", false]], "delete_directory() (in module agentscope.service)": [[6, "agentscope.service.delete_directory", false]], "delete_file() (in module agentscope.service)": [[6, "agentscope.service.delete_file", false]], "deprecated_model_type (agentscope.models.dashscopechatwrapper attribute)": [[3, "agentscope.models.DashScopeChatWrapper.deprecated_model_type", false]], "deprecated_model_type (agentscope.models.openaichatwrapper attribute)": [[3, "agentscope.models.OpenAIChatWrapper.deprecated_model_type", false]], "descriptor (agentscope.rpc.rpcmsg attribute)": [[5, "agentscope.rpc.RpcMsg.DESCRIPTOR", false]], "dialogagent (class in agentscope.agents)": [[1, "agentscope.agents.DialogAgent", false]], "dictdialogagent (class in agentscope.agents)": [[1, "agentscope.agents.DictDialogAgent", false]], "digest_webpage() (in module agentscope.service)": [[6, "agentscope.service.digest_webpage", false]], "download_from_url() (in module agentscope.service)": [[6, "agentscope.service.download_from_url", false]], "embedding (agentscope.models.modelresponse attribute)": [[3, "agentscope.models.ModelResponse.embedding", false]], "error (agentscope.service.serviceexecstatus attribute)": [[6, "agentscope.service.ServiceExecStatus.ERROR", false]], "error_info (agentscope.models.responseparsingerror attribute)": [[3, "agentscope.models.ResponseParsingError.error_info", false]], "execute_func() (agentscope.agents.reactagent method)": [[1, "agentscope.agents.ReActAgent.execute_func", false]], "execute_python_code() (in module agentscope.service)": [[6, "agentscope.service.execute_python_code", false]], "execute_shell_command() (in module agentscope.service)": [[6, "agentscope.service.execute_shell_command", false]], "exists() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.exists", false]], "export() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.export", false]], "export() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.export", false]], "export_config() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.export_config", false]], "flush() (agentscope.utils.monitorfactory class method)": [[13, "agentscope.utils.MonitorFactory.flush", false]], "forlooppipeline (class in agentscope.pipelines)": [[4, "agentscope.pipelines.ForLoopPipeline", false]], "forlooppipeline() (in module agentscope.pipelines)": [[4, "agentscope.pipelines.forlooppipeline", false]], "format() (agentscope.models.dashscopechatwrapper method)": [[3, "agentscope.models.DashScopeChatWrapper.format", false]], "format() (agentscope.models.dashscopemultimodalwrapper method)": [[3, "agentscope.models.DashScopeMultiModalWrapper.format", false]], "format() (agentscope.models.geminichatwrapper method)": [[3, "agentscope.models.GeminiChatWrapper.format", false]], "format() (agentscope.models.modelwrapperbase method)": [[3, "agentscope.models.ModelWrapperBase.format", false]], "format() (agentscope.models.ollamachatwrapper method)": [[3, "agentscope.models.OllamaChatWrapper.format", false]], "format() (agentscope.models.ollamaembeddingwrapper method)": [[3, "agentscope.models.OllamaEmbeddingWrapper.format", false]], "format() (agentscope.models.ollamagenerationwrapper method)": [[3, "agentscope.models.OllamaGenerationWrapper.format", false]], "format() (agentscope.models.openaichatwrapper method)": [[3, "agentscope.models.OpenAIChatWrapper.format", false]], "format() (agentscope.models.openaiwrapperbase method)": [[3, "agentscope.models.OpenAIWrapperBase.format", false]], "format() (agentscope.models.postapichatwrapper method)": [[3, "agentscope.models.PostAPIChatWrapper.format", false]], "geminichatwrapper (class in agentscope.models)": [[3, "agentscope.models.GeminiChatWrapper", false]], "geminiembeddingwrapper (class in agentscope.models)": [[3, "agentscope.models.GeminiEmbeddingWrapper", false]], "generate_agent_id() (agentscope.agents.agentbase class method)": [[1, "agentscope.agents.AgentBase.generate_agent_id", false]], "generation_method (agentscope.models.geminichatwrapper attribute)": [[3, "agentscope.models.GeminiChatWrapper.generation_method", false]], "get() (agentscope.service.servicefactory class method)": [[6, "agentscope.service.ServiceFactory.get", false]], "get_current_directory() (in module agentscope.service)": [[6, "agentscope.service.get_current_directory", false]], "get_embeddings() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.get_embeddings", false]], "get_help() (in module agentscope.service)": [[6, "agentscope.service.get_help", false]], "get_memory() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.get_memory", false]], "get_memory() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.get_memory", false]], "get_metric() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.get_metric", false]], "get_metrics() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.get_metrics", false]], "get_monitor() (agentscope.utils.monitorfactory class method)": [[13, "agentscope.utils.MonitorFactory.get_monitor", false]], "get_quota() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.get_quota", false]], "get_response() (agentscope.rpc.responsestub method)": [[5, "agentscope.rpc.ResponseStub.get_response", false]], "get_unit() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.get_unit", false]], "get_value() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.get_value", false]], "get_wrapper() (agentscope.models.modelwrapperbase class method)": [[3, "agentscope.models.ModelWrapperBase.get_wrapper", false]], "google_search() (in module agentscope.service)": [[6, "agentscope.service.google_search", false]], "ifelsepipeline (class in agentscope.pipelines)": [[4, "agentscope.pipelines.IfElsePipeline", false]], "ifelsepipeline() (in module agentscope.pipelines)": [[4, "agentscope.pipelines.ifelsepipeline", false]], "image_urls (agentscope.models.modelresponse attribute)": [[3, "agentscope.models.ModelResponse.image_urls", false]], "init() (in module agentscope)": [[0, "agentscope.init", false]], "init() (in module agentscope.web)": [[14, "agentscope.web.init", false]], "json (agentscope.models.modelresponse attribute)": [[3, "agentscope.models.ModelResponse.json", false]], "launch() (agentscope.agents.rpcagentserverlauncher method)": [[1, "agentscope.agents.RpcAgentServerLauncher.launch", false]], "list_directory_content() (in module agentscope.service)": [[6, "agentscope.service.list_directory_content", false]], "load() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.load", false]], "load() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.load", false]], "load_from_config() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.load_from_config", false]], "load_memory() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.load_memory", false]], "load_model_by_config_name() (in module agentscope.models)": [[3, "agentscope.models.load_model_by_config_name", false]], "load_web() (in module agentscope.service)": [[6, "agentscope.service.load_web", false]], "memorybase (class in agentscope.memory)": [[2, "agentscope.memory.MemoryBase", false]], "model_name (agentscope.models.modelwrapperbase attribute)": [[3, "agentscope.models.ModelWrapperBase.model_name", false]], "model_type (agentscope.models.dashscopechatwrapper attribute)": [[3, "agentscope.models.DashScopeChatWrapper.model_type", false]], "model_type (agentscope.models.dashscopeimagesynthesiswrapper attribute)": [[3, "agentscope.models.DashScopeImageSynthesisWrapper.model_type", false]], "model_type (agentscope.models.dashscopemultimodalwrapper attribute)": [[3, "agentscope.models.DashScopeMultiModalWrapper.model_type", false]], "model_type (agentscope.models.dashscopetextembeddingwrapper attribute)": [[3, "agentscope.models.DashScopeTextEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.geminichatwrapper attribute)": [[3, "agentscope.models.GeminiChatWrapper.model_type", false]], "model_type (agentscope.models.geminiembeddingwrapper attribute)": [[3, "agentscope.models.GeminiEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.modelwrapperbase attribute)": [[3, "agentscope.models.ModelWrapperBase.model_type", false]], "model_type (agentscope.models.ollamachatwrapper attribute)": [[3, "agentscope.models.OllamaChatWrapper.model_type", false]], "model_type (agentscope.models.ollamaembeddingwrapper attribute)": [[3, "agentscope.models.OllamaEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.ollamagenerationwrapper attribute)": [[3, "agentscope.models.OllamaGenerationWrapper.model_type", false]], "model_type (agentscope.models.openaichatwrapper attribute)": [[3, "agentscope.models.OpenAIChatWrapper.model_type", false]], "model_type (agentscope.models.openaidallewrapper attribute)": [[3, "agentscope.models.OpenAIDALLEWrapper.model_type", false]], "model_type (agentscope.models.openaiembeddingwrapper attribute)": [[3, "agentscope.models.OpenAIEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.postapichatwrapper attribute)": [[3, "agentscope.models.PostAPIChatWrapper.model_type", false]], "model_type (agentscope.models.postapimodelwrapperbase attribute)": [[3, "agentscope.models.PostAPIModelWrapperBase.model_type", false]], "modelresponse (class in agentscope.models)": [[3, "agentscope.models.ModelResponse", false]], "modelwrapperbase (class in agentscope.models)": [[3, "agentscope.models.ModelWrapperBase", false]], "module": [[0, "module-agentscope", false], [1, "module-agentscope.agents", false], [2, "module-agentscope.memory", false], [3, "module-agentscope.models", false], [4, "module-agentscope.pipelines", false], [5, "module-agentscope.rpc", false], [6, "module-agentscope.service", false], [7, "module-agentscope.service.execute_code", false], [8, "module-agentscope.service.file", false], [9, "module-agentscope.service.retrieval", false], [10, "module-agentscope.service.sql_query", false], [11, "module-agentscope.service.text_processing", false], [12, "module-agentscope.service.web", false], [13, "module-agentscope.utils", false], [14, "module-agentscope.web", false], [15, "module-agentscope.web.studio", false], [16, "module-agentscope.web.workstation", false]], "monitorbase (class in agentscope.utils)": [[13, "agentscope.utils.MonitorBase", false]], "monitorfactory (class in agentscope.utils)": [[13, "agentscope.utils.MonitorFactory", false]], "move_directory() (in module agentscope.service)": [[6, "agentscope.service.move_directory", false]], "move_file() (in module agentscope.service)": [[6, "agentscope.service.move_file", false]], "msghub() (in module agentscope)": [[0, "agentscope.msghub", false]], "observe() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.observe", false]], "observe() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.observe", false]], "ollamachatwrapper (class in agentscope.models)": [[3, "agentscope.models.OllamaChatWrapper", false]], "ollamaembeddingwrapper (class in agentscope.models)": [[3, "agentscope.models.OllamaEmbeddingWrapper", false]], "ollamagenerationwrapper (class in agentscope.models)": [[3, "agentscope.models.OllamaGenerationWrapper", false]], "openaichatwrapper (class in agentscope.models)": [[3, "agentscope.models.OpenAIChatWrapper", false]], "openaidallewrapper (class in agentscope.models)": [[3, "agentscope.models.OpenAIDALLEWrapper", false]], "openaiembeddingwrapper (class in agentscope.models)": [[3, "agentscope.models.OpenAIEmbeddingWrapper", false]], "openaiwrapperbase (class in agentscope.models)": [[3, "agentscope.models.OpenAIWrapperBase", false]], "operator (class in agentscope.agents)": [[1, "agentscope.agents.Operator", false]], "parse_func (agentscope.models.responseparsingerror attribute)": [[3, "agentscope.models.ResponseParsingError.parse_func", false]], "parse_html_to_text() (in module agentscope.service)": [[6, "agentscope.service.parse_html_to_text", false]], "pipelinebase (class in agentscope.pipelines)": [[4, "agentscope.pipelines.PipelineBase", false]], "postapichatwrapper (class in agentscope.models)": [[3, "agentscope.models.PostAPIChatWrapper", false]], "postapimodelwrapperbase (class in agentscope.models)": [[3, "agentscope.models.PostAPIModelWrapperBase", false]], "prepare_funcs_prompt() (agentscope.agents.reactagent method)": [[1, "agentscope.agents.ReActAgent.prepare_funcs_prompt", false]], "query_mongodb() (in module agentscope.service)": [[6, "agentscope.service.query_mongodb", false]], "query_mysql() (in module agentscope.service)": [[6, "agentscope.service.query_mysql", false]], "query_sqlite() (in module agentscope.service)": [[6, "agentscope.service.query_sqlite", false]], "quotaexceedederror": [[13, "agentscope.utils.QuotaExceededError", false]], "raw (agentscope.models.modelresponse attribute)": [[3, "agentscope.models.ModelResponse.raw", false]], "reactagent (class in agentscope.agents)": [[1, "agentscope.agents.ReActAgent", false]], "read_json_file() (in module agentscope.service)": [[6, "agentscope.service.read_json_file", false]], "read_model_configs() (in module agentscope.models)": [[3, "agentscope.models.read_model_configs", false]], "read_text_file() (in module agentscope.service)": [[6, "agentscope.service.read_text_file", false]], "register() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.register", false]], "register_budget() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.register_budget", false]], "remove() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.remove", false]], "reply() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.reply", false]], "reply() (agentscope.agents.dialogagent method)": [[1, "agentscope.agents.DialogAgent.reply", false]], "reply() (agentscope.agents.dictdialogagent method)": [[1, "agentscope.agents.DictDialogAgent.reply", false]], "reply() (agentscope.agents.reactagent method)": [[1, "agentscope.agents.ReActAgent.reply", false]], "reply() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.reply", false]], "reply() (agentscope.agents.texttoimageagent method)": [[1, "agentscope.agents.TextToImageAgent.reply", false]], "reply() (agentscope.agents.useragent method)": [[1, "agentscope.agents.UserAgent.reply", false]], "reset_audience() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.reset_audience", false]], "response (agentscope.models.responseparsingerror attribute)": [[3, "agentscope.models.ResponseParsingError.response", false]], "responseparser (class in agentscope.models)": [[3, "agentscope.models.ResponseParser", false]], "responseparsingerror": [[3, "agentscope.models.ResponseParsingError", false]], "responsestub (class in agentscope.rpc)": [[5, "agentscope.rpc.ResponseStub", false]], "retrieve_by_embedding() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.retrieve_by_embedding", false]], "retrieve_from_list() (in module agentscope.service)": [[6, "agentscope.service.retrieve_from_list", false]], "rm_audience() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.rm_audience", false]], "rpcagent (class in agentscope.agents)": [[1, "agentscope.agents.RpcAgent", false]], "rpcagentclient (class in agentscope.rpc)": [[5, "agentscope.rpc.RpcAgentClient", false]], "rpcagentserverlauncher (class in agentscope.agents)": [[1, "agentscope.agents.RpcAgentServerLauncher", false]], "rpcagentservicer (class in agentscope.rpc)": [[5, "agentscope.rpc.RpcAgentServicer", false]], "rpcagentstub (class in agentscope.rpc)": [[5, "agentscope.rpc.RpcAgentStub", false]], "rpcmsg (class in agentscope.rpc)": [[5, "agentscope.rpc.RpcMsg", false]], "sequentialpipeline (class in agentscope.pipelines)": [[4, "agentscope.pipelines.SequentialPipeline", false]], "sequentialpipeline() (in module agentscope.pipelines)": [[4, "agentscope.pipelines.sequentialpipeline", false]], "serviceexecstatus (class in agentscope.service)": [[6, "agentscope.service.ServiceExecStatus", false]], "servicefactory (class in agentscope.service)": [[6, "agentscope.service.ServiceFactory", false]], "serviceresponse (class in agentscope.service)": [[6, "agentscope.service.ServiceResponse", false]], "set_quota() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.set_quota", false]], "set_response() (agentscope.rpc.responsestub method)": [[5, "agentscope.rpc.ResponseStub.set_response", false]], "setup_logger() (in module agentscope.utils)": [[13, "agentscope.utils.setup_logger", false]], "shutdown() (agentscope.agents.rpcagentserverlauncher method)": [[1, "agentscope.agents.RpcAgentServerLauncher.shutdown", false]], "size() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.size", false]], "size() (agentscope.memory.temporarymemory method)": [[2, "agentscope.memory.TemporaryMemory.size", false]], "speak() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.speak", false]], "speak() (agentscope.agents.useragent method)": [[1, "agentscope.agents.UserAgent.speak", false]], "stop() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.stop", false]], "success (agentscope.service.serviceexecstatus attribute)": [[6, "agentscope.service.ServiceExecStatus.SUCCESS", false]], "summarization() (in module agentscope.service)": [[6, "agentscope.service.summarization", false]], "switchpipeline (class in agentscope.pipelines)": [[4, "agentscope.pipelines.SwitchPipeline", false]], "switchpipeline() (in module agentscope.pipelines)": [[4, "agentscope.pipelines.switchpipeline", false]], "temporarymemory (class in agentscope.memory)": [[2, "agentscope.memory.TemporaryMemory", false]], "text (agentscope.models.modelresponse attribute)": [[3, "agentscope.models.ModelResponse.text", false]], "texttoimageagent (class in agentscope.agents)": [[1, "agentscope.agents.TextToImageAgent", false]], "to_dict() (agentscope.models.responseparser class method)": [[3, "agentscope.models.ResponseParser.to_dict", false]], "to_dist() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.to_dist", false]], "to_list() (agentscope.models.responseparser class method)": [[3, "agentscope.models.ResponseParser.to_list", false]], "update() (agentscope.utils.monitorbase method)": [[13, "agentscope.utils.MonitorBase.update", false]], "update_config() (agentscope.memory.memorybase method)": [[2, "agentscope.memory.MemoryBase.update_config", false]], "update_monitor() (agentscope.models.modelwrapperbase method)": [[3, "agentscope.models.ModelWrapperBase.update_monitor", false]], "useragent (class in agentscope.agents)": [[1, "agentscope.agents.UserAgent", false]], "wait_until_terminate() (agentscope.agents.rpcagentserverlauncher method)": [[1, "agentscope.agents.RpcAgentServerLauncher.wait_until_terminate", false]], "whilelooppipeline (class in agentscope.pipelines)": [[4, "agentscope.pipelines.WhileLoopPipeline", false]], "whilelooppipeline() (in module agentscope.pipelines)": [[4, "agentscope.pipelines.whilelooppipeline", false]], "write_json_file() (in module agentscope.service)": [[6, "agentscope.service.write_json_file", false]], "write_text_file() (in module agentscope.service)": [[6, "agentscope.service.write_text_file", false]]}, "objects": {"": [[0, 0, 0, "-", "agentscope"]], "agentscope": [[1, 0, 0, "-", "agents"], [0, 4, 1, "", "init"], [2, 0, 0, "-", "memory"], [3, 0, 0, "-", "models"], [0, 4, 1, "", "msghub"], [4, 0, 0, "-", "pipelines"], [5, 0, 0, "-", "rpc"], [6, 0, 0, "-", "service"], [13, 0, 0, "-", "utils"], [14, 0, 0, "-", "web"]], "agentscope.agents": [[1, 1, 1, "", "AgentBase"], [1, 1, 1, "", "DialogAgent"], [1, 1, 1, "", "DictDialogAgent"], [1, 1, 1, "", "Operator"], [1, 1, 1, "", "ReActAgent"], [1, 1, 1, "", "RpcAgent"], [1, 1, 1, "", "RpcAgentServerLauncher"], [1, 1, 1, "", "TextToImageAgent"], [1, 1, 1, "", "UserAgent"]], "agentscope.agents.AgentBase": [[1, 2, 1, "", "agent_id"], [1, 3, 1, "", "clear_audience"], [1, 3, 1, "", "export_config"], [1, 3, 1, "", "generate_agent_id"], [1, 3, 1, "", "load_from_config"], [1, 3, 1, "", "load_memory"], [1, 3, 1, "", "observe"], [1, 3, 1, "", "reply"], [1, 3, 1, "", "reset_audience"], [1, 3, 1, "", "rm_audience"], [1, 3, 1, "", "speak"], [1, 3, 1, "", "to_dist"]], "agentscope.agents.DialogAgent": [[1, 3, 1, "", "reply"]], "agentscope.agents.DictDialogAgent": [[1, 3, 1, "", "reply"]], "agentscope.agents.ReActAgent": [[1, 3, 1, "", "execute_func"], [1, 3, 1, "", "prepare_funcs_prompt"], [1, 3, 1, "", "reply"]], "agentscope.agents.RpcAgent": [[1, 3, 1, "", "clone_instances"], [1, 3, 1, "", "observe"], [1, 3, 1, "", "reply"], [1, 3, 1, "", "stop"]], "agentscope.agents.RpcAgentServerLauncher": [[1, 3, 1, "", "launch"], [1, 3, 1, "", "shutdown"], [1, 3, 1, "", "wait_until_terminate"]], "agentscope.agents.TextToImageAgent": [[1, 3, 1, "", "reply"]], "agentscope.agents.UserAgent": [[1, 3, 1, "", "reply"], [1, 3, 1, "", "speak"]], "agentscope.memory": [[2, 1, 1, "", "MemoryBase"], [2, 1, 1, "", "TemporaryMemory"]], "agentscope.memory.MemoryBase": [[2, 3, 1, "", "add"], [2, 3, 1, "", "clear"], [2, 3, 1, "", "delete"], [2, 3, 1, "", "export"], [2, 3, 1, "", "get_memory"], [2, 3, 1, "", "load"], [2, 3, 1, "", "size"], [2, 3, 1, "", "update_config"]], "agentscope.memory.TemporaryMemory": [[2, 3, 1, "", "add"], [2, 3, 1, "", "clear"], [2, 3, 1, "", "delete"], [2, 3, 1, "", "export"], [2, 3, 1, "", "get_embeddings"], [2, 3, 1, "", "get_memory"], [2, 3, 1, "", "load"], [2, 3, 1, "", "retrieve_by_embedding"], [2, 3, 1, "", "size"]], "agentscope.models": [[3, 1, 1, "", "DashScopeChatWrapper"], [3, 1, 1, "", "DashScopeImageSynthesisWrapper"], [3, 1, 1, "", "DashScopeMultiModalWrapper"], [3, 1, 1, "", "DashScopeTextEmbeddingWrapper"], [3, 1, 1, "", "GeminiChatWrapper"], [3, 1, 1, "", "GeminiEmbeddingWrapper"], [3, 1, 1, "", "ModelResponse"], [3, 1, 1, "", "ModelWrapperBase"], [3, 1, 1, "", "OllamaChatWrapper"], [3, 1, 1, "", "OllamaEmbeddingWrapper"], [3, 1, 1, "", "OllamaGenerationWrapper"], [3, 1, 1, "", "OpenAIChatWrapper"], [3, 1, 1, "", "OpenAIDALLEWrapper"], [3, 1, 1, "", "OpenAIEmbeddingWrapper"], [3, 1, 1, "", "OpenAIWrapperBase"], [3, 1, 1, "", "PostAPIChatWrapper"], [3, 1, 1, "", "PostAPIModelWrapperBase"], [3, 1, 1, "", "ResponseParser"], [3, 6, 1, "", "ResponseParsingError"], [3, 4, 1, "", "clear_model_configs"], [3, 4, 1, "", "load_model_by_config_name"], [3, 4, 1, "", "read_model_configs"]], "agentscope.models.DashScopeChatWrapper": [[3, 5, 1, "", "deprecated_model_type"], [3, 3, 1, "", "format"], [3, 5, 1, "", "model_type"]], "agentscope.models.DashScopeImageSynthesisWrapper": [[3, 5, 1, "", "model_type"]], "agentscope.models.DashScopeMultiModalWrapper": [[3, 3, 1, "", "format"], [3, 5, 1, "", "model_type"]], "agentscope.models.DashScopeTextEmbeddingWrapper": [[3, 5, 1, "", "model_type"]], "agentscope.models.GeminiChatWrapper": [[3, 3, 1, "", "format"], [3, 5, 1, "", "generation_method"], [3, 5, 1, "", "model_type"]], "agentscope.models.GeminiEmbeddingWrapper": [[3, 5, 1, "", "model_type"]], "agentscope.models.ModelResponse": [[3, 5, 1, "", "embedding"], [3, 5, 1, "", "image_urls"], [3, 5, 1, "", "json"], [3, 5, 1, "", "raw"], [3, 5, 1, "", "text"]], "agentscope.models.ModelWrapperBase": [[3, 5, 1, "", "config_name"], [3, 3, 1, "", "format"], [3, 3, 1, "", "get_wrapper"], [3, 5, 1, "", "model_name"], [3, 5, 1, "", "model_type"], [3, 3, 1, "", "update_monitor"]], "agentscope.models.OllamaChatWrapper": [[3, 3, 1, "", "format"], [3, 5, 1, "", "model_type"]], "agentscope.models.OllamaEmbeddingWrapper": [[3, 3, 1, "", "format"], [3, 5, 1, "", "model_type"]], "agentscope.models.OllamaGenerationWrapper": [[3, 3, 1, "", "format"], [3, 5, 1, "", "model_type"]], "agentscope.models.OpenAIChatWrapper": [[3, 5, 1, "", "deprecated_model_type"], [3, 3, 1, "", "format"], [3, 5, 1, "", "model_type"]], "agentscope.models.OpenAIDALLEWrapper": [[3, 5, 1, "", "model_type"]], "agentscope.models.OpenAIEmbeddingWrapper": [[3, 5, 1, "", "model_type"]], "agentscope.models.OpenAIWrapperBase": [[3, 3, 1, "", "format"]], "agentscope.models.PostAPIChatWrapper": [[3, 3, 1, "", "format"], [3, 5, 1, "", "model_type"]], "agentscope.models.PostAPIModelWrapperBase": [[3, 5, 1, "", "model_type"]], "agentscope.models.ResponseParser": [[3, 3, 1, "", "to_dict"], [3, 3, 1, "", "to_list"]], "agentscope.models.ResponseParsingError": [[3, 5, 1, "", "error_info"], [3, 5, 1, "", "parse_func"], [3, 5, 1, "", "response"]], "agentscope.pipelines": [[4, 1, 1, "", "ForLoopPipeline"], [4, 1, 1, "", "IfElsePipeline"], [4, 1, 1, "", "PipelineBase"], [4, 1, 1, "", "SequentialPipeline"], [4, 1, 1, "", "SwitchPipeline"], [4, 1, 1, "", "WhileLoopPipeline"], [4, 4, 1, "", "forlooppipeline"], [4, 4, 1, "", "ifelsepipeline"], [4, 4, 1, "", "sequentialpipeline"], [4, 4, 1, "", "switchpipeline"], [4, 4, 1, "", "whilelooppipeline"]], "agentscope.rpc": [[5, 1, 1, "", "ResponseStub"], [5, 1, 1, "", "RpcAgentClient"], [5, 1, 1, "", "RpcAgentServicer"], [5, 1, 1, "", "RpcAgentStub"], [5, 1, 1, "", "RpcMsg"], [5, 4, 1, "", "add_RpcAgentServicer_to_server"], [5, 4, 1, "", "call_in_thread"]], "agentscope.rpc.ResponseStub": [[5, 3, 1, "", "get_response"], [5, 3, 1, "", "set_response"]], "agentscope.rpc.RpcAgentClient": [[5, 3, 1, "", "call_func"], [5, 3, 1, "", "create_agent"], [5, 3, 1, "", "delete_agent"]], "agentscope.rpc.RpcAgentServicer": [[5, 3, 1, "", "call_func"]], "agentscope.rpc.RpcMsg": [[5, 5, 1, "", "DESCRIPTOR"]], "agentscope.service": [[6, 1, 1, "", "ServiceExecStatus"], [6, 1, 1, "", "ServiceFactory"], [6, 1, 1, "", "ServiceResponse"], [6, 4, 1, "", "arxiv_search"], [6, 4, 1, "", "bing_search"], [6, 4, 1, "", "cos_sim"], [6, 4, 1, "", "create_directory"], [6, 4, 1, "", "create_file"], [6, 4, 1, "", "delete_directory"], [6, 4, 1, "", "delete_file"], [6, 4, 1, "", "digest_webpage"], [6, 4, 1, "", "download_from_url"], [7, 0, 0, "-", "execute_code"], [6, 4, 1, "", "execute_python_code"], [6, 4, 1, "", "execute_shell_command"], [8, 0, 0, "-", "file"], [6, 4, 1, "", "get_current_directory"], [6, 4, 1, "", "get_help"], [6, 4, 1, "", "google_search"], [6, 4, 1, "", "list_directory_content"], [6, 4, 1, "", "load_web"], [6, 4, 1, "", "move_directory"], [6, 4, 1, "", "move_file"], [6, 4, 1, "", "parse_html_to_text"], [6, 4, 1, "", "query_mongodb"], [6, 4, 1, "", "query_mysql"], [6, 4, 1, "", "query_sqlite"], [6, 4, 1, "", "read_json_file"], [6, 4, 1, "", "read_text_file"], [9, 0, 0, "-", "retrieval"], [6, 4, 1, "", "retrieve_from_list"], [10, 0, 0, "-", "sql_query"], [6, 4, 1, "", "summarization"], [11, 0, 0, "-", "text_processing"], [12, 0, 0, "-", "web"], [6, 4, 1, "", "write_json_file"], [6, 4, 1, "", "write_text_file"]], "agentscope.service.ServiceExecStatus": [[6, 5, 1, "", "ERROR"], [6, 5, 1, "", "SUCCESS"]], "agentscope.service.ServiceFactory": [[6, 3, 1, "", "get"]], "agentscope.utils": [[13, 1, 1, "", "MonitorBase"], [13, 1, 1, "", "MonitorFactory"], [13, 6, 1, "", "QuotaExceededError"], [13, 4, 1, "", "setup_logger"]], "agentscope.utils.MonitorBase": [[13, 3, 1, "", "add"], [13, 3, 1, "", "clear"], [13, 3, 1, "", "exists"], [13, 3, 1, "", "get_metric"], [13, 3, 1, "", "get_metrics"], [13, 3, 1, "", "get_quota"], [13, 3, 1, "", "get_unit"], [13, 3, 1, "", "get_value"], [13, 3, 1, "", "register"], [13, 3, 1, "", "register_budget"], [13, 3, 1, "", "remove"], [13, 3, 1, "", "set_quota"], [13, 3, 1, "", "update"]], "agentscope.utils.MonitorFactory": [[13, 3, 1, "", "flush"], [13, 3, 1, "", "get_monitor"]], "agentscope.web": [[14, 4, 1, "", "init"], [15, 0, 0, "-", "studio"], [16, 0, 0, "-", "workstation"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "property", "Python property"], "3": ["py", "method", "Python method"], "4": ["py", "function", "Python function"], "5": ["py", "attribute", "Python attribute"], "6": ["py", "exception", "Python exception"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:property", "3": "py:method", "4": "py:function", "5": "py:attribute", "6": "py:exception"}, "terms": {"": [0, 1, 3, 6, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33], "0": [4, 6, 13, 14, 22, 23, 26], "001": [3, 26], "002": [21, 26], "03": [3, 29], "03629": 1, "04": 29, "1": [2, 3, 4, 6, 14, 21, 23, 26], "10": [6, 27, 30], "100": [6, 26], "1000": 30, "120": 6, "12001": 31, "123": 26, "127": [14, 23], "1800": 1, "2": [3, 6, 26], "20": 30, "2024": [3, 29], "2048": 3, "21": 3, "22": 29, "2210": 1, "3": [3, 6, 20, 21, 24, 26, 27], "30": 3, "300": [5, 6], "3306": 6, "4": [21, 26, 29, 30], "5": [6, 21, 24, 26], "5000": [14, 23], "512x512": 26, "5m": [3, 26], "6": 22, "80": 31, "8192": 1, "9": 20, "A": [0, 1, 2, 3, 4, 5, 6, 13, 21, 22, 27, 28, 31, 33], "AND": 6, "And": 24, "As": [22, 24, 28], "At": [27, 31], "By": [22, 23, 31], "For": [1, 3, 6, 13, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 35], "If": [0, 1, 2, 3, 6, 20, 21, 22, 24, 26, 27, 28, 29, 30, 32, 33], "In": [0, 2, 3, 19, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 33], "It": [1, 3, 6, 17, 19, 22, 24, 25, 26, 28, 29, 30, 31, 36], "NOT": 6, "No": 22, "OR": 6, "On": 20, "One": 0, "Or": 25, "Such": 29, "The": [0, 1, 2, 3, 4, 6, 13, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31], "Then": [24, 31], "These": [22, 25, 27, 28, 29], "To": [20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 33], "Will": 34, "With": [3, 19, 22, 33], "_": [4, 22], "__": 4, "__call__": [1, 3, 24, 25, 26], "__delattr__": 28, "__getattr__": [27, 28], "__getitem__": 27, "__init__": [24, 26, 27, 28], "__name__": [24, 27], "__setattr__": [27, 28], "__setitem__": 27, "__type": 28, "_default_system_prompt": 6, "_default_token_limit_prompt": 6, "_get_pric": 30, "_get_timestamp": 28, "_messag": 5, "_upb": 5, "ab": [1, 6], "abc": [1, 2, 3, 13, 28], "abil": 22, "abl": 19, "about": [3, 17, 21, 24, 26, 30, 32, 34, 36, 37], "abov": [3, 13, 21, 22, 27, 29, 30, 31], "abstract": [1, 2, 13, 19, 24, 28], "abstractmethod": 25, "accept": [28, 29], "access": 28, "accident": 6, "accommod": [1, 19], "accord": [26, 29, 31, 33], "accordingli": 21, "account": 6, "accumul": 13, "achiev": [1, 22, 29], "across": 25, "act": [3, 6, 22, 24, 25, 29], "action": [1, 19, 22, 25], "activ": 20, "actor": [17, 19, 36], "actual": [0, 4, 21, 31], "ad": [1, 2, 24, 27, 28, 29, 33], "ada": [21, 26], "adapt": 29, "add": [2, 13, 22, 23, 24, 25, 27, 28, 29, 30, 33], "add_rpcagentservicer_to_serv": 5, "addit": [1, 6, 19, 20, 22, 24, 27, 31, 33], "addition": [21, 25, 28], "address": [6, 24, 31, 33], "adjust": [24, 30], "advanc": [3, 19, 21, 22, 29], "adventur": 22, "adversari": 1, "after": [6, 21, 22, 26, 31], "again": 33, "against": 19, "agent": [0, 3, 4, 5, 6, 17, 20, 23, 25, 26, 27, 28, 29, 30, 32, 34, 36, 37], "agent1": [0, 22, 25], "agent2": [0, 22, 25], "agent3": [0, 22, 25], "agent4": [22, 25], "agent5": 25, "agent_arg": 1, "agent_class": [1, 31], "agent_config": [0, 5, 22], "agent_id": [1, 5], "agent_kwarg": [1, 31], "agenta": 31, "agentb": 31, "agentbas": [0, 1, 22, 25, 27, 31, 34], "agentpool": 34, "agentscop": [21, 23, 24, 25, 26, 27, 28, 29, 31, 34, 35, 37], "agre": 22, "agreement": [1, 19, 22], "ai": [3, 6, 21, 24], "aim": 22, "al": 2, "alert": 13, "algorithm": [1, 24], "alic": [21, 29], "align": [3, 29], "aliv": 22, "aliyun": 3, "all": [0, 1, 2, 3, 4, 5, 6, 13, 14, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31], "alloc": 22, "allow": [3, 6, 19, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32], "allow_change_data": 6, "alon": 22, "alreadi": [6, 20, 27, 30, 33], "also": [1, 3, 22, 23, 25, 26, 27, 28, 31, 32], "altern": [3, 20, 29], "among": [0, 4, 22, 25, 26], "amount": 30, "an": [1, 3, 5, 6, 13, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 36], "analog": 19, "analys": 6, "andnot": 6, "ani": [1, 3, 4, 6, 24, 25, 27, 28, 29, 32, 33], "annot": 27, "announc": [0, 22, 25], "anoth": [6, 22, 24, 25, 27, 31], "answer": 19, "api": [0, 3, 6, 19, 21, 24, 27, 28, 29], "api_cal": 30, "api_kei": [3, 6, 21, 22, 26, 27], "api_url": [3, 26], "appli": [28, 31], "applic": [17, 19, 20, 21, 23, 24, 25, 29, 30, 32, 36, 37], "approach": [21, 25], "ar": [1, 2, 3, 4, 6, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33], "arbitrari": 29, "architectur": [19, 24], "arg": [1, 3, 22, 24, 25, 27, 28], "argument": [0, 1, 3, 6, 27], "arrow": 31, "arxiv": [1, 6, 27], "arxiv_search": [6, 27], "ask": [27, 32, 35], "asp": 6, "assign": [22, 23, 28], "assist": [3, 21, 24, 28, 29, 32], "associ": [5, 22, 30], "assum": [6, 22, 30], "attach": [3, 21, 28], "attempt": 22, "attribut": [2, 24, 28], "attribute_nam": 28, "attributeerror": 28, "au": 6, "audienc": [1, 25], "audio": [19, 21, 24, 26, 28, 29], "authent": [6, 27], "author": [6, 26], "automat": [6, 19, 22, 26, 27, 28, 30, 31], "autonom": [19, 22], "auxiliari": 19, "avail": [6, 21, 24, 25, 27, 31, 32], "avoid": [6, 30, 31], "b": [6, 27, 31, 33], "back": 31, "background": 31, "base": [1, 2, 3, 4, 5, 6, 13, 17, 19, 22, 24, 25, 26, 27, 28, 29, 30, 31, 36], "bash": 6, "basic": [3, 21, 22, 28], "batch": 30, "bearer": 26, "becom": 32, "been": 33, "befor": [3, 6, 20, 22, 28, 30, 31], "begin": [0, 3, 22, 29, 30], "beginn": 29, "behalf": 6, "behavior": [1, 22, 24, 28], "being": [5, 6, 22, 30], "below": [22, 24, 25, 29, 31, 32], "besid": [22, 24, 28], "best": 29, "better": [2, 3, 21, 23, 33], "between": [2, 3, 6, 19, 21, 22, 23, 25, 27, 28, 29, 31], "bin": 20, "bing": [6, 27], "bing_api_kei": 6, "bing_search": [6, 27], "block": [22, 25], "bob": [3, 21, 29], "bodi": 4, "bool": [0, 1, 2, 3, 4, 6, 13, 14, 24, 27, 28], "boolean": [2, 6, 27], "bot": 24, "both": [2, 6, 19, 29, 30, 31, 33], "box": 22, "branch": 25, "break": [4, 21, 22, 25], "break_condit": 25, "break_func": 4, "breviti": [24, 25, 27, 28], "bridg": 3, "brief": 33, "broadcast": [0, 22], "brows": 6, "budget": [3, 13, 26], "bug": [32, 35], "build": [3, 17, 19, 21, 22, 24, 29, 34, 36], "built": [6, 19, 22, 23, 24, 34], "bulk": 28, "busi": 6, "byte": 6, "c": [6, 27, 31], "calcul": 30, "call": [1, 3, 5, 6, 13, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31], "call_func": 5, "call_in_thread": 5, "callabl": [1, 2, 3, 4, 6, 28], "can": [0, 1, 2, 3, 6, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33], "capabl": [17, 19, 22, 27, 36], "capac": 6, "captur": [6, 23], "care": 6, "carrier": [19, 28], "case": [4, 22, 24], "case1": 25, "case2": 25, "case_oper": [4, 25], "cat": [6, 29], "categor": [19, 25], "categori": 26, "caus": 3, "cd": [6, 20, 22, 33], "central": [17, 19, 20, 31, 36], "centric": 19, "certain": [2, 13, 30], "challeng": 34, "chanc": 22, "chang": [1, 6, 19, 30], "channel": [5, 19], "charact": [22, 29], "characterist": 24, "chart": 31, "chat": [3, 21, 22, 25, 26, 28, 29, 32], "chatbot": 29, "check": [6, 22, 24, 30, 33], "check_win": 22, "checkout": 33, "chemic": 6, "choic": 22, "choos": [19, 21, 22], "chosen": 22, "class": [1, 2, 3, 4, 5, 6, 13, 22, 24, 25, 26, 27, 30, 31, 34], "classmethod": [1, 3, 6, 13], "clean": 2, "clear": [2, 3, 13, 25, 28, 30, 33], "clear_audi": 1, "clear_exist": 3, "clear_model_config": 3, "clearer": 23, "click": 23, "client": [1, 5, 26], "client_arg": [3, 26], "clone": [1, 20], "clone_inst": 1, "cloud": 3, "clspipelin": 25, "co": 6, "code": [0, 3, 6, 13, 20, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 37], "codebas": 35, "coher": [24, 28], "collabor": [25, 32], "collect": [6, 24, 27], "color": 23, "com": [3, 6, 20, 27, 28, 29, 33], "combin": [3, 29], "come": [22, 24, 27], "command": [1, 6, 20], "comment": 5, "commun": [17, 21, 22, 25, 31, 33, 35, 36], "compar": [6, 25, 33], "compat": [3, 19, 29], "compatilbl": 3, "complet": [27, 31], "completion_token": 30, "complex": [19, 21, 24, 25, 31], "complianc": 30, "complic": 19, "compon": [17, 19, 22, 36], "compos": 24, "comprehens": 24, "compris": [19, 21], "comput": [2, 6, 19, 24, 27], "concept": [22, 25, 31, 37], "concis": 33, "concret": 28, "condit": [4, 22, 25], "condition_func": 4, "condition_oper": 4, "conduit": 25, "confid": 6, "config": [0, 1, 2, 3, 21], "config_nam": [3, 21, 22, 26, 29], "configur": [1, 2, 3, 21, 22, 24, 34], "connect": [19, 31, 32], "consid": 22, "consider": 3, "consist": [22, 23, 24, 28], "constraint": [3, 29], "construct": [22, 24, 25, 27, 28, 34], "constructor": [26, 27], "consum": 31, "contain": [0, 1, 3, 4, 6, 27, 29, 31], "content": [1, 3, 6, 19, 21, 22, 23, 24, 27, 28, 29, 31], "context": [5, 24, 25, 28, 33], "continu": [4, 19, 21, 22, 24, 25, 29, 30], "contribut": [17, 32, 35, 36], "control": [4, 17, 22, 25, 26, 31, 36], "conveni": 22, "convers": [3, 6, 22, 23, 24, 26, 29, 37], "convert": [1, 24, 27, 29, 31], "cookbook": 28, "core": [19, 22, 24, 25], "cornerston": 24, "correspond": [4, 6, 19, 21, 22, 26, 31], "cos_sim": [6, 27], "cosin": [6, 27], "cost": [30, 31], "could": [6, 29], "count": 30, "cover": 0, "covnert": 6, "cpu": 26, "craft": [17, 24, 29, 36, 37], "creat": [0, 5, 6, 22, 24, 27, 28, 29, 34, 37], "create_ag": 5, "create_directori": [6, 27], "create_fil": [6, 27], "creation": 28, "criteria": [27, 28], "critic": [0, 13, 23, 28, 29], "crucial": [22, 23, 30], "cse": 6, "cse_id": 6, "curat": 24, "current": [1, 4, 6, 13, 26, 27, 28, 30], "custom": [6, 17, 19, 21, 22, 23, 26, 28, 29, 34, 36], "d": 31, "dag": 19, "dai": 22, "dall": [3, 26], "dashscop": [3, 29], "dashscope_chat": [3, 26], "dashscope_image_synthesi": [3, 26], "dashscope_multimod": [3, 26], "dashscope_text_embed": [3, 26], "dashscopechatwrapp": [3, 26], "dashscopeimagesynthesiswrapp": [3, 26], "dashscopemultimodalwrapp": [3, 26], "dashscopetextembeddingwrapp": [3, 26], "dashscopewrapperbas": 3, "data": [1, 3, 5, 6, 19, 24, 25, 28, 29], "databas": [6, 27], "date": [3, 32], "daytim": 22, "db": 13, "db_path": 13, "dead_nam": 22, "dead_play": 22, "death": 22, "debug": [0, 13, 14, 22, 23], "decid": [3, 22, 29], "decis": 3, "decod": 1, "decoupl": [21, 26], "deduc": 22, "deduct": 22, "deep": 6, "deeper": 22, "def": [6, 22, 24, 25, 26, 27, 28], "default": [0, 1, 2, 3, 4, 5, 6, 13, 19, 24, 27, 28, 30, 31], "default_ag": 25, "default_oper": 4, "defer": 24, "defin": [1, 6, 21, 24, 25, 27, 28, 30], "definit": [6, 19, 28], "del": 28, "delet": [2, 5, 6, 22, 27, 28], "delete_ag": 5, "delete_directori": [6, 27], "delete_fil": [6, 27], "delv": 22, "demand": 24, "demonstr": [22, 24], "denot": 28, "depend": [2, 6, 19, 20, 31], "deploi": [3, 21, 31], "deploy": [19, 21, 26, 31], "deprec": 34, "deprecated_model_typ": 3, "depth": 24, "deriv": 24, "describ": [6, 22, 25], "descript": [1, 6, 24, 25, 27, 33], "descriptor": 5, "design": [1, 2, 17, 21, 22, 23, 24, 25, 29, 31, 36, 37], "desir": 29, "destin": 6, "destination_path": 6, "detail": [1, 3, 6, 21, 22, 23, 24, 27, 28, 30, 31, 33], "determin": [4, 6, 13, 22, 28], "dev": 33, "develop": [1, 3, 6, 17, 19, 20, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 36], "dialog": [1, 19, 21, 25, 28], "dialog_ag": 21, "dialog_agent_config": 24, "dialogag": [1, 21], "dialogu": [1, 3, 19, 23, 24, 25, 29], "dict": [0, 1, 2, 3, 4, 5, 6, 13, 19, 21, 24, 25, 27, 28, 29], "dictat": 22, "dictdialogag": [1, 22, 24], "dictionari": [1, 3, 4, 6, 13, 21, 26, 27, 28, 29], "did": 33, "differ": [1, 3, 6, 17, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 36], "difficult": 29, "digest": [6, 27], "digest_prompt": 6, "digest_webpag": [6, 27], "dingtalk": 35, "dir": 0, "direcotri": 6, "direct": 28, "directli": [6, 20, 26, 27, 28, 29, 30], "directori": [0, 6, 13, 22, 26, 27], "directory_path": 6, "disabl": 6, "discord": 35, "discuss": [3, 22, 32, 33], "disguis": 22, "disk": 2, "displai": 6, "distinct": [22, 24], "distinguish": [13, 26, 28, 29, 31], "distribut": [1, 3, 17, 19, 20, 34, 36], "div": 6, "dive": 22, "divers": [19, 24, 33], "divid": [22, 26], "do": [4, 6, 20, 22, 23, 25, 31], "doc": [3, 19], "docker": [6, 27], "docstr": [6, 27], "document": [5, 19, 27, 33], "doe": [4, 28], "doesn": [1, 2], "dog": 29, "don": [13, 22, 28, 31], "download": [6, 27], "download_from_url": [6, 27], "dump": [27, 28], "dure": [22, 27, 28], "dynam": [22, 24, 25], "e": [1, 3, 6, 19, 20, 21, 22, 26, 27, 28, 29, 30, 31, 33], "each": [0, 3, 6, 19, 21, 24, 25, 27, 28, 29, 30, 31, 33], "eas": [17, 19, 25, 29, 36], "easi": [0, 17, 36], "easili": [20, 22, 25, 31], "echo": 28, "edit": [6, 20], "effect": [0, 6, 13], "effici": 19, "effort": [19, 24], "either": [3, 6, 21, 22, 28, 29], "eleg": 0, "element": [6, 29], "elementari": 19, "elif": 25, "elimin": 22, "els": [4, 22, 25, 27, 28], "else_body_oper": 4, "emb": [2, 6], "embed": [2, 3, 6, 21, 26, 27, 28], "embedding_model": [2, 6], "empow": [17, 19, 29, 36], "empti": [3, 6, 27, 29], "en": [6, 27], "enabl": [17, 19, 24, 25, 28, 29, 30, 36], "encapsul": [1, 3, 24, 25, 29], "encoding_format": 26, "encount": [23, 32], "encourag": [1, 3], "end": [3, 22, 29], "endow": [22, 24], "enforc": 30, "engag": [24, 32], "engin": [1, 3, 6, 17, 19, 24, 26, 34, 36], "enhanc": [17, 23, 27, 36], "enrich": 24, "ensembl": 24, "ensur": [19, 22, 24, 25, 30], "entir": 31, "entiti": 19, "entri": 0, "enum": 6, "environ": [1, 6, 19, 21, 22, 25, 26, 37], "environment": 25, "equal": 22, "equip": 24, "equival": 27, "error": [0, 3, 6, 13, 23, 27, 33], "error_info": 3, "especi": [6, 29, 30], "essenti": [21, 24, 28], "etc": [6, 27], "evalu": 25, "even": 22, "event": 22, "everi": 22, "everyon": 32, "exactli": 31, "exampl": [0, 1, 3, 6, 19, 21, 22, 25, 26, 28, 29, 30, 31, 33, 34], "exce": [1, 6, 13, 30], "exceed": [13, 30], "except": [3, 13, 19, 27, 28, 30], "exchang": 19, "execut": [1, 4, 6, 19, 21, 22, 25, 27, 31], "execute_func": 1, "execute_python_cod": [6, 27], "execute_shell_command": 6, "exert": 6, "exeuct": 4, "exist": [3, 6, 13, 24, 25, 28, 30], "existing_ag": 25, "exit": [21, 25, 31], "expand": 24, "expect": [6, 23, 29], "expedit": 24, "experi": [23, 32], "experiment": 30, "explain": 33, "explanatori": [6, 27], "explicitli": 6, "explor": 22, "export": [2, 28], "export_config": 1, "express": 13, "extend": [1, 25, 28], "extens": [19, 24], "extern": [28, 30], "extract": [6, 27], "extract_name_and_id": 22, "ey": [22, 33], "f": [24, 27, 28, 30, 31], "facilit": [25, 28], "factori": [6, 13], "fail": [1, 3], "failur": 27, "fals": [0, 1, 2, 3, 4, 6, 14, 22, 25, 28, 31], "fastchat": [3, 22, 26], "fault": [1, 17, 19, 36], "fault_handl": 1, "featur": [17, 19, 23, 30, 31, 32, 35, 36], "fed": 26, "feed": [3, 6], "feedback": 33, "feel": [22, 33], "fetch": 30, "few": 22, "field": [1, 3, 6, 19, 21, 26, 27, 28, 29], "figur": 3, "figure1": 3, "figure2": 3, "figure3": 3, "file": [0, 2, 3, 5, 6, 13, 19, 21, 22, 24, 26, 27, 28, 29], "file_path": [2, 6, 27, 28], "filepath": 6, "fill": [6, 27, 29], "filter": [2, 13, 28, 30], "filter_func": [2, 28], "filter_regex": 13, "final": [24, 29], "find": [6, 26, 27, 29, 31, 33], "fine": 23, "first": [3, 6, 13, 17, 20, 28, 29, 31, 33, 36, 37], "firstli": 22, "fit": [1, 24, 29], "fix": [32, 33], "flag": 22, "flask": 26, "flexibl": [19, 21, 24], "flexibli": 29, "float": [2, 3, 6, 13, 26], "flow": [4, 21, 22, 23, 25], "flush": 13, "focus": [30, 33], "follow": [0, 1, 3, 4, 6, 13, 20, 21, 22, 23, 26, 27, 28, 29, 30, 31], "forc": 6, "forlooppipelin": 4, "form": [27, 28], "format": [1, 3, 6, 13, 22, 23, 24, 27, 28, 33], "format_map": [22, 29], "forward": 3, "found": [3, 22], "foundat": 24, "fragment": 2, "free": [22, 33], "from": [1, 2, 3, 6, 13, 19, 21, 22, 25, 27, 28, 29, 30, 31, 33, 34], "fulfil": 19, "func": [6, 27], "func_cal": 1, "func_intro": 27, "func_nam": 5, "funcpipelin": 25, "function": [1, 2, 3, 4, 5, 6, 13, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 34], "function_nam": 27, "fundament": [19, 24], "further": 27, "furthermor": 19, "futur": [6, 23, 34], "g": [1, 3, 6, 19, 21, 22, 26, 27, 29, 30], "gain": 22, "game_werewolf": [1, 22], "gather": 24, "gemini": [3, 21, 29], "gemini_api_kei": 26, "gemini_chat": [3, 26], "gemini_embed": [3, 26], "geminichatwrapp": [3, 26], "geminiembeddingwrapp": [3, 26], "geminiwrapperbas": 3, "gener": [1, 3, 6, 19, 21, 23, 24, 26, 27, 28, 29, 31], "generate_agent_id": 1, "generate_arg": [3, 22, 26], "generate_cont": 3, "generatecont": 3, "generation_method": 3, "get": [2, 3, 5, 6, 13, 19, 27, 33], "get_current_directori": 6, "get_embed": [2, 28], "get_full_nam": 30, "get_help": 6, "get_memori": [2, 24, 28], "get_metr": [13, 30], "get_monitor": [13, 30], "get_quota": [13, 30], "get_respons": 5, "get_unit": [13, 30], "get_valu": [13, 30], "get_wrapp": 3, "git": [20, 33], "github": [3, 20, 33, 35], "give": 22, "given": [1, 3, 6, 24, 25, 27, 29], "glanc": 22, "go": 24, "goal": 29, "gone": 23, "good": 22, "googl": [3, 5, 6, 21, 27], "google_search": [6, 27], "govern": 6, "gpt": [21, 22, 24, 26, 29, 30], "graph": 19, "grasp": 22, "greater": 22, "grep": 6, "group": [0, 6, 22, 25, 32], "growth": 32, "grpc": 1, "guid": [22, 23, 24], "h": 6, "ha": [0, 3, 6, 22, 23, 24, 29, 31, 33], "handl": [1, 6, 22, 25, 27, 28, 29], "hard": 2, "hasn": 22, "have": [2, 3, 20, 22, 24, 28, 29, 30, 31, 32, 33], "header": [3, 26], "heal": 22, "healing_used_tonight": 22, "hello": 23, "help": [3, 6, 21, 22, 23, 24, 26, 29, 33], "helper": [19, 22, 25], "her": 22, "here": [22, 23, 24, 25, 26, 27, 28, 30, 32, 33], "hex": 28, "hi": [3, 21, 29], "hierarch": 19, "high": [17, 19, 36], "higher": [2, 20], "highest": 6, "highli": 29, "highlight": 27, "hint": [22, 24, 29], "hint_prompt": 29, "histor": 28, "histori": [1, 3, 22, 25, 29], "home": 6, "hook": 33, "host": [1, 5, 6, 14, 22, 31], "hostmsg": 22, "hostnam": [1, 6, 31], "how": [2, 3, 21, 22, 23, 24, 25, 26, 30, 31, 32, 33, 34, 37], "how_to_format_inputs_to_chatgpt_model": 28, "howev": [27, 28, 29], "html": [6, 27], "html_selected_tag": 6, "html_text": 6, "html_to_text": 6, "http": [1, 3, 6, 20, 23, 26, 27, 28, 29, 33], "hub": [22, 25], "hub_manag": 25, "huggingfac": [21, 26, 29], "i": [0, 1, 2, 3, 4, 6, 13, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 36, 37], "id": [1, 6, 21, 28], "id_list": 6, "idea": [1, 3, 33], "ident": 22, "identifi": [0, 3, 6, 21, 22, 23, 26, 28], "idx": 22, "if_body_oper": 4, "ifelsepipelin": 4, "ignor": 24, "illustr": [22, 25], "imag": [1, 3, 6, 19, 21, 24, 26, 27, 28, 29], "image_url": 3, "imaginari": 22, "immedi": [17, 22, 23, 24, 31, 36], "impl_typ": 13, "implement": [1, 3, 4, 19, 24, 25, 26, 28, 29, 30], "impli": 31, "import": [0, 1, 2, 3, 4, 5, 6, 13, 14, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31], "importantand": 6, "impos": 6, "improv": [32, 33], "in_subprocess": 1, "includ": [0, 1, 4, 6, 19, 21, 22, 24, 26, 27, 28, 33], "including_self": 1, "incom": 24, "increas": 13, "increment": 30, "independ": [19, 31], "index": [1, 2, 6, 17, 28], "indic": [6, 13, 22, 23, 24, 27, 28, 31], "individu": 6, "infer": [21, 26], "info": [0, 13, 23], "inform": [1, 3, 6, 19, 22, 24, 25, 27, 28, 30, 32], "inher": 19, "inherit": [1, 22, 25, 26, 31], "init": [0, 14, 18, 21, 22, 23, 26, 30], "initi": [0, 1, 13, 21, 24, 25, 26, 27, 28, 30], "initial_announc": 25, "inject": 29, "innov": [17, 36], "input": [1, 2, 3, 4, 5, 6, 19, 21, 22, 24, 25, 26, 29, 31], "insid": 27, "insight": 32, "inspect": 27, "instal": [17, 19, 22, 33, 36, 37], "instanc": [1, 13, 22, 23, 25, 26, 28, 29, 31], "instanti": [25, 28], "instruct": [6, 19, 24, 26, 29], "int": [1, 2, 3, 4, 5, 6, 14, 27, 28], "integr": [19, 37], "intenum": 6, "interact": [4, 6, 19, 21, 22, 23, 24, 25, 28, 31], "interest": 32, "interfac": [4, 13, 19, 23, 24, 25, 26, 27, 29, 30], "interlay": 19, "intern": 24, "introduc": [19, 21, 22, 24, 27, 28, 31], "intuit": 19, "investopedia": 6, "invit": 32, "invoc": [0, 21, 26], "invok": [1, 6, 24, 25, 29], "involv": [22, 33], "ip": [6, 31], "ipython": 6, "isinst": 24, "isn": 23, "issu": [23, 32, 33], "item": [27, 28], "iter": [2, 25, 28], "its": [1, 2, 6, 21, 22, 24, 26, 27, 28, 29, 30, 31, 33], "itself": 28, "job": 6, "join": [17, 22, 27, 35, 36], "jpg": [21, 29], "jr": 6, "json": [0, 1, 2, 3, 6, 21, 22, 24, 27, 28, 29], "json_arg": 3, "jsondecodeerror": 1, "just": [4, 25, 30], "k": [6, 28], "k1": 4, "k2": 4, "keep": [3, 6, 23, 32, 33], "keep_al": [3, 26], "keep_raw": 6, "kei": [1, 6, 21, 24, 26, 27, 28, 30, 37], "keyerror": 28, "keyword": [6, 27], "kill": 22, "kind": 4, "know": 22, "knowledg": [6, 31], "known": 22, "kwarg": [1, 3, 6, 24, 26, 27, 28], "l": 6, "lambda": 4, "languag": [1, 19, 24, 25, 27, 29], "larg": [19, 27, 29, 31], "last": [2, 3, 21, 22, 29], "later": 24, "latest": 32, "launch": [1, 19, 31], "launch_serv": [1, 31], "launcher": 1, "layer": [6, 19], "lazy_launch": 1, "learn": [6, 22, 27, 30], "least": 1, "leav": 6, "lecun": 6, "length": 29, "less": [6, 19], "let": [19, 22], "level": [0, 13, 17, 19, 23, 36], "li": 6, "licens": 19, "life": 22, "like": [4, 21, 22, 25, 29], "limit": [1, 6, 30], "line": [1, 22, 23, 24], "link": [6, 28], "list": [0, 1, 2, 3, 6, 21, 22, 24, 25, 26, 27, 28, 30], "list_directory_cont": 6, "listen": 1, "liter": [0, 13, 23], "littl": 6, "ll": [22, 23, 30], "llama2": [26, 29], "llm": [19, 29], "load": [0, 1, 2, 3, 21, 22, 26, 27, 28], "load_from_config": 1, "load_memori": 1, "load_model_by_config_nam": 3, "load_web": [6, 27], "local": [0, 1, 3, 13, 19, 21, 22, 28, 31, 33], "local_mod": 1, "localhost": [1, 6, 31], "locat": [6, 22, 29], "log": [0, 13, 17, 22, 24, 36, 37], "log_level": [0, 23], "logger": [0, 13, 28], "logger_level": [0, 22, 23], "logic": [1, 4, 24, 25], "loguru": [13, 23], "london": 29, "long": [25, 26], "longer": 30, "look": 22, "loop": [4, 21, 22], "loop_body_oper": 4, "lynch": 22, "m": [23, 33], "mac": 20, "machin": 31, "made": [30, 33], "mai": [1, 3, 6, 22, 24, 25, 29, 30, 31, 33], "main": [3, 22, 24, 25, 27, 31, 33], "mainli": [27, 31], "maintain": [24, 28], "major": 22, "majority_vot": 22, "make": [3, 24, 29, 30, 31], "manag": [19, 20, 21, 22, 24, 25, 30], "mani": [6, 29], "manipul": 28, "manner": [17, 31, 36], "manual": 25, "map": [1, 4, 25], "match": [2, 22], "matplotlib": 6, "max": [1, 26, 29], "max_game_round": 22, "max_iter": 25, "max_length": 3, "max_loop": 4, "max_pool_s": 1, "max_result": 6, "max_retri": [3, 26], "max_return_token": 6, "max_timeout_second": 1, "max_werewolf_discussion_round": 22, "maxcount_result": 6, "maximum": [4, 6, 29, 30], "maximum_memory_byt": 6, "mayb": [1, 3], "md": 26, "me": 22, "mean": [0, 1, 2, 21], "meanwhil": 31, "mechan": [17, 19, 21, 25, 36], "meet": [4, 24, 29], "member": 33, "memori": [1, 6, 17, 19, 22, 24, 26, 29, 34, 36], "memory_config": 24, "memorybas": 2, "merg": 3, "messag": [0, 1, 3, 5, 6, 21, 22, 24, 26, 27, 29, 30, 31, 33, 34], "message_from_alic": 21, "message_from_bob": 21, "messagebas": 3, "messages_kei": [3, 26], "met": 25, "metadata": 28, "method": [1, 3, 21, 24, 28, 29, 30, 31], "metric": [2, 13, 28], "metric_nam": 13, "metric_name_a": 13, "metric_name_b": 13, "metric_unit": [13, 30], "metric_valu": 13, "microsoft": [6, 27], "might": [22, 33], "migrat": 31, "mind": 24, "mine": 3, "minim": 24, "minor": 31, "miss": [5, 24], "misunderstand": 3, "mix": 25, "mixtur": [29, 31], "mkt": 6, "modal": [19, 28], "mode": 20, "model": [0, 1, 2, 6, 13, 17, 19, 24, 27, 28, 29, 30, 34, 36, 37], "model_a": 30, "model_a_metr": 30, "model_b": 30, "model_b_metr": 30, "model_config": [0, 21, 22, 26], "model_config_nam": [21, 22, 24], "model_config_or_path": 26, "model_dump": 30, "model_nam": [3, 13, 21, 22, 26, 29, 30], "model_respons": 27, "model_typ": [3, 21, 22, 26], "modelrespons": 3, "modelscop": [20, 21, 26], "modelscope_cfg_dict": 21, "modelwrapp": 26, "modelwrapperbas": [3, 6, 26, 29], "moder": 22, "modifi": [1, 24], "modul": [0, 1, 2, 3, 4, 5, 6, 13, 14, 17, 19, 23, 28], "mongodb": [6, 27], "monitor": [3, 13, 17, 34, 36], "monitorbas": [13, 30], "monitorfactori": [13, 30], "more": [0, 1, 3, 6, 21, 22, 23, 24, 27, 28, 31], "most": [22, 28, 29], "move": [6, 27], "move_directori": [6, 27], "move_fil": [6, 27], "msg": [3, 21, 22, 23, 24, 25, 29, 31], "msg_hub": 25, "msghub": [0, 17, 18, 21, 34, 36], "msghubmanag": [0, 25], "much": [0, 25, 33], "multi": [3, 17, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 36], "multimod": [3, 26, 29], "multipl": [3, 4, 13, 21, 22, 25, 27, 29, 30, 31, 33], "must": [3, 13, 22, 24, 29, 31], "my_arg1": 26, "my_arg2": 26, "my_dashscope_chat_config": 26, "my_dashscope_image_synthesis_config": 26, "my_dashscope_multimodal_config": 26, "my_dashscope_text_embedding_config": 26, "my_gemini_chat_config": 26, "my_gemini_embedding_config": 26, "my_model": 26, "my_model_config": 26, "my_ollama_chat_config": 26, "my_ollama_embedding_config": 26, "my_ollama_generate_config": 26, "my_postapiwrapper_config": 26, "myagent": 22, "mymodelwrapp": 26, "mysql": [6, 27], "n": [3, 4, 6, 20, 22, 24, 26, 27, 29], "n1": 22, "n2": 22, "nalic": 29, "name": [0, 1, 3, 5, 6, 13, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 33], "nativ": 6, "natur": [6, 22, 28], "navig": 24, "nbob": 29, "nconstraint": 22, "necessari": [19, 25, 27, 28], "need": [1, 6, 20, 22, 24, 26, 27, 28, 29, 30, 31], "negative_prompt": 26, "neither": 22, "new": [2, 5, 6, 13, 20, 25, 26, 27, 28, 30, 32, 35], "new_ag": 25, "new_particip": 25, "newlin": 29, "next": [25, 37], "nfor": 22, "ngame": 22, "nice": 29, "night": 22, "nin": 22, "non": [6, 19, 31], "none": [0, 1, 2, 3, 4, 5, 6, 13, 14, 21, 24, 25, 27, 28, 29, 31], "nor": 22, "normal": 27, "note": [1, 3, 6, 20, 21, 22, 24, 25, 27, 29, 30], "noth": 4, "notic": [6, 22], "notif": 33, "notifi": 1, "notimplementederror": [24, 28], "noun": 6, "now": [6, 22, 25, 33], "nplayer": 22, "nseer": 22, "nsummar": 6, "nthe": 22, "nthere": 22, "num_inst": 1, "num_result": [6, 27], "number": [1, 2, 4, 6, 22, 23, 25, 27, 28, 29, 30, 31], "nvictori": 22, "nvillag": 22, "nwerewolv": 22, "nwitch": 22, "nyou": [6, 22], "o": 6, "obei": 29, "object": [0, 1, 2, 3, 5, 6, 13, 22, 24, 25, 27, 28, 29, 31], "object_nam": 28, "observ": [0, 1, 22, 23, 24, 25], "obtain": [1, 6, 30], "occur": [24, 27], "offer": [19, 21], "offici": [19, 33], "often": [27, 28, 29], "okai": 22, "ollama": [3, 29], "ollama_chat": [3, 26], "ollama_embed": [3, 26], "ollama_gener": [3, 26], "ollamachatwrapp": [3, 26], "ollamaembeddingwrapp": [3, 26], "ollamagenerationwrapp": [3, 26], "ollamawrapperbas": 3, "omit": [24, 25, 27, 28, 31], "onc": [13, 21, 30, 33], "one": [3, 6, 13, 22, 24, 25, 27, 29], "ongo": 24, "onli": [1, 6, 13, 22, 27, 28, 29, 30, 31], "open": [6, 21, 22, 33], "openai": [3, 6, 21, 22, 27, 28, 29, 30], "openai_api_kei": 21, "openai_cfg_dict": 21, "openai_chat": [3, 21, 22, 26], "openai_dall_": [3, 21, 26], "openai_embed": [3, 21, 26], "openai_model_config": 21, "openai_organ": 21, "openai_respons": 30, "openaichatwrapp": [3, 26], "openaidallewrapp": [3, 26], "openaiembeddingwrapp": [3, 26], "openaiwrapperbas": [3, 26], "oper": [1, 4, 6, 13, 19, 22, 24, 25, 27, 28], "opportun": 22, "optim": [19, 31], "option": [0, 1, 2, 3, 4, 5, 6, 13, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30], "orchestr": [22, 25], "order": [2, 3, 6, 19, 22, 25, 31], "ordinari": 22, "org": 1, "organ": [3, 6, 21, 22, 23, 26, 29, 33], "orient": 25, "origin": [2, 6, 28, 30], "other": [0, 1, 6, 22, 24, 25, 28, 29, 31, 32, 33], "otherwis": [0, 2, 6, 27], "our": [3, 22, 29, 31, 32, 33], "out": [1, 4, 22, 23, 33], "outlast": 22, "outlin": [22, 25, 27], "output": [0, 1, 4, 6, 22, 23, 24, 25], "outsid": 25, "over": 23, "overridden": 1, "overutil": 30, "overview": [19, 27], "overwrit": [2, 6, 28], "own": [1, 3, 17, 21, 22, 34, 36], "p": 6, "packag": [0, 1, 3, 4, 5, 6, 13, 14, 20], "page": [6, 17, 27, 28], "pair": 29, "paper": [1, 6, 31], "paradigm": 31, "parallel": [19, 31], "param": 27, "paramet": [0, 1, 2, 3, 4, 5, 6, 13, 22, 27, 28, 29, 31], "params_prompt": 27, "pars": [1, 3, 6, 27, 29], "parse_func": [1, 3], "parse_html_to_text": 6, "part": [29, 32, 33], "parti": [3, 21, 29], "particip": [0, 4, 22], "particular": 30, "particularli": 30, "pass": [0, 1, 2, 3, 6, 21, 22, 25, 26, 27, 28, 29], "password": 6, "past": [22, 24], "path": [0, 3, 6, 13, 21, 26, 27], "path_log": 13, "path_sav": [14, 23], "pattern": 25, "paus": 30, "peac": 22, "perform": [1, 17, 19, 22, 24, 25, 27, 29, 33, 36], "period": 30, "permiss": 6, "person": [6, 22], "pertain": 19, "phase": 22, "phenomenon": 6, "pictur": [3, 21, 29], "piec": [6, 27, 28], "pip": 33, "pipe": [22, 25], "pipe1": 25, "pipe2": 25, "pipe3": 25, "pipelin": [17, 19, 21, 34, 36], "pipelinebas": [4, 25], "pivot": 24, "placehold": [3, 4, 25], "plai": [22, 28, 29], "plain": 1, "platform": [17, 19, 20, 31, 32, 36], "player": 22, "player1": 22, "player2": 22, "player3": 22, "player4": 22, "player5": 22, "player6": 22, "player_nam": 22, "pleas": [1, 6, 21, 22, 25, 27, 28, 29, 30, 31, 33], "plot": 6, "plt": 6, "plu": [26, 29], "png": 29, "point": [27, 29], "poison": 22, "polici": 29, "pool": [22, 24], "pop": 22, "port": [1, 5, 6, 14, 31], "pose": 6, "possibl": 33, "post": [3, 22], "post_api": [3, 26], "post_api_chat": 3, "post_arg": 3, "postapichatwrapp": 3, "postapimodelwrapperbas": [3, 26], "potenti": [1, 6, 22, 23], "potion": 22, "power": [6, 22], "practic": 25, "pre": [19, 24, 33], "prebuilt": [17, 36], "predat": 22, "predefin": [22, 24], "prefer": [20, 25, 29], "prefix": [3, 6, 13], "prepar": [24, 27, 37], "prepare_funcs_prompt": 1, "preprocess": 6, "present": [6, 19, 22], "preserv": [2, 6], "preserve_ord": [2, 6], "prevent": [3, 25, 30], "primari": [21, 24], "print": [1, 6, 21, 24, 27, 29, 30], "pro": [3, 26, 29], "problem": [27, 32, 33], "problemat": 23, "proce": 22, "process": [1, 6, 22, 23, 24, 25, 27, 28, 29, 31, 33], "produc": [1, 24], "program": [6, 17, 19, 22, 25, 28, 31, 36], "programm": 6, "progress": 32, "project": [0, 20, 23, 24], "prompt": [1, 3, 6, 17, 19, 22, 24, 27, 28, 34, 36], "prompt_token": 30, "promptengin": 34, "prompttyp": 28, "properli": [6, 22, 27], "properti": [1, 27, 28], "propos": 33, "proto": 5, "protocol": 1, "provid": [1, 2, 3, 6, 13, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33], "proxi": 31, "pull": [3, 20, 32], "pure": [17, 36], "purg": 28, "purpos": [3, 22, 24], "py": [19, 22], "pypi": 20, "python": [1, 6, 17, 19, 20, 21, 22, 23, 27, 28, 36], "python3": 20, "qianwen": 3, "qr": 32, "queri": [2, 6, 27, 28], "query_mongodb": [6, 27], "query_mysql": [6, 27], "query_sqlit": [6, 27], "question": [6, 19, 27, 32], "quick": [3, 17, 36, 37], "quickli": [21, 26, 29], "quota": 13, "quotaexceedederror": [13, 30], "qwen": [26, 29], "rais": [1, 3, 13, 24, 28, 33], "rang": [2, 4, 22, 25], "rate": 30, "rather": [28, 29], "raw": [3, 6], "re": [3, 6, 20, 22, 29, 33], "reach": 22, "react": [1, 24], "reactag": [1, 24], "read": [3, 6, 21, 22, 26, 27], "read_json_fil": [6, 27], "read_model_config": 3, "read_text_fil": [6, 27], "readabl": 23, "readi": [19, 22, 24, 31, 33], "readm": 26, "real": [31, 32], "recal": 24, "receiv": [21, 25, 31], "recent": 28, "recent_n": [2, 28], "recommend": [20, 23, 29], "record": [1, 23, 24, 28], "redirect": [13, 23], "refer": [1, 3, 6, 19, 21, 22, 26, 27, 28, 29, 31], "regist": [13, 21, 26], "register_budget": [13, 30], "registr": [13, 30], "regul": 30, "regular": 13, "relat": [1, 2, 4, 5, 6, 29, 30, 32], "relationship": 31, "relev": [2, 28, 32, 33], "reli": [30, 31], "reliabl": [17, 36], "remain": [22, 25], "rememb": [20, 22, 33], "remov": [1, 13, 25, 28], "renam": 27, "reorgan": 29, "repeat": 22, "repeatedli": 25, "replac": [25, 31], "repli": [1, 22, 24, 27, 28, 31], "repons": 24, "report": 35, "repositori": [3, 20, 21, 32], "repres": [1, 4, 6, 19, 23, 25, 28, 29, 31], "represent": 28, "reproduc": 33, "reqeust": 5, "request": [1, 3, 5, 6, 23, 27, 32], "requir": [0, 1, 3, 13, 17, 20, 24, 25, 26, 27, 28, 29, 30, 36], "require_url": 24, "required_kei": [1, 24], "reset": 28, "reset_audi": 1, "resili": 19, "resolv": 33, "resourc": [19, 28], "respect": 6, "respond": [22, 29], "respons": [0, 1, 3, 5, 6, 19, 21, 22, 24, 25, 27, 28, 33], "responsepars": 3, "responseparsingerror": 3, "responsestub": 5, "rest": [6, 29], "result": [1, 6, 22, 24, 27, 29], "resurrect": 22, "retain": 24, "retri": [6, 17, 36], "retriev": [2, 6, 27, 28], "retrieve_by_embed": [2, 28], "retrieve_from_list": [6, 27], "retry_interv": 3, "return": [1, 2, 3, 4, 5, 6, 13, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33], "return_typ": 28, "reveal": 22, "revers": 2, "risk": 6, "rm": 6, "rm_audienc": 1, "rn": 6, "robust": [17, 19, 36], "role": [1, 3, 6, 21, 24, 28, 29], "round": 22, "rpc": [1, 17, 19, 31], "rpcagent": 1, "rpcagentcli": 5, "rpcagentserverlaunch": [1, 31], "rpcagentservic": 5, "rpcagentstub": 5, "rpcmsg": 5, "rule": [22, 29], "run": [0, 6, 19, 20, 27, 31], "runtim": [0, 19, 28, 31], "safeti": 6, "sai": [1, 22], "same": [0, 13, 27, 29, 30, 31], "satisfi": 6, "save": [0, 5, 6, 22], "save_api_invok": 0, "save_cod": 0, "save_dir": 0, "save_log": 0, "scale": [27, 31], "scan": 32, "scenario": [3, 25, 28, 29], "scene": 27, "schema": [1, 6, 27], "score": 6, "score_func": 6, "scratch": 34, "script": [19, 20, 21, 26], "search": [0, 6, 17, 27], "search_queri": 6, "second": [3, 6, 29], "secondari": 24, "secretli": 22, "section": [21, 22, 25, 29], "secur": 6, "sed": 6, "see": [22, 23, 29, 33], "seed": 26, "seek": 32, "seem": [22, 31], "seen": 31, "seer": 22, "segment": 2, "select": [6, 25, 28], "selected_tags_text": 6, "self": [6, 22, 24, 25, 26, 27, 28], "self_define_func": 6, "self_parse_func": 6, "sell": 6, "send": 28, "sender": [21, 28], "sent": [22, 31], "separ": [30, 31, 33], "sequenc": [0, 1, 2, 3, 4, 6, 19, 24, 25, 28], "sequenti": [4, 21], "sequentialpipelin": [4, 21, 22], "seral": 5, "seri": [1, 19, 30], "serial": [5, 6, 27, 28], "serv": [22, 24, 25, 30], "server": [1, 5, 6, 31], "server_a": 31, "servic": [1, 5, 17, 21, 22, 24, 31, 34, 36], "service_bot": 24, "service_func": 6, "servicebot": 24, "serviceexecstatu": [6, 27], "serviceexestatu": 27, "servicefactori": [6, 27], "servicerespons": [1, 6], "session": 6, "set": [0, 1, 2, 5, 6, 13, 20, 25, 26, 27, 28, 30], "set_quota": [13, 30], "set_respons": 5, "setitim": 6, "setup": [13, 19, 23, 25], "setup_logg": 13, "sever": [3, 19, 22, 24], "share": [0, 25, 32], "she": 22, "shell": 6, "should": [0, 1, 3, 6, 19, 21, 22, 26, 27, 28, 29], "shouldn": 3, "show": [6, 19, 31, 32], "shown": [20, 29], "shrink": 29, "shutdown": 1, "side": 22, "sig": 27, "signal": 6, "signatur": 27, "similar": [6, 22, 25, 27, 28, 29], "simpl": [1, 3, 21, 23, 29, 31], "simplic": 29, "simplifi": [19, 22, 25, 29], "simultan": 31, "sinc": [6, 29, 31], "singl": [3, 19, 28, 29], "singleton": 13, "size": [2, 26, 28, 29], "slower": 23, "small": 26, "smoothli": 29, "snippet": [6, 22, 33], "so": [6, 20, 27, 29], "social": 22, "solut": [3, 29, 31], "solv": [19, 24], "some": [1, 6, 24, 25, 26, 27, 29, 30, 33], "some_messag": 25, "someon": 6, "someth": [22, 23], "sometim": [22, 29], "soon": 27, "sophist": 22, "sourc": [0, 1, 2, 3, 4, 5, 6, 13, 14, 21, 24, 26, 28], "source_path": 6, "speak": [1, 3, 22, 24, 29], "speaker": [23, 28, 29], "special": [4, 22, 23, 24, 31], "specif": [0, 1, 2, 3, 5, 6, 13, 19, 20, 21, 23, 24, 26, 27, 28, 30, 31], "specifi": [1, 2, 6, 21, 22, 24, 25, 26, 27, 28, 29, 30], "speech": 21, "sql": [6, 27], "sqlite": [6, 13, 27], "sqlite3": 30, "sqlitemonitor": 30, "src": 19, "stabil": [17, 36], "stage": 30, "stai": [26, 32], "stand": [21, 23], "standalon": [21, 25], "standard": [6, 22, 23, 28], "star": 32, "start": [1, 3, 6, 14, 19, 23, 24, 26, 29, 30, 31, 33], "state": [6, 19, 23, 24], "static": 3, "statu": [6, 27], "stderr": [13, 23], "stem": 6, "step": [20, 21, 24, 25, 33, 37], "step1": 37, "step2": 37, "step3": 37, "still": [22, 23, 30], "stop": 1, "storag": 19, "store": [1, 2, 6, 24, 28], "str": [0, 1, 2, 3, 5, 6, 13, 14, 24, 26, 27, 28], "straightforward": [3, 21], "strateg": 22, "strategi": [3, 19, 22, 25, 34], "streamlin": [17, 25, 36], "strengthen": 19, "string": [1, 2, 3, 6, 23, 27, 28], "structur": [21, 25, 28, 29, 37], "stub": 5, "style": [6, 27, 29], "sub": 5, "subclass": [1, 19, 24, 25, 27, 28, 29], "submit": 32, "subprocess": 1, "subset": 6, "substanc": [6, 28], "success": [0, 6, 13, 23, 27], "successfulli": [6, 23], "sucess": 6, "sugar": 19, "suggest": [6, 27, 32, 33], "suitabl": [3, 17, 24, 28, 29, 36], "summar": [6, 24, 27, 29], "summari": [1, 6, 22], "super": [26, 28], "superclass": 24, "suppli": 25, "support": [6, 13, 17, 19, 22, 25, 27, 29, 30, 31, 32, 34, 36], "suppos": [30, 31], "sure": 30, "surviv": 22, "survivor": 22, "suspect": 22, "suspici": 22, "switch": [4, 25], "switch_result": 25, "switchpipelin": 4, "syntact": 19, "synthesi": [3, 26], "sys_prompt": [1, 21, 22, 24], "system": [1, 3, 6, 19, 22, 24, 28, 29, 30, 31], "system_prompt": [6, 29], "sythesi": 26, "t": [1, 2, 3, 13, 22, 23, 28, 31], "tabl": [24, 25, 27], "tackl": 27, "tag": 6, "tailor": [22, 24], "take": [1, 2, 6, 13, 19, 21, 22, 24, 27, 29], "taken": [1, 22, 25], "target": [22, 29, 31], "task": [1, 19, 24, 26, 27], "teammat": 22, "teardown": 25, "technic": 31, "tediou": 27, "tell": 28, "temperatur": [22, 26], "templat": [4, 24], "temporarymemori": 2, "tensorflow": 19, "term": [6, 21, 25, 30], "termin": [6, 21, 22], "test": 19, "text": [1, 3, 6, 21, 24, 26, 27, 28, 29], "texttoimageag": [1, 24], "textual": 1, "than": [3, 6, 22, 23, 28, 29], "thank": [23, 29], "thei": [21, 22, 25, 31], "them": [1, 4, 6, 22, 23, 24, 26, 27, 29, 30, 33], "themselv": [22, 25], "therefor": 29, "thi": [0, 1, 3, 5, 6, 13, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33], "thing": [6, 31], "think": 22, "third": [21, 29], "those": 30, "thought": [1, 22], "thread": 5, "three": [0, 17, 19, 36], "thrive": 33, "through": [21, 22, 24, 25, 26, 28, 31], "throw": 30, "thrown": 30, "thu": 25, "ti": 6, "time": [1, 6, 13, 22, 27, 28, 29, 31, 32, 33], "timeout": [1, 3, 5, 6], "timeouterror": 1, "timestamp": [23, 28], "titl": [6, 33], "to_all_continu": 22, "to_all_r": 22, "to_all_vot": 22, "to_dict": 3, "to_dist": [1, 31], "to_list": 3, "to_mem": [2, 28], "to_seer": 22, "to_seer_result": 22, "to_str": 28, "to_witch_resurrect": 22, "to_wolv": 22, "to_wolves_r": 22, "to_wolves_vot": 22, "todai": [3, 29], "todo": 1, "togeth": 22, "token": [6, 30], "token_limit_prompt": 6, "token_num": 30, "token_num_us": 30, "toler": [17, 19, 36], "tongyi": 3, "tongyi_chat": 3, "tonight": 22, "too": 6, "took": 21, "tool": [1, 6, 19, 20, 27], "top": [6, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33], "top_k": [2, 6], "topic": 22, "total": [22, 30], "touch": 23, "townsfolk": 22, "trace": [0, 13, 23], "track": [23, 30], "tracker": 33, "transform": 26, "transmiss": 19, "treat": [1, 29], "trigger": [4, 13], "true": [0, 1, 2, 4, 6, 21, 22, 24, 25, 28, 31], "try": [22, 24, 27, 28, 30], "tupl": [1, 6], "turbo": [21, 22, 26, 30], "turn": [6, 22], "tutori": [19, 21, 22, 23, 24, 27, 28, 30, 31], "two": [6, 21, 22, 25, 26, 27, 28, 29, 31], "type": [1, 2, 3, 4, 5, 6, 13, 21, 24, 25, 26, 27, 28], "typic": [6, 24, 28], "u": [3, 6, 22, 27, 32, 33], "ui": 14, "under": [20, 23, 26, 30], "underli": 29, "underpin": 24, "understand": [6, 23, 25, 27, 34], "undetect": 22, "unexpect": 23, "unfold": 22, "unifi": [0, 24, 27, 29], "unintend": 25, "union": [0, 1, 2, 3, 6, 24, 25, 28], "uniqu": [1, 6, 13, 21, 24, 28, 30], "unit": [2, 13, 30], "unittest": [13, 19], "unix": 6, "unless": 22, "unlik": 28, "unlock": 22, "unset": 21, "until": [21, 22, 25], "untrust": 6, "up": [20, 30, 32], "updat": [3, 13, 22, 24, 28, 29, 32], "update_alive_play": 22, "update_config": 2, "update_monitor": 3, "upon": [25, 28], "url": [3, 6, 19, 21, 24, 27, 28, 29], "url_to_png1": 29, "url_to_png2": 29, "url_to_png3": 29, "us": [0, 1, 2, 3, 4, 5, 6, 13, 17, 19, 21, 22, 23, 24, 25, 26, 28, 29, 31, 33, 34, 36], "usabl": 19, "usag": [1, 6, 13, 19, 21, 22, 24, 28, 34], "use_dock": 6, "use_memori": [22, 24], "user": [1, 3, 6, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 36], "user_ag": 21, "user_agent_config": 24, "user_input": 29, "user_messag": 29, "user_proxy_ag": 24, "userag": [1, 21], "usernam": [6, 27, 33], "util": [17, 19, 21, 22, 23, 27, 30], "uuid4": 28, "v1": [6, 26], "v2": 26, "valid": 1, "valu": [0, 1, 2, 3, 5, 6, 13, 27, 28, 29, 30], "variabl": [6, 21, 22, 26, 29], "varieti": [6, 19, 22], "variou": [17, 24, 26, 27, 29, 30, 36], "ve": [22, 33], "vector": 2, "veri": [0, 6], "version": [1, 4, 6, 31, 33], "versu": 25, "vertex": 3, "via": [1, 21, 22, 23], "video": [19, 21, 24, 27, 28], "villag": 22, "vim": 6, "virtual": [24, 37], "visual": 23, "vl": [3, 26, 29], "vllm": [3, 22, 26], "voic": 24, "vote": 22, "vote_r": 22, "wa": 28, "wai": [23, 28, 30, 31], "wait": [1, 31, 33], "wait_until_termin": [1, 31], "want": [6, 30], "wanx": 26, "warn": [0, 6, 13, 23], "watch": 32, "we": [0, 1, 3, 6, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31, 32, 33], "weather": 29, "web": [0, 6, 17, 19, 23, 27, 28], "web_text_or_url": 6, "webpag": 6, "websit": [21, 24, 28], "webui": [17, 19, 36, 37], "welcom": [3, 22, 23, 32, 33], "well": [6, 22, 27], "werewolf": 1, "werewolv": 22, "what": [0, 3, 6, 21, 29, 37], "when": [0, 1, 3, 4, 6, 13, 19, 22, 23, 26, 27, 28, 29, 30, 31, 33], "where": [1, 3, 6, 21, 22, 24, 25, 28, 29, 31], "whether": [0, 1, 2, 3, 4, 6, 13, 22, 28, 30, 31, 33], "which": [0, 1, 2, 3, 4, 6, 13, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31], "while": [4, 6, 21, 22, 23, 25, 27, 31], "whilelooppipelin": 4, "who": [6, 20, 22, 26, 28], "whose": 29, "why": 37, "wide": 31, "win": 22, "window": [6, 20], "witch": 22, "witch_nam": 22, "within": [1, 6, 19, 21, 22, 24, 25, 28], "without": [0, 1, 22, 24, 25, 29, 31], "wolf": 22, "wolv": 22, "won": 22, "wonder": 3, "work": [6, 22, 28, 29, 33], "workflow": [4, 31], "world": 23, "worri": 31, "worth": 25, "would": 22, "wrap": [1, 3, 6, 27], "wrapper": [1, 3, 19, 27, 29, 34], "write": [2, 6, 27, 31, 33], "write_json_fil": [6, 27], "write_text_fil": [6, 27], "written": [6, 27], "wrong": 23, "www": 6, "x": [1, 4, 5, 21, 22, 24, 25, 27, 31], "x1": 0, "x2": 0, "xxx": [21, 22, 26, 27], "xxx1": 29, "xxx2": 29, "xxxxx": 6, "yet": [6, 31], "you": [2, 3, 6, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33], "your": [1, 6, 13, 17, 20, 21, 27, 30, 32, 34, 36, 37], "your_api_kei": 26, "your_config_nam": 26, "your_cse_id": 6, "your_google_api_kei": 6, "your_organ": 26, "your_save_path": 23, "yourag": 27, "yyi": 26, "zero": [30, 31], "zh": 3, "\u7701\u7565\u4ee3\u7801\u4ee5\u7b80\u5316": 28, "\u9489\u9489": 35}, "titles": ["agentscope", "agentscope.agents", "agentscope.memory", "agentscope.models", "agentscope.pipelines", "agentscope.rpc", "agentscope.service", "agentscope.service.execute_code", "agentscope.service.file", "agentscope.service.retrieval", "agentscope.service.sql_query", "agentscope.service.text_processing", "agentscope.service.web", "agentscope.utils", "agentscope.web", "agentscope.web.studio", "agentscope.web.workstation", "AgentScope Documentation", "agentscope", "About AgentScope", "Installation", "Quick Start", "Crafting Your First Application", "Logging and WebUI", "Customizing Your Own Agent", "Pipeline and MsgHub", "Model", "Service", "Memory", "Prompt Engineering", "Monitor", "Distribution", "Joining AgentScope Community", "Contribute to AgentScope", "Advanced Exploration", "Get Involved", "Welcome to AgentScope Tutorial Hub", "Getting Started"], "titleterms": {"1": [22, 31], "2": [22, 31], "3": 22, "4": 22, "5": 22, "For": 33, "Will": 29, "about": [19, 27, 28, 29, 31], "actor": 31, "ad": 25, "advanc": [17, 30, 34, 36], "agent": [1, 19, 21, 22, 24, 31], "agentbas": 24, "agentpool": 24, "agentscop": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 30, 32, 33, 36], "an": 30, "api": [17, 22, 26, 30], "applic": [22, 31], "ask": 33, "basic": [26, 30], "branch": 33, "broadcast": 25, "budget": 30, "bug": 33, "build": 26, "built": [27, 29], "categori": 25, "challeng": 29, "chang": 33, "chat": 23, "class": [28, 29], "clone": 33, "code": [19, 33], "codebas": 33, "combin": 25, "commit": 33, "commun": 32, "compon": 29, "concept": 19, "conda": 20, "config": 22, "configur": 26, "construct": 29, "contribut": 33, "convers": 21, "craft": 22, "creat": [20, 21, 25, 26, 31, 33], "custom": 24, "dashscop": 26, "dashscopechatwrapp": 29, "dashscopemultimodalwrapp": 29, "defin": 22, "delet": 25, "deprec": 29, "design": 19, "detail": 26, "dialogag": 24, "dingtalk": 32, "discord": 32, "distinguish": 30, "distribut": 31, "document": 17, "dynam": 29, "each": 22, "engin": 29, "environ": 20, "exampl": 27, "execute_cod": 7, "explor": [17, 24, 34, 36], "factori": 27, "featur": [29, 33], "file": 8, "first": 22, "flow": 31, "fork": 33, "forlooppipelin": 25, "format": [26, 29], "from": [20, 24, 26], "function": 27, "futur": 29, "game": 22, "gemini": 26, "geminichatwrapp": 29, "get": [17, 22, 30, 35, 36, 37], "github": 32, "handl": 30, "how": [19, 27], "hub": [17, 36], "i": 19, "ifelsepipelin": 25, "implement": [22, 31], "indic": 17, "inform": 23, "initi": [22, 29], "instal": 20, "instanc": 30, "integr": 23, "involv": [17, 35, 36], "join": [29, 32], "kei": [19, 29], "leverag": 22, "list": 29, "log": 23, "logger": 23, "logic": 22, "make": 33, "master": 31, "memori": [2, 28], "memorybas": 28, "messag": [19, 23, 25, 28], "messagebas": 28, "metric": 30, "mode": 31, "model": [3, 21, 22, 26, 31], "monitor": 30, "msg": 28, "msghub": [22, 25], "navig": [17, 36], "new": 33, "next": 22, "note": 23, "ollama": 26, "ollamachatwrapp": 29, "ollamagenerationwrapp": 29, "openai": 26, "openaichatwrapp": 29, "orchestr": 31, "output": 29, "own": [24, 26], "paramet": 26, "particip": 25, "peer": 31, "pip": 20, "pipelin": [4, 22, 25], "placehold": 31, "post": 26, "prefix": 30, "prepar": [21, 22], "prompt": 29, "promptengin": 29, "pull": 33, "quick": [21, 23], "quota": 30, "refer": 17, "regist": 30, "remov": 30, "report": 33, "repositori": 33, "request": [26, 33], "reset": 30, "retriev": [9, 30], "review": 33, "role": 22, "rpc": 5, "run": [22, 23], "scratch": 26, "sequentialpipelin": 25, "servic": [6, 7, 8, 9, 10, 11, 12, 19, 26, 27], "servicerespons": 27, "set": [22, 23], "slave": 31, "sourc": 20, "sql_queri": 10, "start": [17, 21, 22, 36, 37], "step": [22, 31], "step1": 21, "step2": 21, "step3": 21, "strategi": 29, "string": 29, "structur": 19, "studio": 15, "submit": 33, "support": 26, "switchpipelin": 25, "system": 23, "tabl": 17, "temporarymemori": 28, "text_process": 11, "tutori": [17, 36], "type": 29, "understand": [24, 30], "up": [22, 23], "updat": 30, "us": [20, 27, 30], "usag": [25, 30, 31], "userag": 24, "util": 13, "virtual": 20, "virtualenv": 20, "wai": 29, "web": [12, 14, 15, 16], "webui": 23, "welcom": [17, 36], "werewolf": 22, "what": 19, "whilelooppipelin": 25, "why": 19, "workflow": 19, "workstat": 16, "wrapper": 26, "your": [22, 24, 26, 33], "\u9489\u9489": 32}}) \ No newline at end of file +Search.setIndex({"alltitles": {"About AgentScope": [[77, "about-agentscope"]], "About Implementation": [[89, "about-implementation"]], "About Memory": [[86, "about-memory"]], "About Message": [[86, "about-message"]], "About PromptEngine Class": [[87, "about-promptengine-class"]], "About Service Factory": [[85, "about-service-factory"]], "About ServiceResponse": [[85, "about-serviceresponse"]], "Actor Model": [[89, "actor-model"]], "Adding and Deleting Participants": [[83, "adding-and-deleting-participants"]], "Advanced Exploration": [[75, "advanced-exploration"], [92, "advanced-exploration"], [94, "advanced-exploration"]], "Advanced Usage": [[88, "advanced-usage"]], "Agent": [[77, "agent"]], "AgentScope API Reference": [[75, null]], "AgentScope Code Structure": [[77, "agentscope-code-structure"]], "AgentScope Documentation": [[75, "agentscope-documentation"]], "Basic Parameters": [[84, "basic-parameters"]], "Basic Usage": [[88, "basic-usage"]], "Broadcast message in MsgHub": [[83, "broadcast-message-in-msghub"]], "Build Model Service from Scratch": [[84, "build-model-service-from-scratch"]], "Built-in Prompt Strategies": [[87, "built-in-prompt-strategies"]], "Built-in Service Functions": [[85, "built-in-service-functions"]], "Category": [[83, "category"]], "Challenges in Prompt Construction": [[87, "challenges-in-prompt-construction"]], "Code Review": [[91, "code-review"]], "Commit Your Changes": [[91, "commit-your-changes"]], "Configuration": [[84, "configuration"]], "Configuration Format": [[84, "configuration-format"]], "Contribute to AgentScope": [[91, "contribute-to-agentscope"]], "Contribute to Codebase": [[91, "contribute-to-codebase"]], "Crafting Your First Application": [[80, "crafting-your-first-application"]], "Creat Your Own Model Wrapper": [[84, "creat-your-own-model-wrapper"]], "Create a New Branch": [[91, "create-a-new-branch"]], "Create a Virtual Environment": [[78, "create-a-virtual-environment"]], "Creating a MsgHub": [[83, "creating-a-msghub"]], "Customizing Agents from the AgentPool": [[82, "customizing-agents-from-the-agentpool"]], "Customizing Your Own Agent": [[82, "customizing-your-own-agent"]], "DashScope API": [[84, "dashscope-api"]], "DashScopeChatWrapper": [[87, "dashscopechatwrapper"]], "DashScopeMultiModalWrapper": [[87, "dashscopemultimodalwrapper"]], "Detailed Parameters": [[84, "detailed-parameters"]], "DialogAgent": [[82, "dialogagent"]], "DingTalk (\u9489\u9489)": [[90, "dingtalk"]], "Discord": [[90, "discord"]], "Distribution": [[89, "distribution"]], "Example": [[85, "example"]], "Exploring the AgentPool": [[82, "exploring-the-agentpool"]], "ForLoopPipeline": [[83, "forlooppipeline"]], "Fork and Clone the Repository": [[91, "fork-and-clone-the-repository"]], "Formatting Prompts in Dynamic Way": [[87, "formatting-prompts-in-dynamic-way"]], "Gemini API": [[84, "gemini-api"]], "GeminiChatWrapper": [[87, "geminichatwrapper"]], "Get Involved": [[93, "get-involved"]], "Get a Monitor Instance": [[88, "get-a-monitor-instance"]], "Getting Involved": [[75, "getting-involved"], [94, "getting-involved"]], "Getting Started": [[75, "getting-started"], [80, "getting-started"], [94, "getting-started"], [95, "getting-started"]], "GitHub": [[90, "github"]], "Handling Quotas": [[88, "handling-quotas"]], "How is AgentScope designed?": [[77, "how-is-agentscope-designed"]], "How to use Service Functions": [[85, "how-to-use-service-functions"]], "IfElsePipeline": [[83, "ifelsepipeline"]], "Implement Werewolf Pipeline": [[80, "implement-werewolf-pipeline"]], "Indices and tables": [[75, "indices-and-tables"]], "Initialization": [[87, "initialization"]], "Install from Source": [[78, "install-from-source"]], "Install with Pip": [[78, "install-with-pip"]], "Installation": [[78, "installation"]], "Installing AgentScope": [[78, "installing-agentscope"]], "Integrating logging with WebUI": [[81, "integrating-logging-with-webui"]], "Joining AgentScope Community": [[90, "joining-agentscope-community"]], "Joining Prompt Components": [[87, "joining-prompt-components"]], "Key Concepts": [[77, "key-concepts"]], "Key Features of PromptEngine": [[87, "key-features-of-promptengine"]], "Leverage Pipeline and MsgHub": [[80, "leverage-pipeline-and-msghub"]], "Logging": [[81, "logging"]], "Logging a Chat Message": [[81, "logging-a-chat-message"]], "Logging a System information": [[81, "logging-a-system-information"]], "Logging and WebUI": [[81, "logging-and-webui"]], "Making Changes": [[91, "making-changes"]], "Master-Slave Mode": [[89, "master-slave-mode"]], "Memory": [[86, "memory"]], "MemoryBase Class": [[86, "memorybase-class"]], "Message": [[77, "message"]], "MessageBase Class": [[86, "messagebase-class"]], "Model": [[84, "model"]], "Monitor": [[88, "monitor"]], "Msg Class": [[86, "msg-class"]], "MsgHub": [[83, "msghub"]], "Next step": [[80, "next-step"]], "Note": [[81, "note"]], "Ollama API": [[84, "ollama-api"]], "OllamaChatWrapper": [[87, "ollamachatwrapper"]], "OllamaGenerationWrapper": [[87, "ollamagenerationwrapper"]], "OpenAI API": [[84, "openai-api"]], "OpenAIChatWrapper": [[87, "openaichatwrapper"]], "Output List Type Prompt": [[87, "output-list-type-prompt"]], "Output String Type Prompt": [[87, "output-string-type-prompt"]], "Peer-to-Peer Mode": [[89, "peer-to-peer-mode"]], "Pipeline Combination": [[83, "pipeline-combination"]], "Pipeline and MsgHub": [[83, "pipeline-and-msghub"]], "Pipelines": [[83, "pipelines"]], "PlaceHolder": [[89, "placeholder"]], "Post Request API": [[84, "post-request-api"]], "Prompt Engine (Will be deprecated in the future)": [[87, "prompt-engine-will-be-deprecated-in-the-future"]], "Prompt Engineering": [[87, "prompt-engineering"]], "Prompt Strategy": [[87, "prompt-strategy"], [87, "id1"], [87, "id2"], [87, "id3"], [87, "id4"], [87, "id5"]], "Quick Running": [[81, "quick-running"]], "Quick Start": [[79, "quick-start"]], "Register a budget for an API": [[88, "register-a-budget-for-an-api"]], "Registering API Usage Metrics": [[88, "registering-api-usage-metrics"]], "Report Bugs and Ask For New Features?": [[91, "report-bugs-and-ask-for-new-features"]], "Resetting and Removing Metrics": [[88, "resetting-and-removing-metrics"]], "Retrieving Metrics": [[88, "retrieving-metrics"]], "SequentialPipeline": [[83, "sequentialpipeline"]], "Service": [[77, "service"], [85, "service"]], "Setting Up the Logger": [[81, "setting-up-the-logger"]], "Step 1: Create a Distributed Agent": [[89, "step-1-create-a-distributed-agent"]], "Step 1: Prepare Model API and Set Model Configs": [[80, "step-1-prepare-model-api-and-set-model-configs"]], "Step 2: Define the Roles of Each Agent": [[80, "step-2-define-the-roles-of-each-agent"]], "Step 2: Orchestrate Distributed Application Flow": [[89, "step-2-orchestrate-distributed-application-flow"]], "Step 3: Initialize AgentScope and the Agents": [[80, "step-3-initialize-agentscope-and-the-agents"]], "Step 4: Set Up the Game Logic": [[80, "step-4-set-up-the-game-logic"]], "Step 5: Run the Application": [[80, "step-5-run-the-application"]], "Step1: Prepare Model": [[79, "step1-prepare-model"]], "Step2: Create Agents": [[79, "step2-create-agents"]], "Step3: Agent Conversation": [[79, "step3-agent-conversation"]], "Submit a Pull Request": [[91, "submit-a-pull-request"]], "Supported Models": [[84, "supported-models"]], "SwitchPipeline": [[83, "switchpipeline"]], "TemporaryMemory": [[86, "temporarymemory"]], "Tutorial Navigator": [[75, "tutorial-navigator"], [94, "tutorial-navigator"]], "Understanding AgentBase": [[82, "understanding-agentbase"]], "Understanding the Monitor in AgentScope": [[88, "understanding-the-monitor-in-agentscope"]], "Updating Metrics": [[88, "updating-metrics"]], "Usage": [[83, "usage"], [83, "id1"], [89, "usage"]], "UserAgent": [[82, "useragent"]], "Using Conda": [[78, "using-conda"]], "Using Virtualenv": [[78, "using-virtualenv"]], "Using prefix to Distinguish Metrics": [[88, "using-prefix-to-distinguish-metrics"]], "Using the Monitor": [[88, "using-the-monitor"]], "Welcome to AgentScope Tutorial Hub": [[75, "welcome-to-agentscope-tutorial-hub"], [94, "welcome-to-agentscope-tutorial-hub"]], "What is AgentScope?": [[77, "what-is-agentscope"]], "WhileLoopPipeline": [[83, "whilelooppipeline"]], "Why AgentScope?": [[77, "why-agentscope"]], "Workflow": [[77, "workflow"]], "agentscope": [[0, "module-agentscope"], [76, "agentscope"]], "agentscope.agents": [[1, "module-agentscope.agents"]], "agentscope.agents.agent": [[2, "module-agentscope.agents.agent"]], "agentscope.agents.dialog_agent": [[3, "module-agentscope.agents.dialog_agent"]], "agentscope.agents.dict_dialog_agent": [[4, "module-agentscope.agents.dict_dialog_agent"]], "agentscope.agents.operator": [[5, "module-agentscope.agents.operator"]], "agentscope.agents.react_agent": [[6, "module-agentscope.agents.react_agent"]], "agentscope.agents.rpc_agent": [[7, "module-agentscope.agents.rpc_agent"]], "agentscope.agents.text_to_image_agent": [[8, "module-agentscope.agents.text_to_image_agent"]], "agentscope.agents.user_agent": [[9, "module-agentscope.agents.user_agent"]], "agentscope.constants": [[10, "module-agentscope.constants"]], "agentscope.file_manager": [[11, "module-agentscope.file_manager"]], "agentscope.memory": [[12, "module-agentscope.memory"]], "agentscope.memory.memory": [[13, "module-agentscope.memory.memory"]], "agentscope.memory.temporary_memory": [[14, "module-agentscope.memory.temporary_memory"]], "agentscope.message": [[15, "module-agentscope.message"]], "agentscope.models": [[16, "module-agentscope.models"]], "agentscope.models.config": [[17, "module-agentscope.models.config"]], "agentscope.models.dashscope_model": [[18, "module-agentscope.models.dashscope_model"]], "agentscope.models.gemini_model": [[19, "module-agentscope.models.gemini_model"]], "agentscope.models.model": [[20, "module-agentscope.models.model"]], "agentscope.models.ollama_model": [[21, "module-agentscope.models.ollama_model"]], "agentscope.models.openai_model": [[22, "module-agentscope.models.openai_model"]], "agentscope.models.post_model": [[23, "module-agentscope.models.post_model"]], "agentscope.models.response": [[24, "module-agentscope.models.response"]], "agentscope.msghub": [[25, "module-agentscope.msghub"]], "agentscope.pipelines": [[26, "module-agentscope.pipelines"]], "agentscope.pipelines.functional": [[27, "module-agentscope.pipelines.functional"]], "agentscope.pipelines.pipeline": [[28, "module-agentscope.pipelines.pipeline"]], "agentscope.prompt": [[29, "module-agentscope.prompt"]], "agentscope.rpc": [[30, "module-agentscope.rpc"]], "agentscope.rpc.rpc_agent_client": [[31, "module-agentscope.rpc.rpc_agent_client"]], "agentscope.rpc.rpc_agent_pb2": [[32, "module-agentscope.rpc.rpc_agent_pb2"]], "agentscope.rpc.rpc_agent_pb2_grpc": [[33, "module-agentscope.rpc.rpc_agent_pb2_grpc"]], "agentscope.service": [[34, "module-agentscope.service"]], "agentscope.service.execute_code": [[35, "module-agentscope.service.execute_code"]], "agentscope.service.execute_code.exec_python": [[36, "module-agentscope.service.execute_code.exec_python"]], "agentscope.service.execute_code.exec_shell": [[37, "module-agentscope.service.execute_code.exec_shell"]], "agentscope.service.file": [[38, "module-agentscope.service.file"]], "agentscope.service.file.common": [[39, "module-agentscope.service.file.common"]], "agentscope.service.file.json": [[40, "module-agentscope.service.file.json"]], "agentscope.service.file.text": [[41, "module-agentscope.service.file.text"]], "agentscope.service.retrieval": [[42, "module-agentscope.service.retrieval"]], "agentscope.service.retrieval.retrieval_from_list": [[43, "module-agentscope.service.retrieval.retrieval_from_list"]], "agentscope.service.retrieval.similarity": [[44, "module-agentscope.service.retrieval.similarity"]], "agentscope.service.service_factory": [[45, "module-agentscope.service.service_factory"]], "agentscope.service.service_response": [[46, "module-agentscope.service.service_response"]], "agentscope.service.service_status": [[47, "module-agentscope.service.service_status"]], "agentscope.service.sql_query": [[48, "module-agentscope.service.sql_query"]], "agentscope.service.sql_query.mongodb": [[49, "module-agentscope.service.sql_query.mongodb"]], "agentscope.service.sql_query.mysql": [[50, "module-agentscope.service.sql_query.mysql"]], "agentscope.service.sql_query.sqlite": [[51, "module-agentscope.service.sql_query.sqlite"]], "agentscope.service.text_processing": [[52, "module-agentscope.service.text_processing"]], "agentscope.service.text_processing.summarization": [[53, "module-agentscope.service.text_processing.summarization"]], "agentscope.service.web": [[54, "module-agentscope.service.web"]], "agentscope.service.web.arxiv": [[55, "module-agentscope.service.web.arxiv"]], "agentscope.service.web.download": [[56, "module-agentscope.service.web.download"]], "agentscope.service.web.search": [[57, "module-agentscope.service.web.search"]], "agentscope.service.web.web_digest": [[58, "module-agentscope.service.web.web_digest"]], "agentscope.utils": [[59, "module-agentscope.utils"]], "agentscope.utils.common": [[60, "module-agentscope.utils.common"]], "agentscope.utils.logging_utils": [[61, "module-agentscope.utils.logging_utils"]], "agentscope.utils.monitor": [[62, "module-agentscope.utils.monitor"]], "agentscope.utils.token_utils": [[63, "module-agentscope.utils.token_utils"]], "agentscope.utils.tools": [[64, "module-agentscope.utils.tools"]], "agentscope.web": [[65, "module-agentscope.web"]], "agentscope.web.studio": [[66, "module-agentscope.web.studio"]], "agentscope.web.studio.constants": [[67, "module-agentscope.web.studio.constants"]], "agentscope.web.studio.studio": [[68, "module-agentscope.web.studio.studio"]], "agentscope.web.studio.utils": [[69, "module-agentscope.web.studio.utils"]], "agentscope.web.workstation": [[70, "module-agentscope.web.workstation"]], "agentscope.web.workstation.workflow": [[71, "module-agentscope.web.workstation.workflow"]], "agentscope.web.workstation.workflow_dag": [[72, "module-agentscope.web.workstation.workflow_dag"]], "agentscope.web.workstation.workflow_node": [[73, "module-agentscope.web.workstation.workflow_node"]], "agentscope.web.workstation.workflow_utils": [[74, "module-agentscope.web.workstation.workflow_utils"]]}, "docnames": ["agentscope", "agentscope.agents", "agentscope.agents.agent", "agentscope.agents.dialog_agent", "agentscope.agents.dict_dialog_agent", "agentscope.agents.operator", "agentscope.agents.react_agent", "agentscope.agents.rpc_agent", "agentscope.agents.text_to_image_agent", "agentscope.agents.user_agent", "agentscope.constants", "agentscope.file_manager", "agentscope.memory", "agentscope.memory.memory", "agentscope.memory.temporary_memory", "agentscope.message", "agentscope.models", "agentscope.models.config", "agentscope.models.dashscope_model", "agentscope.models.gemini_model", "agentscope.models.model", "agentscope.models.ollama_model", "agentscope.models.openai_model", "agentscope.models.post_model", "agentscope.models.response", "agentscope.msghub", "agentscope.pipelines", "agentscope.pipelines.functional", "agentscope.pipelines.pipeline", "agentscope.prompt", "agentscope.rpc", "agentscope.rpc.rpc_agent_client", "agentscope.rpc.rpc_agent_pb2", "agentscope.rpc.rpc_agent_pb2_grpc", "agentscope.service", "agentscope.service.execute_code", "agentscope.service.execute_code.exec_python", "agentscope.service.execute_code.exec_shell", "agentscope.service.file", "agentscope.service.file.common", "agentscope.service.file.json", "agentscope.service.file.text", "agentscope.service.retrieval", "agentscope.service.retrieval.retrieval_from_list", "agentscope.service.retrieval.similarity", "agentscope.service.service_factory", "agentscope.service.service_response", "agentscope.service.service_status", "agentscope.service.sql_query", "agentscope.service.sql_query.mongodb", "agentscope.service.sql_query.mysql", "agentscope.service.sql_query.sqlite", "agentscope.service.text_processing", "agentscope.service.text_processing.summarization", "agentscope.service.web", "agentscope.service.web.arxiv", "agentscope.service.web.download", "agentscope.service.web.search", "agentscope.service.web.web_digest", "agentscope.utils", "agentscope.utils.common", "agentscope.utils.logging_utils", "agentscope.utils.monitor", "agentscope.utils.token_utils", "agentscope.utils.tools", "agentscope.web", "agentscope.web.studio", "agentscope.web.studio.constants", "agentscope.web.studio.studio", "agentscope.web.studio.utils", "agentscope.web.workstation", "agentscope.web.workstation.workflow", "agentscope.web.workstation.workflow_dag", "agentscope.web.workstation.workflow_node", "agentscope.web.workstation.workflow_utils", "index", "modules", "tutorial/101-agentscope", "tutorial/102-installation", "tutorial/103-example", "tutorial/104-usecase", "tutorial/105-logging", "tutorial/201-agent", "tutorial/202-pipeline", "tutorial/203-model", "tutorial/204-service", "tutorial/205-memory", "tutorial/206-prompt", "tutorial/207-monitor", "tutorial/208-distribute", "tutorial/301-community", "tutorial/302-contribute", "tutorial/advance", "tutorial/contribute", "tutorial/main", "tutorial/quick_start"], "envversion": {"sphinx": 61, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["agentscope.rst", "agentscope.agents.rst", "agentscope.agents.agent.rst", "agentscope.agents.dialog_agent.rst", "agentscope.agents.dict_dialog_agent.rst", "agentscope.agents.operator.rst", "agentscope.agents.react_agent.rst", "agentscope.agents.rpc_agent.rst", "agentscope.agents.text_to_image_agent.rst", "agentscope.agents.user_agent.rst", "agentscope.constants.rst", "agentscope.file_manager.rst", "agentscope.memory.rst", "agentscope.memory.memory.rst", "agentscope.memory.temporary_memory.rst", "agentscope.message.rst", "agentscope.models.rst", "agentscope.models.config.rst", "agentscope.models.dashscope_model.rst", "agentscope.models.gemini_model.rst", "agentscope.models.model.rst", "agentscope.models.ollama_model.rst", "agentscope.models.openai_model.rst", "agentscope.models.post_model.rst", "agentscope.models.response.rst", "agentscope.msghub.rst", "agentscope.pipelines.rst", "agentscope.pipelines.functional.rst", "agentscope.pipelines.pipeline.rst", "agentscope.prompt.rst", "agentscope.rpc.rst", "agentscope.rpc.rpc_agent_client.rst", "agentscope.rpc.rpc_agent_pb2.rst", "agentscope.rpc.rpc_agent_pb2_grpc.rst", "agentscope.service.rst", "agentscope.service.execute_code.rst", "agentscope.service.execute_code.exec_python.rst", "agentscope.service.execute_code.exec_shell.rst", "agentscope.service.file.rst", "agentscope.service.file.common.rst", "agentscope.service.file.json.rst", "agentscope.service.file.text.rst", "agentscope.service.retrieval.rst", "agentscope.service.retrieval.retrieval_from_list.rst", "agentscope.service.retrieval.similarity.rst", "agentscope.service.service_factory.rst", "agentscope.service.service_response.rst", "agentscope.service.service_status.rst", "agentscope.service.sql_query.rst", "agentscope.service.sql_query.mongodb.rst", "agentscope.service.sql_query.mysql.rst", "agentscope.service.sql_query.sqlite.rst", "agentscope.service.text_processing.rst", "agentscope.service.text_processing.summarization.rst", "agentscope.service.web.rst", "agentscope.service.web.arxiv.rst", "agentscope.service.web.download.rst", "agentscope.service.web.search.rst", "agentscope.service.web.web_digest.rst", "agentscope.utils.rst", "agentscope.utils.common.rst", "agentscope.utils.logging_utils.rst", "agentscope.utils.monitor.rst", "agentscope.utils.token_utils.rst", "agentscope.utils.tools.rst", "agentscope.web.rst", "agentscope.web.studio.rst", "agentscope.web.studio.constants.rst", "agentscope.web.studio.studio.rst", "agentscope.web.studio.utils.rst", "agentscope.web.workstation.rst", "agentscope.web.workstation.workflow.rst", "agentscope.web.workstation.workflow_dag.rst", "agentscope.web.workstation.workflow_node.rst", "agentscope.web.workstation.workflow_utils.rst", "index.rst", "modules.rst", "tutorial/101-agentscope.md", "tutorial/102-installation.md", "tutorial/103-example.md", "tutorial/104-usecase.md", "tutorial/105-logging.md", "tutorial/201-agent.md", "tutorial/202-pipeline.md", "tutorial/203-model.md", "tutorial/204-service.md", "tutorial/205-memory.md", "tutorial/206-prompt.md", "tutorial/207-monitor.md", "tutorial/208-distribute.md", "tutorial/301-community.md", "tutorial/302-contribute.md", "tutorial/advance.rst", "tutorial/contribute.rst", "tutorial/main.md", "tutorial/quick_start.rst"], "indexentries": {"__init__() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.__init__", false]], "__init__() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.__init__", false]], "__init__() (agentscope.agents.dialog_agent.dialogagent method)": [[3, "agentscope.agents.dialog_agent.DialogAgent.__init__", false]], "__init__() (agentscope.agents.dialogagent method)": [[1, "agentscope.agents.DialogAgent.__init__", false]], "__init__() (agentscope.agents.dict_dialog_agent.dictdialogagent method)": [[4, "agentscope.agents.dict_dialog_agent.DictDialogAgent.__init__", false]], "__init__() (agentscope.agents.dictdialogagent method)": [[1, "agentscope.agents.DictDialogAgent.__init__", false]], "__init__() (agentscope.agents.react_agent.reactagent method)": [[6, "agentscope.agents.react_agent.ReActAgent.__init__", false]], "__init__() (agentscope.agents.reactagent method)": [[1, "agentscope.agents.ReActAgent.__init__", false]], "__init__() (agentscope.agents.rpc_agent.rpcagent method)": [[7, "agentscope.agents.rpc_agent.RpcAgent.__init__", false]], "__init__() (agentscope.agents.rpc_agent.rpcagentserverlauncher method)": [[7, "agentscope.agents.rpc_agent.RpcAgentServerLauncher.__init__", false]], "__init__() (agentscope.agents.rpc_agent.rpcserversidewrapper method)": [[7, "agentscope.agents.rpc_agent.RpcServerSideWrapper.__init__", false]], "__init__() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.__init__", false]], "__init__() (agentscope.agents.rpcagentserverlauncher method)": [[1, "agentscope.agents.RpcAgentServerLauncher.__init__", false]], "__init__() (agentscope.agents.text_to_image_agent.texttoimageagent method)": [[8, "agentscope.agents.text_to_image_agent.TextToImageAgent.__init__", false]], "__init__() (agentscope.agents.texttoimageagent method)": [[1, "agentscope.agents.TextToImageAgent.__init__", false]], "__init__() (agentscope.agents.user_agent.useragent method)": [[9, "agentscope.agents.user_agent.UserAgent.__init__", false]], "__init__() (agentscope.agents.useragent method)": [[1, "agentscope.agents.UserAgent.__init__", false]], "__init__() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.__init__", false]], "__init__() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.__init__", false]], "__init__() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.__init__", false]], "__init__() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.__init__", false]], "__init__() (agentscope.message.messagebase method)": [[15, "agentscope.message.MessageBase.__init__", false]], "__init__() (agentscope.message.msg method)": [[15, "agentscope.message.Msg.__init__", false]], "__init__() (agentscope.message.placeholdermessage method)": [[15, "agentscope.message.PlaceholderMessage.__init__", false]], "__init__() (agentscope.message.tht method)": [[15, "agentscope.message.Tht.__init__", false]], "__init__() (agentscope.models.dashscope_model.dashscopewrapperbase method)": [[18, "agentscope.models.dashscope_model.DashScopeWrapperBase.__init__", false]], "__init__() (agentscope.models.gemini_model.geminichatwrapper method)": [[19, "agentscope.models.gemini_model.GeminiChatWrapper.__init__", false]], "__init__() (agentscope.models.gemini_model.geminiwrapperbase method)": [[19, "agentscope.models.gemini_model.GeminiWrapperBase.__init__", false]], "__init__() (agentscope.models.geminichatwrapper method)": [[16, "agentscope.models.GeminiChatWrapper.__init__", false]], "__init__() (agentscope.models.model.modelwrapperbase method)": [[20, "agentscope.models.model.ModelWrapperBase.__init__", false]], "__init__() (agentscope.models.modelresponse method)": [[16, "agentscope.models.ModelResponse.__init__", false]], "__init__() (agentscope.models.modelwrapperbase method)": [[16, "agentscope.models.ModelWrapperBase.__init__", false]], "__init__() (agentscope.models.ollama_model.ollamawrapperbase method)": [[21, "agentscope.models.ollama_model.OllamaWrapperBase.__init__", false]], "__init__() (agentscope.models.openai_model.openaiwrapperbase method)": [[22, "agentscope.models.openai_model.OpenAIWrapperBase.__init__", false]], "__init__() (agentscope.models.openaiwrapperbase method)": [[16, "agentscope.models.OpenAIWrapperBase.__init__", false]], "__init__() (agentscope.models.post_model.postapimodelwrapperbase method)": [[23, "agentscope.models.post_model.PostAPIModelWrapperBase.__init__", false]], "__init__() (agentscope.models.postapimodelwrapperbase method)": [[16, "agentscope.models.PostAPIModelWrapperBase.__init__", false]], "__init__() (agentscope.models.response.modelresponse method)": [[24, "agentscope.models.response.ModelResponse.__init__", false]], "__init__() (agentscope.models.response.responseparsingerror method)": [[24, "agentscope.models.response.ResponseParsingError.__init__", false]], "__init__() (agentscope.models.responseparsingerror method)": [[16, "agentscope.models.ResponseParsingError.__init__", false]], "__init__() (agentscope.msghub.msghubmanager method)": [[25, "agentscope.msghub.MsgHubManager.__init__", false]], "__init__() (agentscope.pipelines.forlooppipeline method)": [[26, "agentscope.pipelines.ForLoopPipeline.__init__", false]], "__init__() (agentscope.pipelines.ifelsepipeline method)": [[26, "agentscope.pipelines.IfElsePipeline.__init__", false]], "__init__() (agentscope.pipelines.pipeline.forlooppipeline method)": [[28, "agentscope.pipelines.pipeline.ForLoopPipeline.__init__", false]], "__init__() (agentscope.pipelines.pipeline.ifelsepipeline method)": [[28, "agentscope.pipelines.pipeline.IfElsePipeline.__init__", false]], "__init__() (agentscope.pipelines.pipeline.pipelinebase method)": [[28, "agentscope.pipelines.pipeline.PipelineBase.__init__", false]], "__init__() (agentscope.pipelines.pipeline.sequentialpipeline method)": [[28, "agentscope.pipelines.pipeline.SequentialPipeline.__init__", false]], "__init__() (agentscope.pipelines.pipeline.switchpipeline method)": [[28, "agentscope.pipelines.pipeline.SwitchPipeline.__init__", false]], "__init__() (agentscope.pipelines.pipeline.whilelooppipeline method)": [[28, "agentscope.pipelines.pipeline.WhileLoopPipeline.__init__", false]], "__init__() (agentscope.pipelines.pipelinebase method)": [[26, "agentscope.pipelines.PipelineBase.__init__", false]], "__init__() (agentscope.pipelines.sequentialpipeline method)": [[26, "agentscope.pipelines.SequentialPipeline.__init__", false]], "__init__() (agentscope.pipelines.switchpipeline method)": [[26, "agentscope.pipelines.SwitchPipeline.__init__", false]], "__init__() (agentscope.pipelines.whilelooppipeline method)": [[26, "agentscope.pipelines.WhileLoopPipeline.__init__", false]], "__init__() (agentscope.prompt.promptengine method)": [[29, "agentscope.prompt.PromptEngine.__init__", false]], "__init__() (agentscope.rpc.responsestub method)": [[30, "agentscope.rpc.ResponseStub.__init__", false]], "__init__() (agentscope.rpc.rpc_agent_client.responsestub method)": [[31, "agentscope.rpc.rpc_agent_client.ResponseStub.__init__", false]], "__init__() (agentscope.rpc.rpc_agent_client.rpcagentclient method)": [[31, "agentscope.rpc.rpc_agent_client.RpcAgentClient.__init__", false]], "__init__() (agentscope.rpc.rpc_agent_pb2_grpc.rpcagentstub method)": [[33, "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentStub.__init__", false]], "__init__() (agentscope.rpc.rpcagentclient method)": [[30, "agentscope.rpc.RpcAgentClient.__init__", false]], "__init__() (agentscope.rpc.rpcagentstub method)": [[30, "agentscope.rpc.RpcAgentStub.__init__", false]], "__init__() (agentscope.service.service_response.serviceresponse method)": [[46, "agentscope.service.service_response.ServiceResponse.__init__", false]], "__init__() (agentscope.service.serviceresponse method)": [[34, "agentscope.service.ServiceResponse.__init__", false]], "__init__() (agentscope.utils.monitor.quotaexceedederror method)": [[62, "agentscope.utils.monitor.QuotaExceededError.__init__", false]], "__init__() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.__init__", false]], "__init__() (agentscope.utils.quotaexceedederror method)": [[59, "agentscope.utils.QuotaExceededError.__init__", false]], "__init__() (agentscope.web.workstation.workflow_dag.asdigraph method)": [[72, "agentscope.web.workstation.workflow_dag.ASDiGraph.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.bingsearchservicenode method)": [[73, "agentscope.web.workstation.workflow_node.BingSearchServiceNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.copynode method)": [[73, "agentscope.web.workstation.workflow_node.CopyNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.dialogagentnode method)": [[73, "agentscope.web.workstation.workflow_node.DialogAgentNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.dictdialogagentnode method)": [[73, "agentscope.web.workstation.workflow_node.DictDialogAgentNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.forlooppipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.ForLoopPipelineNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.googlesearchservicenode method)": [[73, "agentscope.web.workstation.workflow_node.GoogleSearchServiceNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.ifelsepipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.IfElsePipelineNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.modelnode method)": [[73, "agentscope.web.workstation.workflow_node.ModelNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.msghubnode method)": [[73, "agentscope.web.workstation.workflow_node.MsgHubNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.msgnode method)": [[73, "agentscope.web.workstation.workflow_node.MsgNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.placeholdernode method)": [[73, "agentscope.web.workstation.workflow_node.PlaceHolderNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.pythonservicenode method)": [[73, "agentscope.web.workstation.workflow_node.PythonServiceNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.reactagentnode method)": [[73, "agentscope.web.workstation.workflow_node.ReActAgentNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.readtextservicenode method)": [[73, "agentscope.web.workstation.workflow_node.ReadTextServiceNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.sequentialpipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.SequentialPipelineNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.switchpipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.SwitchPipelineNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.texttoimageagentnode method)": [[73, "agentscope.web.workstation.workflow_node.TextToImageAgentNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.useragentnode method)": [[73, "agentscope.web.workstation.workflow_node.UserAgentNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.whilelooppipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.WhileLoopPipelineNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.workflownode method)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNode.__init__", false]], "__init__() (agentscope.web.workstation.workflow_node.writetextservicenode method)": [[73, "agentscope.web.workstation.workflow_node.WriteTextServiceNode.__init__", false]], "add() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.add", false]], "add() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.add", false]], "add() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.add", false]], "add() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.add", false]], "add() (agentscope.msghub.msghubmanager method)": [[25, "agentscope.msghub.MsgHubManager.add", false]], "add() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.add", false]], "add() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.add", false]], "add() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.add", false]], "add_as_node() (agentscope.web.workstation.workflow_dag.asdigraph method)": [[72, "agentscope.web.workstation.workflow_dag.ASDiGraph.add_as_node", false]], "add_rpcagentservicer_to_server() (in module agentscope.rpc)": [[30, "agentscope.rpc.add_RpcAgentServicer_to_server", false]], "add_rpcagentservicer_to_server() (in module agentscope.rpc.rpc_agent_pb2_grpc)": [[33, "agentscope.rpc.rpc_agent_pb2_grpc.add_RpcAgentServicer_to_server", false]], "agent (agentscope.web.workstation.workflow_node.workflownodetype attribute)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNodeType.AGENT", false]], "agent_id (agentscope.agents.agent.agentbase property)": [[2, "agentscope.agents.agent.AgentBase.agent_id", false]], "agent_id (agentscope.agents.agentbase property)": [[1, "agentscope.agents.AgentBase.agent_id", false]], "agentbase (class in agentscope.agents)": [[1, "agentscope.agents.AgentBase", false]], "agentbase (class in agentscope.agents.agent)": [[2, "agentscope.agents.agent.AgentBase", false]], "agentscope": [[0, "module-agentscope", false]], "agentscope.agents": [[1, "module-agentscope.agents", false]], "agentscope.agents.agent": [[2, "module-agentscope.agents.agent", false]], "agentscope.agents.dialog_agent": [[3, "module-agentscope.agents.dialog_agent", false]], "agentscope.agents.dict_dialog_agent": [[4, "module-agentscope.agents.dict_dialog_agent", false]], "agentscope.agents.operator": [[5, "module-agentscope.agents.operator", false]], "agentscope.agents.react_agent": [[6, "module-agentscope.agents.react_agent", false]], "agentscope.agents.rpc_agent": [[7, "module-agentscope.agents.rpc_agent", false]], "agentscope.agents.text_to_image_agent": [[8, "module-agentscope.agents.text_to_image_agent", false]], "agentscope.agents.user_agent": [[9, "module-agentscope.agents.user_agent", false]], "agentscope.constants": [[10, "module-agentscope.constants", false]], "agentscope.file_manager": [[11, "module-agentscope.file_manager", false]], "agentscope.memory": [[12, "module-agentscope.memory", false]], "agentscope.memory.memory": [[13, "module-agentscope.memory.memory", false]], "agentscope.memory.temporary_memory": [[14, "module-agentscope.memory.temporary_memory", false]], "agentscope.message": [[15, "module-agentscope.message", false]], "agentscope.models": [[16, "module-agentscope.models", false]], "agentscope.models.config": [[17, "module-agentscope.models.config", false]], "agentscope.models.dashscope_model": [[18, "module-agentscope.models.dashscope_model", false]], "agentscope.models.gemini_model": [[19, "module-agentscope.models.gemini_model", false]], "agentscope.models.model": [[20, "module-agentscope.models.model", false]], "agentscope.models.ollama_model": [[21, "module-agentscope.models.ollama_model", false]], "agentscope.models.openai_model": [[22, "module-agentscope.models.openai_model", false]], "agentscope.models.post_model": [[23, "module-agentscope.models.post_model", false]], "agentscope.models.response": [[24, "module-agentscope.models.response", false]], "agentscope.msghub": [[25, "module-agentscope.msghub", false]], "agentscope.pipelines": [[26, "module-agentscope.pipelines", false]], "agentscope.pipelines.functional": [[27, "module-agentscope.pipelines.functional", false]], "agentscope.pipelines.pipeline": [[28, "module-agentscope.pipelines.pipeline", false]], "agentscope.prompt": [[29, "module-agentscope.prompt", false]], "agentscope.rpc": [[30, "module-agentscope.rpc", false]], "agentscope.rpc.rpc_agent_client": [[31, "module-agentscope.rpc.rpc_agent_client", false]], "agentscope.rpc.rpc_agent_pb2": [[32, "module-agentscope.rpc.rpc_agent_pb2", false]], "agentscope.rpc.rpc_agent_pb2_grpc": [[33, "module-agentscope.rpc.rpc_agent_pb2_grpc", false]], "agentscope.service": [[34, "module-agentscope.service", false]], "agentscope.service.execute_code": [[35, "module-agentscope.service.execute_code", false]], "agentscope.service.execute_code.exec_python": [[36, "module-agentscope.service.execute_code.exec_python", false]], "agentscope.service.execute_code.exec_shell": [[37, "module-agentscope.service.execute_code.exec_shell", false]], "agentscope.service.file": [[38, "module-agentscope.service.file", false]], "agentscope.service.file.common": [[39, "module-agentscope.service.file.common", false]], "agentscope.service.file.json": [[40, "module-agentscope.service.file.json", false]], "agentscope.service.file.text": [[41, "module-agentscope.service.file.text", false]], "agentscope.service.retrieval": [[42, "module-agentscope.service.retrieval", false]], "agentscope.service.retrieval.retrieval_from_list": [[43, "module-agentscope.service.retrieval.retrieval_from_list", false]], "agentscope.service.retrieval.similarity": [[44, "module-agentscope.service.retrieval.similarity", false]], "agentscope.service.service_factory": [[45, "module-agentscope.service.service_factory", false]], "agentscope.service.service_response": [[46, "module-agentscope.service.service_response", false]], "agentscope.service.service_status": [[47, "module-agentscope.service.service_status", false]], "agentscope.service.sql_query": [[48, "module-agentscope.service.sql_query", false]], "agentscope.service.sql_query.mongodb": [[49, "module-agentscope.service.sql_query.mongodb", false]], "agentscope.service.sql_query.mysql": [[50, "module-agentscope.service.sql_query.mysql", false]], "agentscope.service.sql_query.sqlite": [[51, "module-agentscope.service.sql_query.sqlite", false]], "agentscope.service.text_processing": [[52, "module-agentscope.service.text_processing", false]], "agentscope.service.text_processing.summarization": [[53, "module-agentscope.service.text_processing.summarization", false]], "agentscope.service.web": [[54, "module-agentscope.service.web", false]], "agentscope.service.web.arxiv": [[55, "module-agentscope.service.web.arxiv", false]], "agentscope.service.web.download": [[56, "module-agentscope.service.web.download", false]], "agentscope.service.web.search": [[57, "module-agentscope.service.web.search", false]], "agentscope.service.web.web_digest": [[58, "module-agentscope.service.web.web_digest", false]], "agentscope.utils": [[59, "module-agentscope.utils", false]], "agentscope.utils.common": [[60, "module-agentscope.utils.common", false]], "agentscope.utils.logging_utils": [[61, "module-agentscope.utils.logging_utils", false]], "agentscope.utils.monitor": [[62, "module-agentscope.utils.monitor", false]], "agentscope.utils.token_utils": [[63, "module-agentscope.utils.token_utils", false]], "agentscope.utils.tools": [[64, "module-agentscope.utils.tools", false]], "agentscope.web": [[65, "module-agentscope.web", false]], "agentscope.web.studio": [[66, "module-agentscope.web.studio", false]], "agentscope.web.studio.constants": [[67, "module-agentscope.web.studio.constants", false]], "agentscope.web.studio.studio": [[68, "module-agentscope.web.studio.studio", false]], "agentscope.web.studio.utils": [[69, "module-agentscope.web.studio.utils", false]], "agentscope.web.workstation": [[70, "module-agentscope.web.workstation", false]], "agentscope.web.workstation.workflow": [[71, "module-agentscope.web.workstation.workflow", false]], "agentscope.web.workstation.workflow_dag": [[72, "module-agentscope.web.workstation.workflow_dag", false]], "agentscope.web.workstation.workflow_node": [[73, "module-agentscope.web.workstation.workflow_node", false]], "agentscope.web.workstation.workflow_utils": [[74, "module-agentscope.web.workstation.workflow_utils", false]], "arxiv_search() (in module agentscope.service)": [[34, "agentscope.service.arxiv_search", false]], "arxiv_search() (in module agentscope.service.web.arxiv)": [[55, "agentscope.service.web.arxiv.arxiv_search", false]], "asdigraph (class in agentscope.web.workstation.workflow_dag)": [[72, "agentscope.web.workstation.workflow_dag.ASDiGraph", false]], "audio2text() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.audio2text", false]], "bing_search() (in module agentscope.service)": [[34, "agentscope.service.bing_search", false]], "bing_search() (in module agentscope.service.web.search)": [[57, "agentscope.service.web.search.bing_search", false]], "bingsearchservicenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.BingSearchServiceNode", false]], "broadcast() (agentscope.msghub.msghubmanager method)": [[25, "agentscope.msghub.MsgHubManager.broadcast", false]], "build_dag() (in module agentscope.web.workstation.workflow_dag)": [[72, "agentscope.web.workstation.workflow_dag.build_dag", false]], "call_func() (agentscope.agents.rpc_agent.rpcserversidewrapper method)": [[7, "agentscope.agents.rpc_agent.RpcServerSideWrapper.call_func", false]], "call_func() (agentscope.rpc.rpc_agent_client.rpcagentclient method)": [[31, "agentscope.rpc.rpc_agent_client.RpcAgentClient.call_func", false]], "call_func() (agentscope.rpc.rpc_agent_pb2_grpc.rpcagent static method)": [[33, "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgent.call_func", false]], "call_func() (agentscope.rpc.rpc_agent_pb2_grpc.rpcagentservicer method)": [[33, "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentServicer.call_func", false]], "call_func() (agentscope.rpc.rpcagentclient method)": [[30, "agentscope.rpc.RpcAgentClient.call_func", false]], "call_func() (agentscope.rpc.rpcagentservicer method)": [[30, "agentscope.rpc.RpcAgentServicer.call_func", false]], "call_in_thread() (in module agentscope.rpc)": [[30, "agentscope.rpc.call_in_thread", false]], "call_in_thread() (in module agentscope.rpc.rpc_agent_client)": [[31, "agentscope.rpc.rpc_agent_client.call_in_thread", false]], "chdir() (in module agentscope.utils.common)": [[60, "agentscope.utils.common.chdir", false]], "check_and_delete_agent() (agentscope.agents.rpc_agent.rpcserversidewrapper method)": [[7, "agentscope.agents.rpc_agent.RpcServerSideWrapper.check_and_delete_agent", false]], "check_and_generate_agent() (agentscope.agents.rpc_agent.rpcserversidewrapper method)": [[7, "agentscope.agents.rpc_agent.RpcServerSideWrapper.check_and_generate_agent", false]], "check_port() (in module agentscope.agents.rpc_agent)": [[7, "agentscope.agents.rpc_agent.check_port", false]], "check_uuid() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.check_uuid", false]], "clear() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.clear", false]], "clear() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.clear", false]], "clear() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.clear", false]], "clear() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.clear", false]], "clear() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.clear", false]], "clear() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.clear", false]], "clear() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.clear", false]], "clear_audience() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.clear_audience", false]], "clear_audience() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.clear_audience", false]], "clear_model_configs() (in module agentscope.models)": [[16, "agentscope.models.clear_model_configs", false]], "clone_instances() (agentscope.agents.rpc_agent.rpcagent method)": [[7, "agentscope.agents.rpc_agent.RpcAgent.clone_instances", false]], "clone_instances() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.clone_instances", false]], "compile() (agentscope.web.workstation.workflow_dag.asdigraph method)": [[72, "agentscope.web.workstation.workflow_dag.ASDiGraph.compile", false]], "compile() (agentscope.web.workstation.workflow_node.bingsearchservicenode method)": [[73, "agentscope.web.workstation.workflow_node.BingSearchServiceNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.copynode method)": [[73, "agentscope.web.workstation.workflow_node.CopyNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.dialogagentnode method)": [[73, "agentscope.web.workstation.workflow_node.DialogAgentNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.dictdialogagentnode method)": [[73, "agentscope.web.workstation.workflow_node.DictDialogAgentNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.forlooppipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.ForLoopPipelineNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.googlesearchservicenode method)": [[73, "agentscope.web.workstation.workflow_node.GoogleSearchServiceNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.ifelsepipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.IfElsePipelineNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.modelnode method)": [[73, "agentscope.web.workstation.workflow_node.ModelNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.msghubnode method)": [[73, "agentscope.web.workstation.workflow_node.MsgHubNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.msgnode method)": [[73, "agentscope.web.workstation.workflow_node.MsgNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.placeholdernode method)": [[73, "agentscope.web.workstation.workflow_node.PlaceHolderNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.pythonservicenode method)": [[73, "agentscope.web.workstation.workflow_node.PythonServiceNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.reactagentnode method)": [[73, "agentscope.web.workstation.workflow_node.ReActAgentNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.readtextservicenode method)": [[73, "agentscope.web.workstation.workflow_node.ReadTextServiceNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.sequentialpipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.SequentialPipelineNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.switchpipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.SwitchPipelineNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.texttoimageagentnode method)": [[73, "agentscope.web.workstation.workflow_node.TextToImageAgentNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.useragentnode method)": [[73, "agentscope.web.workstation.workflow_node.UserAgentNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.whilelooppipelinenode method)": [[73, "agentscope.web.workstation.workflow_node.WhileLoopPipelineNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.workflownode method)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNode.compile", false]], "compile() (agentscope.web.workstation.workflow_node.writetextservicenode method)": [[73, "agentscope.web.workstation.workflow_node.WriteTextServiceNode.compile", false]], "compile_workflow() (in module agentscope.web.workstation.workflow)": [[71, "agentscope.web.workstation.workflow.compile_workflow", false]], "config_name (agentscope.models.dashscope_model.dashscopechatwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeChatWrapper.config_name", false]], "config_name (agentscope.models.dashscope_model.dashscopeimagesynthesiswrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeImageSynthesisWrapper.config_name", false]], "config_name (agentscope.models.dashscope_model.dashscopemultimodalwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeMultiModalWrapper.config_name", false]], "config_name (agentscope.models.dashscope_model.dashscopetextembeddingwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeTextEmbeddingWrapper.config_name", false]], "config_name (agentscope.models.gemini_model.geminichatwrapper attribute)": [[19, "agentscope.models.gemini_model.GeminiChatWrapper.config_name", false]], "config_name (agentscope.models.gemini_model.geminiembeddingwrapper attribute)": [[19, "agentscope.models.gemini_model.GeminiEmbeddingWrapper.config_name", false]], "config_name (agentscope.models.model.modelwrapperbase attribute)": [[20, "agentscope.models.model.ModelWrapperBase.config_name", false]], "config_name (agentscope.models.modelwrapperbase attribute)": [[16, "agentscope.models.ModelWrapperBase.config_name", false]], "config_name (agentscope.models.ollama_model.ollamachatwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaChatWrapper.config_name", false]], "config_name (agentscope.models.ollama_model.ollamaembeddingwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaEmbeddingWrapper.config_name", false]], "config_name (agentscope.models.ollama_model.ollamagenerationwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaGenerationWrapper.config_name", false]], "config_name (agentscope.models.openai_model.openaichatwrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIChatWrapper.config_name", false]], "config_name (agentscope.models.openai_model.openaidallewrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIDALLEWrapper.config_name", false]], "config_name (agentscope.models.openai_model.openaiembeddingwrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIEmbeddingWrapper.config_name", false]], "config_name (agentscope.models.post_model.postapichatwrapper attribute)": [[23, "agentscope.models.post_model.PostAPIChatWrapper.config_name", false]], "config_name (agentscope.models.post_model.postapimodelwrapperbase attribute)": [[23, "agentscope.models.post_model.PostAPIModelWrapperBase.config_name", false]], "copy (agentscope.web.workstation.workflow_node.workflownodetype attribute)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNodeType.COPY", false]], "copynode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.CopyNode", false]], "cos_sim() (in module agentscope.service)": [[34, "agentscope.service.cos_sim", false]], "cos_sim() (in module agentscope.service.retrieval.similarity)": [[44, "agentscope.service.retrieval.similarity.cos_sim", false]], "count_openai_token() (in module agentscope.utils.token_utils)": [[63, "agentscope.utils.token_utils.count_openai_token", false]], "create_agent() (agentscope.rpc.rpc_agent_client.rpcagentclient method)": [[31, "agentscope.rpc.rpc_agent_client.RpcAgentClient.create_agent", false]], "create_agent() (agentscope.rpc.rpcagentclient method)": [[30, "agentscope.rpc.RpcAgentClient.create_agent", false]], "create_directory() (in module agentscope.service)": [[34, "agentscope.service.create_directory", false]], "create_directory() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.create_directory", false]], "create_file() (in module agentscope.service)": [[34, "agentscope.service.create_file", false]], "create_file() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.create_file", false]], "create_tempdir() (in module agentscope.utils.common)": [[60, "agentscope.utils.common.create_tempdir", false]], "cycle_dots() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.cycle_dots", false]], "dashscopechatwrapper (class in agentscope.models)": [[16, "agentscope.models.DashScopeChatWrapper", false]], "dashscopechatwrapper (class in agentscope.models.dashscope_model)": [[18, "agentscope.models.dashscope_model.DashScopeChatWrapper", false]], "dashscopeimagesynthesiswrapper (class in agentscope.models)": [[16, "agentscope.models.DashScopeImageSynthesisWrapper", false]], "dashscopeimagesynthesiswrapper (class in agentscope.models.dashscope_model)": [[18, "agentscope.models.dashscope_model.DashScopeImageSynthesisWrapper", false]], "dashscopemultimodalwrapper (class in agentscope.models)": [[16, "agentscope.models.DashScopeMultiModalWrapper", false]], "dashscopemultimodalwrapper (class in agentscope.models.dashscope_model)": [[18, "agentscope.models.dashscope_model.DashScopeMultiModalWrapper", false]], "dashscopetextembeddingwrapper (class in agentscope.models)": [[16, "agentscope.models.DashScopeTextEmbeddingWrapper", false]], "dashscopetextembeddingwrapper (class in agentscope.models.dashscope_model)": [[18, "agentscope.models.dashscope_model.DashScopeTextEmbeddingWrapper", false]], "dashscopewrapperbase (class in agentscope.models.dashscope_model)": [[18, "agentscope.models.dashscope_model.DashScopeWrapperBase", false]], "default_response() (in module agentscope.agents.dict_dialog_agent)": [[4, "agentscope.agents.dict_dialog_agent.default_response", false]], "delete() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.delete", false]], "delete() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.delete", false]], "delete() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.delete", false]], "delete() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.delete", false]], "delete() (agentscope.msghub.msghubmanager method)": [[25, "agentscope.msghub.MsgHubManager.delete", false]], "delete_agent() (agentscope.rpc.rpc_agent_client.rpcagentclient method)": [[31, "agentscope.rpc.rpc_agent_client.RpcAgentClient.delete_agent", false]], "delete_agent() (agentscope.rpc.rpcagentclient method)": [[30, "agentscope.rpc.RpcAgentClient.delete_agent", false]], "delete_directory() (in module agentscope.service)": [[34, "agentscope.service.delete_directory", false]], "delete_directory() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.delete_directory", false]], "delete_file() (in module agentscope.service)": [[34, "agentscope.service.delete_file", false]], "delete_file() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.delete_file", false]], "deprecated_model_type (agentscope.models.dashscope_model.dashscopechatwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeChatWrapper.deprecated_model_type", false]], "deprecated_model_type (agentscope.models.dashscopechatwrapper attribute)": [[16, "agentscope.models.DashScopeChatWrapper.deprecated_model_type", false]], "deprecated_model_type (agentscope.models.openai_model.openaichatwrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIChatWrapper.deprecated_model_type", false]], "deprecated_model_type (agentscope.models.openaichatwrapper attribute)": [[16, "agentscope.models.OpenAIChatWrapper.deprecated_model_type", false]], "deprecated_model_type (agentscope.models.post_model.postapidallewrapper attribute)": [[23, "agentscope.models.post_model.PostAPIDALLEWrapper.deprecated_model_type", false]], "deps_converter() (in module agentscope.web.workstation.workflow_utils)": [[74, "agentscope.web.workstation.workflow_utils.deps_converter", false]], "descriptor (agentscope.rpc.rpcmsg attribute)": [[30, "agentscope.rpc.RpcMsg.DESCRIPTOR", false]], "deserialize() (in module agentscope.message)": [[15, "agentscope.message.deserialize", false]], "dialogagent (class in agentscope.agents)": [[1, "agentscope.agents.DialogAgent", false]], "dialogagent (class in agentscope.agents.dialog_agent)": [[3, "agentscope.agents.dialog_agent.DialogAgent", false]], "dialogagentnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.DialogAgentNode", false]], "dict_converter() (in module agentscope.web.workstation.workflow_utils)": [[74, "agentscope.web.workstation.workflow_utils.dict_converter", false]], "dictdialogagent (class in agentscope.agents)": [[1, "agentscope.agents.DictDialogAgent", false]], "dictdialogagent (class in agentscope.agents.dict_dialog_agent)": [[4, "agentscope.agents.dict_dialog_agent.DictDialogAgent", false]], "dictdialogagentnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.DictDialogAgentNode", false]], "digest_webpage() (in module agentscope.service)": [[34, "agentscope.service.digest_webpage", false]], "digest_webpage() (in module agentscope.service.web.web_digest)": [[58, "agentscope.service.web.web_digest.digest_webpage", false]], "download_from_url() (in module agentscope.service)": [[34, "agentscope.service.download_from_url", false]], "download_from_url() (in module agentscope.service.web.download)": [[56, "agentscope.service.web.download.download_from_url", false]], "embedding (agentscope.models.modelresponse attribute)": [[16, "agentscope.models.ModelResponse.embedding", false]], "embedding (agentscope.models.response.modelresponse attribute)": [[24, "agentscope.models.response.ModelResponse.embedding", false]], "error (agentscope.service.service_status.serviceexecstatus attribute)": [[47, "agentscope.service.service_status.ServiceExecStatus.ERROR", false]], "error (agentscope.service.serviceexecstatus attribute)": [[34, "agentscope.service.ServiceExecStatus.ERROR", false]], "error_info (agentscope.models.response.responseparsingerror attribute)": [[24, "agentscope.models.response.ResponseParsingError.error_info", false]], "error_info (agentscope.models.responseparsingerror attribute)": [[16, "agentscope.models.ResponseParsingError.error_info", false]], "exec_node() (agentscope.web.workstation.workflow_dag.asdigraph method)": [[72, "agentscope.web.workstation.workflow_dag.ASDiGraph.exec_node", false]], "execute_func() (agentscope.agents.react_agent.reactagent method)": [[6, "agentscope.agents.react_agent.ReActAgent.execute_func", false]], "execute_func() (agentscope.agents.reactagent method)": [[1, "agentscope.agents.ReActAgent.execute_func", false]], "execute_python_code() (in module agentscope.service)": [[34, "agentscope.service.execute_python_code", false]], "execute_python_code() (in module agentscope.service.execute_code.exec_python)": [[36, "agentscope.service.execute_code.exec_python.execute_python_code", false]], "execute_shell_command() (in module agentscope.service)": [[34, "agentscope.service.execute_shell_command", false]], "execute_shell_command() (in module agentscope.service.execute_code.exec_shell)": [[37, "agentscope.service.execute_code.exec_shell.execute_shell_command", false]], "exists() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.exists", false]], "exists() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.exists", false]], "exists() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.exists", false]], "export() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.export", false]], "export() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.export", false]], "export() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.export", false]], "export() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.export", false]], "export_config() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.export_config", false]], "export_config() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.export_config", false]], "find_available_port() (in module agentscope.agents.rpc_agent)": [[7, "agentscope.agents.rpc_agent.find_available_port", false]], "flush() (agentscope.utils.monitor.monitorfactory class method)": [[62, "agentscope.utils.monitor.MonitorFactory.flush", false]], "flush() (agentscope.utils.monitorfactory class method)": [[59, "agentscope.utils.MonitorFactory.flush", false]], "fn_choice() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.fn_choice", false]], "forlooppipeline (class in agentscope.pipelines)": [[26, "agentscope.pipelines.ForLoopPipeline", false]], "forlooppipeline (class in agentscope.pipelines.pipeline)": [[28, "agentscope.pipelines.pipeline.ForLoopPipeline", false]], "forlooppipeline() (in module agentscope.pipelines)": [[26, "agentscope.pipelines.forlooppipeline", false]], "forlooppipeline() (in module agentscope.pipelines.functional)": [[27, "agentscope.pipelines.functional.forlooppipeline", false]], "forlooppipelinenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.ForLoopPipelineNode", false]], "format() (agentscope.models.dashscope_model.dashscopechatwrapper method)": [[18, "agentscope.models.dashscope_model.DashScopeChatWrapper.format", false]], "format() (agentscope.models.dashscope_model.dashscopemultimodalwrapper method)": [[18, "agentscope.models.dashscope_model.DashScopeMultiModalWrapper.format", false]], "format() (agentscope.models.dashscope_model.dashscopewrapperbase method)": [[18, "agentscope.models.dashscope_model.DashScopeWrapperBase.format", false]], "format() (agentscope.models.dashscopechatwrapper method)": [[16, "agentscope.models.DashScopeChatWrapper.format", false]], "format() (agentscope.models.dashscopemultimodalwrapper method)": [[16, "agentscope.models.DashScopeMultiModalWrapper.format", false]], "format() (agentscope.models.gemini_model.geminichatwrapper method)": [[19, "agentscope.models.gemini_model.GeminiChatWrapper.format", false]], "format() (agentscope.models.geminichatwrapper method)": [[16, "agentscope.models.GeminiChatWrapper.format", false]], "format() (agentscope.models.model.modelwrapperbase method)": [[20, "agentscope.models.model.ModelWrapperBase.format", false]], "format() (agentscope.models.modelwrapperbase method)": [[16, "agentscope.models.ModelWrapperBase.format", false]], "format() (agentscope.models.ollama_model.ollamachatwrapper method)": [[21, "agentscope.models.ollama_model.OllamaChatWrapper.format", false]], "format() (agentscope.models.ollama_model.ollamaembeddingwrapper method)": [[21, "agentscope.models.ollama_model.OllamaEmbeddingWrapper.format", false]], "format() (agentscope.models.ollama_model.ollamagenerationwrapper method)": [[21, "agentscope.models.ollama_model.OllamaGenerationWrapper.format", false]], "format() (agentscope.models.ollamachatwrapper method)": [[16, "agentscope.models.OllamaChatWrapper.format", false]], "format() (agentscope.models.ollamaembeddingwrapper method)": [[16, "agentscope.models.OllamaEmbeddingWrapper.format", false]], "format() (agentscope.models.ollamagenerationwrapper method)": [[16, "agentscope.models.OllamaGenerationWrapper.format", false]], "format() (agentscope.models.openai_model.openaichatwrapper method)": [[22, "agentscope.models.openai_model.OpenAIChatWrapper.format", false]], "format() (agentscope.models.openai_model.openaiwrapperbase method)": [[22, "agentscope.models.openai_model.OpenAIWrapperBase.format", false]], "format() (agentscope.models.openaichatwrapper method)": [[16, "agentscope.models.OpenAIChatWrapper.format", false]], "format() (agentscope.models.openaiwrapperbase method)": [[16, "agentscope.models.OpenAIWrapperBase.format", false]], "format() (agentscope.models.post_model.postapichatwrapper method)": [[23, "agentscope.models.post_model.PostAPIChatWrapper.format", false]], "format() (agentscope.models.post_model.postapidallewrapper method)": [[23, "agentscope.models.post_model.PostAPIDALLEWrapper.format", false]], "format() (agentscope.models.postapichatwrapper method)": [[16, "agentscope.models.PostAPIChatWrapper.format", false]], "geminichatwrapper (class in agentscope.models)": [[16, "agentscope.models.GeminiChatWrapper", false]], "geminichatwrapper (class in agentscope.models.gemini_model)": [[19, "agentscope.models.gemini_model.GeminiChatWrapper", false]], "geminiembeddingwrapper (class in agentscope.models)": [[16, "agentscope.models.GeminiEmbeddingWrapper", false]], "geminiembeddingwrapper (class in agentscope.models.gemini_model)": [[19, "agentscope.models.gemini_model.GeminiEmbeddingWrapper", false]], "geminiwrapperbase (class in agentscope.models.gemini_model)": [[19, "agentscope.models.gemini_model.GeminiWrapperBase", false]], "generate_agent_id() (agentscope.agents.agent.agentbase class method)": [[2, "agentscope.agents.agent.AgentBase.generate_agent_id", false]], "generate_agent_id() (agentscope.agents.agentbase class method)": [[1, "agentscope.agents.AgentBase.generate_agent_id", false]], "generate_image_from_name() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.generate_image_from_name", false]], "generation_method (agentscope.models.gemini_model.geminichatwrapper attribute)": [[19, "agentscope.models.gemini_model.GeminiChatWrapper.generation_method", false]], "generation_method (agentscope.models.geminichatwrapper attribute)": [[16, "agentscope.models.GeminiChatWrapper.generation_method", false]], "get() (agentscope.service.service_factory.servicefactory class method)": [[45, "agentscope.service.service_factory.ServiceFactory.get", false]], "get() (agentscope.service.servicefactory class method)": [[34, "agentscope.service.ServiceFactory.get", false]], "get_all_agents() (in module agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.get_all_agents", false]], "get_chat() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.get_chat", false]], "get_chat_msg() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.get_chat_msg", false]], "get_current_directory() (in module agentscope.service)": [[34, "agentscope.service.get_current_directory", false]], "get_current_directory() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.get_current_directory", false]], "get_embeddings() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.get_embeddings", false]], "get_embeddings() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.get_embeddings", false]], "get_full_name() (in module agentscope.utils.monitor)": [[62, "agentscope.utils.monitor.get_full_name", false]], "get_help() (in module agentscope.service)": [[34, "agentscope.service.get_help", false]], "get_memory() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.get_memory", false]], "get_memory() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.get_memory", false]], "get_memory() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.get_memory", false]], "get_memory() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.get_memory", false]], "get_metric() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.get_metric", false]], "get_metric() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.get_metric", false]], "get_metric() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.get_metric", false]], "get_metrics() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.get_metrics", false]], "get_metrics() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.get_metrics", false]], "get_metrics() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.get_metrics", false]], "get_monitor() (agentscope.utils.monitor.monitorfactory class method)": [[62, "agentscope.utils.monitor.MonitorFactory.get_monitor", false]], "get_monitor() (agentscope.utils.monitorfactory class method)": [[59, "agentscope.utils.MonitorFactory.get_monitor", false]], "get_openai_max_length() (in module agentscope.utils.token_utils)": [[63, "agentscope.utils.token_utils.get_openai_max_length", false]], "get_player_input() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.get_player_input", false]], "get_quota() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.get_quota", false]], "get_quota() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.get_quota", false]], "get_quota() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.get_quota", false]], "get_reset_msg() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.get_reset_msg", false]], "get_response() (agentscope.rpc.responsestub method)": [[30, "agentscope.rpc.ResponseStub.get_response", false]], "get_response() (agentscope.rpc.rpc_agent_client.responsestub method)": [[31, "agentscope.rpc.rpc_agent_client.ResponseStub.get_response", false]], "get_task_id() (agentscope.agents.rpc_agent.rpcserversidewrapper method)": [[7, "agentscope.agents.rpc_agent.RpcServerSideWrapper.get_task_id", false]], "get_unit() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.get_unit", false]], "get_unit() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.get_unit", false]], "get_unit() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.get_unit", false]], "get_value() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.get_value", false]], "get_value() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.get_value", false]], "get_value() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.get_value", false]], "get_wrapper() (agentscope.models.model.modelwrapperbase class method)": [[20, "agentscope.models.model.ModelWrapperBase.get_wrapper", false]], "get_wrapper() (agentscope.models.modelwrapperbase class method)": [[16, "agentscope.models.ModelWrapperBase.get_wrapper", false]], "google_search() (in module agentscope.service)": [[34, "agentscope.service.google_search", false]], "google_search() (in module agentscope.service.web.search)": [[57, "agentscope.service.web.search.google_search", false]], "googlesearchservicenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.GoogleSearchServiceNode", false]], "if_change_database() (in module agentscope.utils.common)": [[60, "agentscope.utils.common.if_change_database", false]], "ifelsepipeline (class in agentscope.pipelines)": [[26, "agentscope.pipelines.IfElsePipeline", false]], "ifelsepipeline (class in agentscope.pipelines.pipeline)": [[28, "agentscope.pipelines.pipeline.IfElsePipeline", false]], "ifelsepipeline() (in module agentscope.pipelines)": [[26, "agentscope.pipelines.ifelsepipeline", false]], "ifelsepipeline() (in module agentscope.pipelines.functional)": [[27, "agentscope.pipelines.functional.ifelsepipeline", false]], "ifelsepipelinenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.IfElsePipelineNode", false]], "image_urls (agentscope.models.modelresponse attribute)": [[16, "agentscope.models.ModelResponse.image_urls", false]], "image_urls (agentscope.models.response.modelresponse attribute)": [[24, "agentscope.models.response.ModelResponse.image_urls", false]], "import_function_from_path() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.import_function_from_path", false]], "init() (in module agentscope)": [[0, "agentscope.init", false]], "init() (in module agentscope.web)": [[65, "agentscope.web.init", false]], "init_uid_list() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.init_uid_list", false]], "init_uid_queues() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.init_uid_queues", false]], "is_callable_expression() (in module agentscope.web.workstation.workflow_utils)": [[74, "agentscope.web.workstation.workflow_utils.is_callable_expression", false]], "is_valid_url() (in module agentscope.service.web.web_digest)": [[58, "agentscope.service.web.web_digest.is_valid_url", false]], "join() (agentscope.prompt.promptengine method)": [[29, "agentscope.prompt.PromptEngine.join", false]], "join_to_list() (agentscope.prompt.promptengine method)": [[29, "agentscope.prompt.PromptEngine.join_to_list", false]], "join_to_str() (agentscope.prompt.promptengine method)": [[29, "agentscope.prompt.PromptEngine.join_to_str", false]], "json (agentscope.constants.responseformat attribute)": [[10, "agentscope.constants.ResponseFormat.JSON", false]], "json (agentscope.models.modelresponse attribute)": [[16, "agentscope.models.ModelResponse.json", false]], "json (agentscope.models.response.modelresponse attribute)": [[24, "agentscope.models.response.ModelResponse.json", false]], "keep_alive (agentscope.models.ollama_model.ollamachatwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaChatWrapper.keep_alive", false]], "keep_alive (agentscope.models.ollama_model.ollamaembeddingwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaEmbeddingWrapper.keep_alive", false]], "keep_alive (agentscope.models.ollama_model.ollamagenerationwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaGenerationWrapper.keep_alive", false]], "keep_alive (agentscope.models.ollama_model.ollamawrapperbase attribute)": [[21, "agentscope.models.ollama_model.OllamaWrapperBase.keep_alive", false]], "kwarg_converter() (in module agentscope.web.workstation.workflow_utils)": [[74, "agentscope.web.workstation.workflow_utils.kwarg_converter", false]], "launch() (agentscope.agents.rpc_agent.rpcagentserverlauncher method)": [[7, "agentscope.agents.rpc_agent.RpcAgentServerLauncher.launch", false]], "launch() (agentscope.agents.rpcagentserverlauncher method)": [[1, "agentscope.agents.RpcAgentServerLauncher.launch", false]], "list (agentscope.prompt.prompttype attribute)": [[29, "agentscope.prompt.PromptType.LIST", false]], "list_directory_content() (in module agentscope.service)": [[34, "agentscope.service.list_directory_content", false]], "list_directory_content() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.list_directory_content", false]], "list_models() (agentscope.models.gemini_model.geminiwrapperbase method)": [[19, "agentscope.models.gemini_model.GeminiWrapperBase.list_models", false]], "load() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.load", false]], "load() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.load", false]], "load() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.load", false]], "load() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.load", false]], "load_config() (in module agentscope.web.workstation.workflow)": [[71, "agentscope.web.workstation.workflow.load_config", false]], "load_from_config() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.load_from_config", false]], "load_from_config() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.load_from_config", false]], "load_memory() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.load_memory", false]], "load_memory() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.load_memory", false]], "load_model_by_config_name() (in module agentscope.models)": [[16, "agentscope.models.load_model_by_config_name", false]], "load_web() (in module agentscope.service)": [[34, "agentscope.service.load_web", false]], "load_web() (in module agentscope.service.web.web_digest)": [[58, "agentscope.service.web.web_digest.load_web", false]], "local_attrs (agentscope.message.placeholdermessage attribute)": [[15, "agentscope.message.PlaceholderMessage.LOCAL_ATTRS", false]], "log_studio() (in module agentscope.utils.logging_utils)": [[61, "agentscope.utils.logging_utils.log_studio", false]], "main() (in module agentscope.web.workstation.workflow)": [[71, "agentscope.web.workstation.workflow.main", false]], "memorybase (class in agentscope.memory)": [[12, "agentscope.memory.MemoryBase", false]], "memorybase (class in agentscope.memory.memory)": [[13, "agentscope.memory.memory.MemoryBase", false]], "message (agentscope.web.workstation.workflow_node.workflownodetype attribute)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNodeType.MESSAGE", false]], "messagebase (class in agentscope.message)": [[15, "agentscope.message.MessageBase", false]], "model (agentscope.web.workstation.workflow_node.workflownodetype attribute)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNodeType.MODEL", false]], "model_name (agentscope.models.dashscope_model.dashscopechatwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeChatWrapper.model_name", false]], "model_name (agentscope.models.dashscope_model.dashscopeimagesynthesiswrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeImageSynthesisWrapper.model_name", false]], "model_name (agentscope.models.dashscope_model.dashscopemultimodalwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeMultiModalWrapper.model_name", false]], "model_name (agentscope.models.dashscope_model.dashscopetextembeddingwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeTextEmbeddingWrapper.model_name", false]], "model_name (agentscope.models.gemini_model.geminichatwrapper attribute)": [[19, "agentscope.models.gemini_model.GeminiChatWrapper.model_name", false]], "model_name (agentscope.models.gemini_model.geminiembeddingwrapper attribute)": [[19, "agentscope.models.gemini_model.GeminiEmbeddingWrapper.model_name", false]], "model_name (agentscope.models.model.modelwrapperbase attribute)": [[20, "agentscope.models.model.ModelWrapperBase.model_name", false]], "model_name (agentscope.models.modelwrapperbase attribute)": [[16, "agentscope.models.ModelWrapperBase.model_name", false]], "model_name (agentscope.models.ollama_model.ollamachatwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaChatWrapper.model_name", false]], "model_name (agentscope.models.ollama_model.ollamaembeddingwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaEmbeddingWrapper.model_name", false]], "model_name (agentscope.models.ollama_model.ollamagenerationwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaGenerationWrapper.model_name", false]], "model_name (agentscope.models.ollama_model.ollamawrapperbase attribute)": [[21, "agentscope.models.ollama_model.OllamaWrapperBase.model_name", false]], "model_name (agentscope.models.openai_model.openaichatwrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIChatWrapper.model_name", false]], "model_name (agentscope.models.openai_model.openaidallewrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIDALLEWrapper.model_name", false]], "model_name (agentscope.models.openai_model.openaiembeddingwrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIEmbeddingWrapper.model_name", false]], "model_name (agentscope.models.post_model.postapichatwrapper attribute)": [[23, "agentscope.models.post_model.PostAPIChatWrapper.model_name", false]], "model_name (agentscope.models.post_model.postapimodelwrapperbase attribute)": [[23, "agentscope.models.post_model.PostAPIModelWrapperBase.model_name", false]], "model_type (agentscope.models.dashscope_model.dashscopechatwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeChatWrapper.model_type", false]], "model_type (agentscope.models.dashscope_model.dashscopeimagesynthesiswrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeImageSynthesisWrapper.model_type", false]], "model_type (agentscope.models.dashscope_model.dashscopemultimodalwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeMultiModalWrapper.model_type", false]], "model_type (agentscope.models.dashscope_model.dashscopetextembeddingwrapper attribute)": [[18, "agentscope.models.dashscope_model.DashScopeTextEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.dashscopechatwrapper attribute)": [[16, "agentscope.models.DashScopeChatWrapper.model_type", false]], "model_type (agentscope.models.dashscopeimagesynthesiswrapper attribute)": [[16, "agentscope.models.DashScopeImageSynthesisWrapper.model_type", false]], "model_type (agentscope.models.dashscopemultimodalwrapper attribute)": [[16, "agentscope.models.DashScopeMultiModalWrapper.model_type", false]], "model_type (agentscope.models.dashscopetextembeddingwrapper attribute)": [[16, "agentscope.models.DashScopeTextEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.gemini_model.geminichatwrapper attribute)": [[19, "agentscope.models.gemini_model.GeminiChatWrapper.model_type", false]], "model_type (agentscope.models.gemini_model.geminiembeddingwrapper attribute)": [[19, "agentscope.models.gemini_model.GeminiEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.geminichatwrapper attribute)": [[16, "agentscope.models.GeminiChatWrapper.model_type", false]], "model_type (agentscope.models.geminiembeddingwrapper attribute)": [[16, "agentscope.models.GeminiEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.model.modelwrapperbase attribute)": [[20, "agentscope.models.model.ModelWrapperBase.model_type", false]], "model_type (agentscope.models.modelwrapperbase attribute)": [[16, "agentscope.models.ModelWrapperBase.model_type", false]], "model_type (agentscope.models.ollama_model.ollamachatwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaChatWrapper.model_type", false]], "model_type (agentscope.models.ollama_model.ollamaembeddingwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.ollama_model.ollamagenerationwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaGenerationWrapper.model_type", false]], "model_type (agentscope.models.ollama_model.ollamawrapperbase attribute)": [[21, "agentscope.models.ollama_model.OllamaWrapperBase.model_type", false]], "model_type (agentscope.models.ollamachatwrapper attribute)": [[16, "agentscope.models.OllamaChatWrapper.model_type", false]], "model_type (agentscope.models.ollamaembeddingwrapper attribute)": [[16, "agentscope.models.OllamaEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.ollamagenerationwrapper attribute)": [[16, "agentscope.models.OllamaGenerationWrapper.model_type", false]], "model_type (agentscope.models.openai_model.openaichatwrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIChatWrapper.model_type", false]], "model_type (agentscope.models.openai_model.openaidallewrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIDALLEWrapper.model_type", false]], "model_type (agentscope.models.openai_model.openaiembeddingwrapper attribute)": [[22, "agentscope.models.openai_model.OpenAIEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.openaichatwrapper attribute)": [[16, "agentscope.models.OpenAIChatWrapper.model_type", false]], "model_type (agentscope.models.openaidallewrapper attribute)": [[16, "agentscope.models.OpenAIDALLEWrapper.model_type", false]], "model_type (agentscope.models.openaiembeddingwrapper attribute)": [[16, "agentscope.models.OpenAIEmbeddingWrapper.model_type", false]], "model_type (agentscope.models.post_model.postapichatwrapper attribute)": [[23, "agentscope.models.post_model.PostAPIChatWrapper.model_type", false]], "model_type (agentscope.models.post_model.postapidallewrapper attribute)": [[23, "agentscope.models.post_model.PostAPIDALLEWrapper.model_type", false]], "model_type (agentscope.models.post_model.postapimodelwrapperbase attribute)": [[23, "agentscope.models.post_model.PostAPIModelWrapperBase.model_type", false]], "model_type (agentscope.models.postapichatwrapper attribute)": [[16, "agentscope.models.PostAPIChatWrapper.model_type", false]], "model_type (agentscope.models.postapimodelwrapperbase attribute)": [[16, "agentscope.models.PostAPIModelWrapperBase.model_type", false]], "modelnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.ModelNode", false]], "modelresponse (class in agentscope.models)": [[16, "agentscope.models.ModelResponse", false]], "modelresponse (class in agentscope.models.response)": [[24, "agentscope.models.response.ModelResponse", false]], "modelwrapperbase (class in agentscope.models)": [[16, "agentscope.models.ModelWrapperBase", false]], "modelwrapperbase (class in agentscope.models.model)": [[20, "agentscope.models.model.ModelWrapperBase", false]], "module": [[0, "module-agentscope", false], [1, "module-agentscope.agents", false], [2, "module-agentscope.agents.agent", false], [3, "module-agentscope.agents.dialog_agent", false], [4, "module-agentscope.agents.dict_dialog_agent", false], [5, "module-agentscope.agents.operator", false], [6, "module-agentscope.agents.react_agent", false], [7, "module-agentscope.agents.rpc_agent", false], [8, "module-agentscope.agents.text_to_image_agent", false], [9, "module-agentscope.agents.user_agent", false], [10, "module-agentscope.constants", false], [11, "module-agentscope.file_manager", false], [12, "module-agentscope.memory", false], [13, "module-agentscope.memory.memory", false], [14, "module-agentscope.memory.temporary_memory", false], [15, "module-agentscope.message", false], [16, "module-agentscope.models", false], [17, "module-agentscope.models.config", false], [18, "module-agentscope.models.dashscope_model", false], [19, "module-agentscope.models.gemini_model", false], [20, "module-agentscope.models.model", false], [21, "module-agentscope.models.ollama_model", false], [22, "module-agentscope.models.openai_model", false], [23, "module-agentscope.models.post_model", false], [24, "module-agentscope.models.response", false], [25, "module-agentscope.msghub", false], [26, "module-agentscope.pipelines", false], [27, "module-agentscope.pipelines.functional", false], [28, "module-agentscope.pipelines.pipeline", false], [29, "module-agentscope.prompt", false], [30, "module-agentscope.rpc", false], [31, "module-agentscope.rpc.rpc_agent_client", false], [32, "module-agentscope.rpc.rpc_agent_pb2", false], [33, "module-agentscope.rpc.rpc_agent_pb2_grpc", false], [34, "module-agentscope.service", false], [35, "module-agentscope.service.execute_code", false], [36, "module-agentscope.service.execute_code.exec_python", false], [37, "module-agentscope.service.execute_code.exec_shell", false], [38, "module-agentscope.service.file", false], [39, "module-agentscope.service.file.common", false], [40, "module-agentscope.service.file.json", false], [41, "module-agentscope.service.file.text", false], [42, "module-agentscope.service.retrieval", false], [43, "module-agentscope.service.retrieval.retrieval_from_list", false], [44, "module-agentscope.service.retrieval.similarity", false], [45, "module-agentscope.service.service_factory", false], [46, "module-agentscope.service.service_response", false], [47, "module-agentscope.service.service_status", false], [48, "module-agentscope.service.sql_query", false], [49, "module-agentscope.service.sql_query.mongodb", false], [50, "module-agentscope.service.sql_query.mysql", false], [51, "module-agentscope.service.sql_query.sqlite", false], [52, "module-agentscope.service.text_processing", false], [53, "module-agentscope.service.text_processing.summarization", false], [54, "module-agentscope.service.web", false], [55, "module-agentscope.service.web.arxiv", false], [56, "module-agentscope.service.web.download", false], [57, "module-agentscope.service.web.search", false], [58, "module-agentscope.service.web.web_digest", false], [59, "module-agentscope.utils", false], [60, "module-agentscope.utils.common", false], [61, "module-agentscope.utils.logging_utils", false], [62, "module-agentscope.utils.monitor", false], [63, "module-agentscope.utils.token_utils", false], [64, "module-agentscope.utils.tools", false], [65, "module-agentscope.web", false], [66, "module-agentscope.web.studio", false], [67, "module-agentscope.web.studio.constants", false], [68, "module-agentscope.web.studio.studio", false], [69, "module-agentscope.web.studio.utils", false], [70, "module-agentscope.web.workstation", false], [71, "module-agentscope.web.workstation.workflow", false], [72, "module-agentscope.web.workstation.workflow_dag", false], [73, "module-agentscope.web.workstation.workflow_node", false], [74, "module-agentscope.web.workstation.workflow_utils", false]], "monitorbase (class in agentscope.utils)": [[59, "agentscope.utils.MonitorBase", false]], "monitorbase (class in agentscope.utils.monitor)": [[62, "agentscope.utils.monitor.MonitorBase", false]], "monitorfactory (class in agentscope.utils)": [[59, "agentscope.utils.MonitorFactory", false]], "monitorfactory (class in agentscope.utils.monitor)": [[62, "agentscope.utils.monitor.MonitorFactory", false]], "move_directory() (in module agentscope.service)": [[34, "agentscope.service.move_directory", false]], "move_directory() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.move_directory", false]], "move_file() (in module agentscope.service)": [[34, "agentscope.service.move_file", false]], "move_file() (in module agentscope.service.file.common)": [[39, "agentscope.service.file.common.move_file", false]], "msg (class in agentscope.message)": [[15, "agentscope.message.Msg", false]], "msghub() (in module agentscope)": [[0, "agentscope.msghub", false]], "msghub() (in module agentscope.msghub)": [[25, "agentscope.msghub.msghub", false]], "msghubmanager (class in agentscope.msghub)": [[25, "agentscope.msghub.MsgHubManager", false]], "msghubnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.MsgHubNode", false]], "msgnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.MsgNode", false]], "node_type (agentscope.web.workstation.workflow_node.bingsearchservicenode attribute)": [[73, "agentscope.web.workstation.workflow_node.BingSearchServiceNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.copynode attribute)": [[73, "agentscope.web.workstation.workflow_node.CopyNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.dialogagentnode attribute)": [[73, "agentscope.web.workstation.workflow_node.DialogAgentNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.dictdialogagentnode attribute)": [[73, "agentscope.web.workstation.workflow_node.DictDialogAgentNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.forlooppipelinenode attribute)": [[73, "agentscope.web.workstation.workflow_node.ForLoopPipelineNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.googlesearchservicenode attribute)": [[73, "agentscope.web.workstation.workflow_node.GoogleSearchServiceNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.ifelsepipelinenode attribute)": [[73, "agentscope.web.workstation.workflow_node.IfElsePipelineNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.modelnode attribute)": [[73, "agentscope.web.workstation.workflow_node.ModelNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.msghubnode attribute)": [[73, "agentscope.web.workstation.workflow_node.MsgHubNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.msgnode attribute)": [[73, "agentscope.web.workstation.workflow_node.MsgNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.placeholdernode attribute)": [[73, "agentscope.web.workstation.workflow_node.PlaceHolderNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.pythonservicenode attribute)": [[73, "agentscope.web.workstation.workflow_node.PythonServiceNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.reactagentnode attribute)": [[73, "agentscope.web.workstation.workflow_node.ReActAgentNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.readtextservicenode attribute)": [[73, "agentscope.web.workstation.workflow_node.ReadTextServiceNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.sequentialpipelinenode attribute)": [[73, "agentscope.web.workstation.workflow_node.SequentialPipelineNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.switchpipelinenode attribute)": [[73, "agentscope.web.workstation.workflow_node.SwitchPipelineNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.texttoimageagentnode attribute)": [[73, "agentscope.web.workstation.workflow_node.TextToImageAgentNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.useragentnode attribute)": [[73, "agentscope.web.workstation.workflow_node.UserAgentNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.whilelooppipelinenode attribute)": [[73, "agentscope.web.workstation.workflow_node.WhileLoopPipelineNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.workflownode attribute)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNode.node_type", false]], "node_type (agentscope.web.workstation.workflow_node.writetextservicenode attribute)": [[73, "agentscope.web.workstation.workflow_node.WriteTextServiceNode.node_type", false]], "nodes_not_in_graph (agentscope.web.workstation.workflow_dag.asdigraph attribute)": [[72, "agentscope.web.workstation.workflow_dag.ASDiGraph.nodes_not_in_graph", false]], "none (agentscope.constants.responseformat attribute)": [[10, "agentscope.constants.ResponseFormat.NONE", false]], "num_tokens_from_content() (in module agentscope.utils.token_utils)": [[63, "agentscope.utils.token_utils.num_tokens_from_content", false]], "observe() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.observe", false]], "observe() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.observe", false]], "observe() (agentscope.agents.rpc_agent.rpcagent method)": [[7, "agentscope.agents.rpc_agent.RpcAgent.observe", false]], "observe() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.observe", false]], "ollamachatwrapper (class in agentscope.models)": [[16, "agentscope.models.OllamaChatWrapper", false]], "ollamachatwrapper (class in agentscope.models.ollama_model)": [[21, "agentscope.models.ollama_model.OllamaChatWrapper", false]], "ollamaembeddingwrapper (class in agentscope.models)": [[16, "agentscope.models.OllamaEmbeddingWrapper", false]], "ollamaembeddingwrapper (class in agentscope.models.ollama_model)": [[21, "agentscope.models.ollama_model.OllamaEmbeddingWrapper", false]], "ollamagenerationwrapper (class in agentscope.models)": [[16, "agentscope.models.OllamaGenerationWrapper", false]], "ollamagenerationwrapper (class in agentscope.models.ollama_model)": [[21, "agentscope.models.ollama_model.OllamaGenerationWrapper", false]], "ollamawrapperbase (class in agentscope.models.ollama_model)": [[21, "agentscope.models.ollama_model.OllamaWrapperBase", false]], "openaichatwrapper (class in agentscope.models)": [[16, "agentscope.models.OpenAIChatWrapper", false]], "openaichatwrapper (class in agentscope.models.openai_model)": [[22, "agentscope.models.openai_model.OpenAIChatWrapper", false]], "openaidallewrapper (class in agentscope.models)": [[16, "agentscope.models.OpenAIDALLEWrapper", false]], "openaidallewrapper (class in agentscope.models.openai_model)": [[22, "agentscope.models.openai_model.OpenAIDALLEWrapper", false]], "openaiembeddingwrapper (class in agentscope.models)": [[16, "agentscope.models.OpenAIEmbeddingWrapper", false]], "openaiembeddingwrapper (class in agentscope.models.openai_model)": [[22, "agentscope.models.openai_model.OpenAIEmbeddingWrapper", false]], "openaiwrapperbase (class in agentscope.models)": [[16, "agentscope.models.OpenAIWrapperBase", false]], "openaiwrapperbase (class in agentscope.models.openai_model)": [[22, "agentscope.models.openai_model.OpenAIWrapperBase", false]], "operator (class in agentscope.agents)": [[1, "agentscope.agents.Operator", false]], "operator (class in agentscope.agents.operator)": [[5, "agentscope.agents.operator.Operator", false]], "options (agentscope.models.ollama_model.ollamachatwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaChatWrapper.options", false]], "options (agentscope.models.ollama_model.ollamaembeddingwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaEmbeddingWrapper.options", false]], "options (agentscope.models.ollama_model.ollamagenerationwrapper attribute)": [[21, "agentscope.models.ollama_model.OllamaGenerationWrapper.options", false]], "options (agentscope.models.ollama_model.ollamawrapperbase attribute)": [[21, "agentscope.models.ollama_model.OllamaWrapperBase.options", false]], "parse_dict() (in module agentscope.agents.dict_dialog_agent)": [[4, "agentscope.agents.dict_dialog_agent.parse_dict", false]], "parse_func (agentscope.models.response.responseparsingerror attribute)": [[24, "agentscope.models.response.ResponseParsingError.parse_func", false]], "parse_func (agentscope.models.responseparsingerror attribute)": [[16, "agentscope.models.ResponseParsingError.parse_func", false]], "parse_html_to_text() (in module agentscope.service)": [[34, "agentscope.service.parse_html_to_text", false]], "parse_html_to_text() (in module agentscope.service.web.web_digest)": [[58, "agentscope.service.web.web_digest.parse_html_to_text", false]], "pipeline (agentscope.web.workstation.workflow_node.workflownodetype attribute)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNodeType.PIPELINE", false]], "pipelinebase (class in agentscope.pipelines)": [[26, "agentscope.pipelines.PipelineBase", false]], "pipelinebase (class in agentscope.pipelines.pipeline)": [[28, "agentscope.pipelines.pipeline.PipelineBase", false]], "placeholder() (in module agentscope.pipelines.functional)": [[27, "agentscope.pipelines.functional.placeholder", false]], "placeholder_attrs (agentscope.message.placeholdermessage attribute)": [[15, "agentscope.message.PlaceholderMessage.PLACEHOLDER_ATTRS", false]], "placeholdermessage (class in agentscope.message)": [[15, "agentscope.message.PlaceholderMessage", false]], "placeholdernode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.PlaceHolderNode", false]], "postapichatwrapper (class in agentscope.models)": [[16, "agentscope.models.PostAPIChatWrapper", false]], "postapichatwrapper (class in agentscope.models.post_model)": [[23, "agentscope.models.post_model.PostAPIChatWrapper", false]], "postapidallewrapper (class in agentscope.models.post_model)": [[23, "agentscope.models.post_model.PostAPIDALLEWrapper", false]], "postapimodelwrapperbase (class in agentscope.models)": [[16, "agentscope.models.PostAPIModelWrapperBase", false]], "postapimodelwrapperbase (class in agentscope.models.post_model)": [[23, "agentscope.models.post_model.PostAPIModelWrapperBase", false]], "prepare_funcs_prompt() (agentscope.agents.react_agent.reactagent method)": [[6, "agentscope.agents.react_agent.ReActAgent.prepare_funcs_prompt", false]], "prepare_funcs_prompt() (agentscope.agents.reactagent method)": [[1, "agentscope.agents.ReActAgent.prepare_funcs_prompt", false]], "process_messages() (agentscope.agents.rpc_agent.rpcserversidewrapper method)": [[7, "agentscope.agents.rpc_agent.RpcServerSideWrapper.process_messages", false]], "promptengine (class in agentscope.prompt)": [[29, "agentscope.prompt.PromptEngine", false]], "prompttype (class in agentscope.prompt)": [[29, "agentscope.prompt.PromptType", false]], "pythonservicenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.PythonServiceNode", false]], "query_mongodb() (in module agentscope.service)": [[34, "agentscope.service.query_mongodb", false]], "query_mongodb() (in module agentscope.service.sql_query.mongodb)": [[49, "agentscope.service.sql_query.mongodb.query_mongodb", false]], "query_mysql() (in module agentscope.service)": [[34, "agentscope.service.query_mysql", false]], "query_mysql() (in module agentscope.service.sql_query.mysql)": [[50, "agentscope.service.sql_query.mysql.query_mysql", false]], "query_sqlite() (in module agentscope.service)": [[34, "agentscope.service.query_sqlite", false]], "query_sqlite() (in module agentscope.service.sql_query.sqlite)": [[51, "agentscope.service.sql_query.sqlite.query_sqlite", false]], "quotaexceedederror": [[59, "agentscope.utils.QuotaExceededError", false], [62, "agentscope.utils.monitor.QuotaExceededError", false]], "raw (agentscope.models.modelresponse attribute)": [[16, "agentscope.models.ModelResponse.raw", false]], "raw (agentscope.models.response.modelresponse attribute)": [[24, "agentscope.models.response.ModelResponse.raw", false]], "reactagent (class in agentscope.agents)": [[1, "agentscope.agents.ReActAgent", false]], "reactagent (class in agentscope.agents.react_agent)": [[6, "agentscope.agents.react_agent.ReActAgent", false]], "reactagentnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.ReActAgentNode", false]], "read_json_file() (in module agentscope.service)": [[34, "agentscope.service.read_json_file", false]], "read_json_file() (in module agentscope.service.file.json)": [[40, "agentscope.service.file.json.read_json_file", false]], "read_model_configs() (in module agentscope.models)": [[16, "agentscope.models.read_model_configs", false]], "read_text_file() (in module agentscope.service)": [[34, "agentscope.service.read_text_file", false]], "read_text_file() (in module agentscope.service.file.text)": [[41, "agentscope.service.file.text.read_text_file", false]], "readtextservicenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.ReadTextServiceNode", false]], "register() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.register", false]], "register() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.register", false]], "register() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.register", false]], "register_budget() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.register_budget", false]], "register_budget() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.register_budget", false]], "register_budget() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.register_budget", false]], "remove() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.remove", false]], "remove() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.remove", false]], "remove() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.remove", false]], "remove_duplicates_from_end() (in module agentscope.web.workstation.workflow_dag)": [[72, "agentscope.web.workstation.workflow_dag.remove_duplicates_from_end", false]], "reply() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.reply", false]], "reply() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.reply", false]], "reply() (agentscope.agents.dialog_agent.dialogagent method)": [[3, "agentscope.agents.dialog_agent.DialogAgent.reply", false]], "reply() (agentscope.agents.dialogagent method)": [[1, "agentscope.agents.DialogAgent.reply", false]], "reply() (agentscope.agents.dict_dialog_agent.dictdialogagent method)": [[4, "agentscope.agents.dict_dialog_agent.DictDialogAgent.reply", false]], "reply() (agentscope.agents.dictdialogagent method)": [[1, "agentscope.agents.DictDialogAgent.reply", false]], "reply() (agentscope.agents.react_agent.reactagent method)": [[6, "agentscope.agents.react_agent.ReActAgent.reply", false]], "reply() (agentscope.agents.reactagent method)": [[1, "agentscope.agents.ReActAgent.reply", false]], "reply() (agentscope.agents.rpc_agent.rpcagent method)": [[7, "agentscope.agents.rpc_agent.RpcAgent.reply", false]], "reply() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.reply", false]], "reply() (agentscope.agents.text_to_image_agent.texttoimageagent method)": [[8, "agentscope.agents.text_to_image_agent.TextToImageAgent.reply", false]], "reply() (agentscope.agents.texttoimageagent method)": [[1, "agentscope.agents.TextToImageAgent.reply", false]], "reply() (agentscope.agents.user_agent.useragent method)": [[9, "agentscope.agents.user_agent.UserAgent.reply", false]], "reply() (agentscope.agents.useragent method)": [[1, "agentscope.agents.UserAgent.reply", false]], "requests_get() (in module agentscope.utils.common)": [[60, "agentscope.utils.common.requests_get", false]], "reset_audience() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.reset_audience", false]], "reset_audience() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.reset_audience", false]], "reset_glb_var() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.reset_glb_var", false]], "resetexception": [[69, "agentscope.web.studio.utils.ResetException", false]], "response (agentscope.models.response.responseparsingerror attribute)": [[24, "agentscope.models.response.ResponseParsingError.response", false]], "response (agentscope.models.responseparsingerror attribute)": [[16, "agentscope.models.ResponseParsingError.response", false]], "responseformat (class in agentscope.constants)": [[10, "agentscope.constants.ResponseFormat", false]], "responseparser (class in agentscope.models)": [[16, "agentscope.models.ResponseParser", false]], "responseparser (class in agentscope.models.response)": [[24, "agentscope.models.response.ResponseParser", false]], "responseparsingerror": [[16, "agentscope.models.ResponseParsingError", false], [24, "agentscope.models.response.ResponseParsingError", false]], "responsestub (class in agentscope.rpc)": [[30, "agentscope.rpc.ResponseStub", false]], "responsestub (class in agentscope.rpc.rpc_agent_client)": [[31, "agentscope.rpc.rpc_agent_client.ResponseStub", false]], "retrieve_by_embedding() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.retrieve_by_embedding", false]], "retrieve_by_embedding() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.retrieve_by_embedding", false]], "retrieve_from_list() (in module agentscope.service)": [[34, "agentscope.service.retrieve_from_list", false]], "retrieve_from_list() (in module agentscope.service.retrieval.retrieval_from_list)": [[43, "agentscope.service.retrieval.retrieval_from_list.retrieve_from_list", false]], "rm_audience() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.rm_audience", false]], "rm_audience() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.rm_audience", false]], "rpc_servicer_method() (in module agentscope.agents.rpc_agent)": [[7, "agentscope.agents.rpc_agent.rpc_servicer_method", false]], "rpcagent (class in agentscope.agents)": [[1, "agentscope.agents.RpcAgent", false]], "rpcagent (class in agentscope.agents.rpc_agent)": [[7, "agentscope.agents.rpc_agent.RpcAgent", false]], "rpcagent (class in agentscope.rpc.rpc_agent_pb2_grpc)": [[33, "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgent", false]], "rpcagentclient (class in agentscope.rpc)": [[30, "agentscope.rpc.RpcAgentClient", false]], "rpcagentclient (class in agentscope.rpc.rpc_agent_client)": [[31, "agentscope.rpc.rpc_agent_client.RpcAgentClient", false]], "rpcagentserverlauncher (class in agentscope.agents)": [[1, "agentscope.agents.RpcAgentServerLauncher", false]], "rpcagentserverlauncher (class in agentscope.agents.rpc_agent)": [[7, "agentscope.agents.rpc_agent.RpcAgentServerLauncher", false]], "rpcagentservicer (class in agentscope.rpc)": [[30, "agentscope.rpc.RpcAgentServicer", false]], "rpcagentservicer (class in agentscope.rpc.rpc_agent_pb2_grpc)": [[33, "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentServicer", false]], "rpcagentstub (class in agentscope.rpc)": [[30, "agentscope.rpc.RpcAgentStub", false]], "rpcagentstub (class in agentscope.rpc.rpc_agent_pb2_grpc)": [[33, "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentStub", false]], "rpcmsg (class in agentscope.rpc)": [[30, "agentscope.rpc.RpcMsg", false]], "rpcserversidewrapper (class in agentscope.agents.rpc_agent)": [[7, "agentscope.agents.rpc_agent.RpcServerSideWrapper", false]], "run() (agentscope.web.workstation.workflow_dag.asdigraph method)": [[72, "agentscope.web.workstation.workflow_dag.ASDiGraph.run", false]], "run_app() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.run_app", false]], "sanitize_node_data() (in module agentscope.web.workstation.workflow_dag)": [[72, "agentscope.web.workstation.workflow_dag.sanitize_node_data", false]], "send_audio() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.send_audio", false]], "send_image() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.send_image", false]], "send_message() (in module agentscope.web.studio.studio)": [[68, "agentscope.web.studio.studio.send_message", false]], "send_msg() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.send_msg", false]], "send_player_input() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.send_player_input", false]], "send_reset_msg() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.send_reset_msg", false]], "sequentialpipeline (class in agentscope.pipelines)": [[26, "agentscope.pipelines.SequentialPipeline", false]], "sequentialpipeline (class in agentscope.pipelines.pipeline)": [[28, "agentscope.pipelines.pipeline.SequentialPipeline", false]], "sequentialpipeline() (in module agentscope.pipelines)": [[26, "agentscope.pipelines.sequentialpipeline", false]], "sequentialpipeline() (in module agentscope.pipelines.functional)": [[27, "agentscope.pipelines.functional.sequentialpipeline", false]], "sequentialpipelinenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.SequentialPipelineNode", false]], "serialize() (agentscope.message.messagebase method)": [[15, "agentscope.message.MessageBase.serialize", false]], "serialize() (agentscope.message.msg method)": [[15, "agentscope.message.Msg.serialize", false]], "serialize() (agentscope.message.placeholdermessage method)": [[15, "agentscope.message.PlaceholderMessage.serialize", false]], "serialize() (agentscope.message.tht method)": [[15, "agentscope.message.Tht.serialize", false]], "serialize() (in module agentscope.message)": [[15, "agentscope.message.serialize", false]], "service (agentscope.web.workstation.workflow_node.workflownodetype attribute)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNodeType.SERVICE", false]], "serviceexecstatus (class in agentscope.service)": [[34, "agentscope.service.ServiceExecStatus", false]], "serviceexecstatus (class in agentscope.service.service_status)": [[47, "agentscope.service.service_status.ServiceExecStatus", false]], "servicefactory (class in agentscope.service)": [[34, "agentscope.service.ServiceFactory", false]], "servicefactory (class in agentscope.service.service_factory)": [[45, "agentscope.service.service_factory.ServiceFactory", false]], "serviceresponse (class in agentscope.service)": [[34, "agentscope.service.ServiceResponse", false]], "serviceresponse (class in agentscope.service.service_response)": [[46, "agentscope.service.service_response.ServiceResponse", false]], "set_quota() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.set_quota", false]], "set_quota() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.set_quota", false]], "set_quota() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.set_quota", false]], "set_response() (agentscope.rpc.responsestub method)": [[30, "agentscope.rpc.ResponseStub.set_response", false]], "set_response() (agentscope.rpc.rpc_agent_client.responsestub method)": [[31, "agentscope.rpc.rpc_agent_client.ResponseStub.set_response", false]], "setup_logger() (in module agentscope.utils)": [[59, "agentscope.utils.setup_logger", false]], "setup_logger() (in module agentscope.utils.logging_utils)": [[61, "agentscope.utils.logging_utils.setup_logger", false]], "setup_rpc_agent_server() (in module agentscope.agents.rpc_agent)": [[7, "agentscope.agents.rpc_agent.setup_rpc_agent_server", false]], "shrinkpolicy (class in agentscope.constants)": [[10, "agentscope.constants.ShrinkPolicy", false]], "shutdown() (agentscope.agents.rpc_agent.rpcagentserverlauncher method)": [[7, "agentscope.agents.rpc_agent.RpcAgentServerLauncher.shutdown", false]], "shutdown() (agentscope.agents.rpcagentserverlauncher method)": [[1, "agentscope.agents.RpcAgentServerLauncher.shutdown", false]], "size() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.size", false]], "size() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.size", false]], "size() (agentscope.memory.temporary_memory.temporarymemory method)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory.size", false]], "size() (agentscope.memory.temporarymemory method)": [[12, "agentscope.memory.TemporaryMemory.size", false]], "speak() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.speak", false]], "speak() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.speak", false]], "speak() (agentscope.agents.user_agent.useragent method)": [[9, "agentscope.agents.user_agent.UserAgent.speak", false]], "speak() (agentscope.agents.useragent method)": [[1, "agentscope.agents.UserAgent.speak", false]], "sqlite_cursor() (in module agentscope.utils.monitor)": [[62, "agentscope.utils.monitor.sqlite_cursor", false]], "sqlite_transaction() (in module agentscope.utils.monitor)": [[62, "agentscope.utils.monitor.sqlite_transaction", false]], "sqlitemonitor (class in agentscope.utils.monitor)": [[62, "agentscope.utils.monitor.SqliteMonitor", false]], "start_workflow() (in module agentscope.web.workstation.workflow)": [[71, "agentscope.web.workstation.workflow.start_workflow", false]], "stop() (agentscope.agents.rpc_agent.rpcagent method)": [[7, "agentscope.agents.rpc_agent.RpcAgent.stop", false]], "stop() (agentscope.agents.rpcagent method)": [[1, "agentscope.agents.RpcAgent.stop", false]], "string (agentscope.prompt.prompttype attribute)": [[29, "agentscope.prompt.PromptType.STRING", false]], "success (agentscope.service.service_status.serviceexecstatus attribute)": [[47, "agentscope.service.service_status.ServiceExecStatus.SUCCESS", false]], "success (agentscope.service.serviceexecstatus attribute)": [[34, "agentscope.service.ServiceExecStatus.SUCCESS", false]], "summarization() (in module agentscope.service)": [[34, "agentscope.service.summarization", false]], "summarization() (in module agentscope.service.text_processing.summarization)": [[53, "agentscope.service.text_processing.summarization.summarization", false]], "summarize (agentscope.constants.shrinkpolicy attribute)": [[10, "agentscope.constants.ShrinkPolicy.SUMMARIZE", false]], "switchpipeline (class in agentscope.pipelines)": [[26, "agentscope.pipelines.SwitchPipeline", false]], "switchpipeline (class in agentscope.pipelines.pipeline)": [[28, "agentscope.pipelines.pipeline.SwitchPipeline", false]], "switchpipeline() (in module agentscope.pipelines)": [[26, "agentscope.pipelines.switchpipeline", false]], "switchpipeline() (in module agentscope.pipelines.functional)": [[27, "agentscope.pipelines.functional.switchpipeline", false]], "switchpipelinenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.SwitchPipelineNode", false]], "sys_python_guard() (in module agentscope.service.execute_code.exec_python)": [[36, "agentscope.service.execute_code.exec_python.sys_python_guard", false]], "temporarymemory (class in agentscope.memory)": [[12, "agentscope.memory.TemporaryMemory", false]], "temporarymemory (class in agentscope.memory.temporary_memory)": [[14, "agentscope.memory.temporary_memory.TemporaryMemory", false]], "text (agentscope.models.modelresponse attribute)": [[16, "agentscope.models.ModelResponse.text", false]], "text (agentscope.models.response.modelresponse attribute)": [[24, "agentscope.models.response.ModelResponse.text", false]], "texttoimageagent (class in agentscope.agents)": [[1, "agentscope.agents.TextToImageAgent", false]], "texttoimageagent (class in agentscope.agents.text_to_image_agent)": [[8, "agentscope.agents.text_to_image_agent.TextToImageAgent", false]], "texttoimageagentnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.TextToImageAgentNode", false]], "tht (class in agentscope.message)": [[15, "agentscope.message.Tht", false]], "timer() (in module agentscope.utils.common)": [[60, "agentscope.utils.common.timer", false]], "to_dialog_str() (in module agentscope.utils.tools)": [[64, "agentscope.utils.tools.to_dialog_str", false]], "to_dict() (agentscope.models.response.responseparser class method)": [[24, "agentscope.models.response.ResponseParser.to_dict", false]], "to_dict() (agentscope.models.responseparser class method)": [[16, "agentscope.models.ResponseParser.to_dict", false]], "to_dist() (agentscope.agents.agent.agentbase method)": [[2, "agentscope.agents.agent.AgentBase.to_dist", false]], "to_dist() (agentscope.agents.agentbase method)": [[1, "agentscope.agents.AgentBase.to_dist", false]], "to_list() (agentscope.models.response.responseparser class method)": [[24, "agentscope.models.response.ResponseParser.to_list", false]], "to_list() (agentscope.models.responseparser class method)": [[16, "agentscope.models.ResponseParser.to_list", false]], "to_openai_dict() (in module agentscope.utils.tools)": [[64, "agentscope.utils.tools.to_openai_dict", false]], "to_str() (agentscope.message.messagebase method)": [[15, "agentscope.message.MessageBase.to_str", false]], "to_str() (agentscope.message.msg method)": [[15, "agentscope.message.Msg.to_str", false]], "to_str() (agentscope.message.placeholdermessage method)": [[15, "agentscope.message.PlaceholderMessage.to_str", false]], "to_str() (agentscope.message.tht method)": [[15, "agentscope.message.Tht.to_str", false]], "truncate (agentscope.constants.shrinkpolicy attribute)": [[10, "agentscope.constants.ShrinkPolicy.TRUNCATE", false]], "update() (agentscope.utils.monitor.monitorbase method)": [[62, "agentscope.utils.monitor.MonitorBase.update", false]], "update() (agentscope.utils.monitor.sqlitemonitor method)": [[62, "agentscope.utils.monitor.SqliteMonitor.update", false]], "update() (agentscope.utils.monitorbase method)": [[59, "agentscope.utils.MonitorBase.update", false]], "update_config() (agentscope.memory.memory.memorybase method)": [[13, "agentscope.memory.memory.MemoryBase.update_config", false]], "update_config() (agentscope.memory.memorybase method)": [[12, "agentscope.memory.MemoryBase.update_config", false]], "update_monitor() (agentscope.models.model.modelwrapperbase method)": [[20, "agentscope.models.model.ModelWrapperBase.update_monitor", false]], "update_monitor() (agentscope.models.modelwrapperbase method)": [[16, "agentscope.models.ModelWrapperBase.update_monitor", false]], "update_value() (agentscope.message.placeholdermessage method)": [[15, "agentscope.message.PlaceholderMessage.update_value", false]], "user_input() (in module agentscope.web.studio.utils)": [[69, "agentscope.web.studio.utils.user_input", false]], "useragent (class in agentscope.agents)": [[1, "agentscope.agents.UserAgent", false]], "useragent (class in agentscope.agents.user_agent)": [[9, "agentscope.agents.user_agent.UserAgent", false]], "useragentnode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.UserAgentNode", false]], "wait_until_terminate() (agentscope.agents.rpc_agent.rpcagentserverlauncher method)": [[7, "agentscope.agents.rpc_agent.RpcAgentServerLauncher.wait_until_terminate", false]], "wait_until_terminate() (agentscope.agents.rpcagentserverlauncher method)": [[1, "agentscope.agents.RpcAgentServerLauncher.wait_until_terminate", false]], "whilelooppipeline (class in agentscope.pipelines)": [[26, "agentscope.pipelines.WhileLoopPipeline", false]], "whilelooppipeline (class in agentscope.pipelines.pipeline)": [[28, "agentscope.pipelines.pipeline.WhileLoopPipeline", false]], "whilelooppipeline() (in module agentscope.pipelines)": [[26, "agentscope.pipelines.whilelooppipeline", false]], "whilelooppipeline() (in module agentscope.pipelines.functional)": [[27, "agentscope.pipelines.functional.whilelooppipeline", false]], "whilelooppipelinenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.WhileLoopPipelineNode", false]], "workflownode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNode", false]], "workflownodetype (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.WorkflowNodeType", false]], "write_file() (in module agentscope.utils.common)": [[60, "agentscope.utils.common.write_file", false]], "write_json_file() (in module agentscope.service)": [[34, "agentscope.service.write_json_file", false]], "write_json_file() (in module agentscope.service.file.json)": [[40, "agentscope.service.file.json.write_json_file", false]], "write_text_file() (in module agentscope.service)": [[34, "agentscope.service.write_text_file", false]], "write_text_file() (in module agentscope.service.file.text)": [[41, "agentscope.service.file.text.write_text_file", false]], "writetextservicenode (class in agentscope.web.workstation.workflow_node)": [[73, "agentscope.web.workstation.workflow_node.WriteTextServiceNode", false]]}, "objects": {"": [[0, 0, 0, "-", "agentscope"]], "agentscope": [[1, 0, 0, "-", "agents"], [10, 0, 0, "-", "constants"], [11, 0, 0, "-", "file_manager"], [0, 4, 1, "", "init"], [12, 0, 0, "-", "memory"], [15, 0, 0, "-", "message"], [16, 0, 0, "-", "models"], [25, 0, 0, "-", "msghub"], [26, 0, 0, "-", "pipelines"], [29, 0, 0, "-", "prompt"], [30, 0, 0, "-", "rpc"], [34, 0, 0, "-", "service"], [59, 0, 0, "-", "utils"], [65, 0, 0, "-", "web"]], "agentscope.agents": [[1, 1, 1, "", "AgentBase"], [1, 1, 1, "", "DialogAgent"], [1, 1, 1, "", "DictDialogAgent"], [1, 1, 1, "", "Operator"], [1, 1, 1, "", "ReActAgent"], [1, 1, 1, "", "RpcAgent"], [1, 1, 1, "", "RpcAgentServerLauncher"], [1, 1, 1, "", "TextToImageAgent"], [1, 1, 1, "", "UserAgent"], [2, 0, 0, "-", "agent"], [3, 0, 0, "-", "dialog_agent"], [4, 0, 0, "-", "dict_dialog_agent"], [5, 0, 0, "-", "operator"], [6, 0, 0, "-", "react_agent"], [7, 0, 0, "-", "rpc_agent"], [8, 0, 0, "-", "text_to_image_agent"], [9, 0, 0, "-", "user_agent"]], "agentscope.agents.AgentBase": [[1, 2, 1, "", "__init__"], [1, 3, 1, "", "agent_id"], [1, 2, 1, "", "clear_audience"], [1, 2, 1, "", "export_config"], [1, 2, 1, "", "generate_agent_id"], [1, 2, 1, "", "load_from_config"], [1, 2, 1, "", "load_memory"], [1, 2, 1, "", "observe"], [1, 2, 1, "", "reply"], [1, 2, 1, "", "reset_audience"], [1, 2, 1, "", "rm_audience"], [1, 2, 1, "", "speak"], [1, 2, 1, "", "to_dist"]], "agentscope.agents.DialogAgent": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "reply"]], "agentscope.agents.DictDialogAgent": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "reply"]], "agentscope.agents.ReActAgent": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "execute_func"], [1, 2, 1, "", "prepare_funcs_prompt"], [1, 2, 1, "", "reply"]], "agentscope.agents.RpcAgent": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "clone_instances"], [1, 2, 1, "", "observe"], [1, 2, 1, "", "reply"], [1, 2, 1, "", "stop"]], "agentscope.agents.RpcAgentServerLauncher": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "launch"], [1, 2, 1, "", "shutdown"], [1, 2, 1, "", "wait_until_terminate"]], "agentscope.agents.TextToImageAgent": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "reply"]], "agentscope.agents.UserAgent": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "reply"], [1, 2, 1, "", "speak"]], "agentscope.agents.agent": [[2, 1, 1, "", "AgentBase"]], "agentscope.agents.agent.AgentBase": [[2, 2, 1, "", "__init__"], [2, 3, 1, "", "agent_id"], [2, 2, 1, "", "clear_audience"], [2, 2, 1, "", "export_config"], [2, 2, 1, "", "generate_agent_id"], [2, 2, 1, "", "load_from_config"], [2, 2, 1, "", "load_memory"], [2, 2, 1, "", "observe"], [2, 2, 1, "", "reply"], [2, 2, 1, "", "reset_audience"], [2, 2, 1, "", "rm_audience"], [2, 2, 1, "", "speak"], [2, 2, 1, "", "to_dist"]], "agentscope.agents.dialog_agent": [[3, 1, 1, "", "DialogAgent"]], "agentscope.agents.dialog_agent.DialogAgent": [[3, 2, 1, "", "__init__"], [3, 2, 1, "", "reply"]], "agentscope.agents.dict_dialog_agent": [[4, 1, 1, "", "DictDialogAgent"], [4, 4, 1, "", "default_response"], [4, 4, 1, "", "parse_dict"]], "agentscope.agents.dict_dialog_agent.DictDialogAgent": [[4, 2, 1, "", "__init__"], [4, 2, 1, "", "reply"]], "agentscope.agents.operator": [[5, 1, 1, "", "Operator"]], "agentscope.agents.react_agent": [[6, 1, 1, "", "ReActAgent"]], "agentscope.agents.react_agent.ReActAgent": [[6, 2, 1, "", "__init__"], [6, 2, 1, "", "execute_func"], [6, 2, 1, "", "prepare_funcs_prompt"], [6, 2, 1, "", "reply"]], "agentscope.agents.rpc_agent": [[7, 1, 1, "", "RpcAgent"], [7, 1, 1, "", "RpcAgentServerLauncher"], [7, 1, 1, "", "RpcServerSideWrapper"], [7, 4, 1, "", "check_port"], [7, 4, 1, "", "find_available_port"], [7, 4, 1, "", "rpc_servicer_method"], [7, 4, 1, "", "setup_rpc_agent_server"]], "agentscope.agents.rpc_agent.RpcAgent": [[7, 2, 1, "", "__init__"], [7, 2, 1, "", "clone_instances"], [7, 2, 1, "", "observe"], [7, 2, 1, "", "reply"], [7, 2, 1, "", "stop"]], "agentscope.agents.rpc_agent.RpcAgentServerLauncher": [[7, 2, 1, "", "__init__"], [7, 2, 1, "", "launch"], [7, 2, 1, "", "shutdown"], [7, 2, 1, "", "wait_until_terminate"]], "agentscope.agents.rpc_agent.RpcServerSideWrapper": [[7, 2, 1, "", "__init__"], [7, 2, 1, "", "call_func"], [7, 2, 1, "", "check_and_delete_agent"], [7, 2, 1, "", "check_and_generate_agent"], [7, 2, 1, "", "get_task_id"], [7, 2, 1, "", "process_messages"]], "agentscope.agents.text_to_image_agent": [[8, 1, 1, "", "TextToImageAgent"]], "agentscope.agents.text_to_image_agent.TextToImageAgent": [[8, 2, 1, "", "__init__"], [8, 2, 1, "", "reply"]], "agentscope.agents.user_agent": [[9, 1, 1, "", "UserAgent"]], "agentscope.agents.user_agent.UserAgent": [[9, 2, 1, "", "__init__"], [9, 2, 1, "", "reply"], [9, 2, 1, "", "speak"]], "agentscope.constants": [[10, 1, 1, "", "ResponseFormat"], [10, 1, 1, "", "ShrinkPolicy"]], "agentscope.constants.ResponseFormat": [[10, 5, 1, "", "JSON"], [10, 5, 1, "", "NONE"]], "agentscope.constants.ShrinkPolicy": [[10, 5, 1, "", "SUMMARIZE"], [10, 5, 1, "", "TRUNCATE"]], "agentscope.memory": [[12, 1, 1, "", "MemoryBase"], [12, 1, 1, "", "TemporaryMemory"], [13, 0, 0, "-", "memory"], [14, 0, 0, "-", "temporary_memory"]], "agentscope.memory.MemoryBase": [[12, 2, 1, "", "__init__"], [12, 2, 1, "", "add"], [12, 2, 1, "", "clear"], [12, 2, 1, "", "delete"], [12, 2, 1, "", "export"], [12, 2, 1, "", "get_memory"], [12, 2, 1, "", "load"], [12, 2, 1, "", "size"], [12, 2, 1, "", "update_config"]], "agentscope.memory.TemporaryMemory": [[12, 2, 1, "", "__init__"], [12, 2, 1, "", "add"], [12, 2, 1, "", "clear"], [12, 2, 1, "", "delete"], [12, 2, 1, "", "export"], [12, 2, 1, "", "get_embeddings"], [12, 2, 1, "", "get_memory"], [12, 2, 1, "", "load"], [12, 2, 1, "", "retrieve_by_embedding"], [12, 2, 1, "", "size"]], "agentscope.memory.memory": [[13, 1, 1, "", "MemoryBase"]], "agentscope.memory.memory.MemoryBase": [[13, 2, 1, "", "__init__"], [13, 2, 1, "", "add"], [13, 2, 1, "", "clear"], [13, 2, 1, "", "delete"], [13, 2, 1, "", "export"], [13, 2, 1, "", "get_memory"], [13, 2, 1, "", "load"], [13, 2, 1, "", "size"], [13, 2, 1, "", "update_config"]], "agentscope.memory.temporary_memory": [[14, 1, 1, "", "TemporaryMemory"]], "agentscope.memory.temporary_memory.TemporaryMemory": [[14, 2, 1, "", "__init__"], [14, 2, 1, "", "add"], [14, 2, 1, "", "clear"], [14, 2, 1, "", "delete"], [14, 2, 1, "", "export"], [14, 2, 1, "", "get_embeddings"], [14, 2, 1, "", "get_memory"], [14, 2, 1, "", "load"], [14, 2, 1, "", "retrieve_by_embedding"], [14, 2, 1, "", "size"]], "agentscope.message": [[15, 1, 1, "", "MessageBase"], [15, 1, 1, "", "Msg"], [15, 1, 1, "", "PlaceholderMessage"], [15, 1, 1, "", "Tht"], [15, 4, 1, "", "deserialize"], [15, 4, 1, "", "serialize"]], "agentscope.message.MessageBase": [[15, 2, 1, "", "__init__"], [15, 2, 1, "", "serialize"], [15, 2, 1, "", "to_str"]], "agentscope.message.Msg": [[15, 2, 1, "", "__init__"], [15, 2, 1, "", "serialize"], [15, 2, 1, "", "to_str"]], "agentscope.message.PlaceholderMessage": [[15, 5, 1, "", "LOCAL_ATTRS"], [15, 5, 1, "", "PLACEHOLDER_ATTRS"], [15, 2, 1, "", "__init__"], [15, 2, 1, "", "serialize"], [15, 2, 1, "", "to_str"], [15, 2, 1, "", "update_value"]], "agentscope.message.Tht": [[15, 2, 1, "", "__init__"], [15, 2, 1, "", "serialize"], [15, 2, 1, "", "to_str"]], "agentscope.models": [[16, 1, 1, "", "DashScopeChatWrapper"], [16, 1, 1, "", "DashScopeImageSynthesisWrapper"], [16, 1, 1, "", "DashScopeMultiModalWrapper"], [16, 1, 1, "", "DashScopeTextEmbeddingWrapper"], [16, 1, 1, "", "GeminiChatWrapper"], [16, 1, 1, "", "GeminiEmbeddingWrapper"], [16, 1, 1, "", "ModelResponse"], [16, 1, 1, "", "ModelWrapperBase"], [16, 1, 1, "", "OllamaChatWrapper"], [16, 1, 1, "", "OllamaEmbeddingWrapper"], [16, 1, 1, "", "OllamaGenerationWrapper"], [16, 1, 1, "", "OpenAIChatWrapper"], [16, 1, 1, "", "OpenAIDALLEWrapper"], [16, 1, 1, "", "OpenAIEmbeddingWrapper"], [16, 1, 1, "", "OpenAIWrapperBase"], [16, 1, 1, "", "PostAPIChatWrapper"], [16, 1, 1, "", "PostAPIModelWrapperBase"], [16, 1, 1, "", "ResponseParser"], [16, 6, 1, "", "ResponseParsingError"], [16, 4, 1, "", "clear_model_configs"], [17, 0, 0, "-", "config"], [18, 0, 0, "-", "dashscope_model"], [19, 0, 0, "-", "gemini_model"], [16, 4, 1, "", "load_model_by_config_name"], [20, 0, 0, "-", "model"], [21, 0, 0, "-", "ollama_model"], [22, 0, 0, "-", "openai_model"], [23, 0, 0, "-", "post_model"], [16, 4, 1, "", "read_model_configs"], [24, 0, 0, "-", "response"]], "agentscope.models.DashScopeChatWrapper": [[16, 5, 1, "", "deprecated_model_type"], [16, 2, 1, "", "format"], [16, 5, 1, "", "model_type"]], "agentscope.models.DashScopeImageSynthesisWrapper": [[16, 5, 1, "", "model_type"]], "agentscope.models.DashScopeMultiModalWrapper": [[16, 2, 1, "", "format"], [16, 5, 1, "", "model_type"]], "agentscope.models.DashScopeTextEmbeddingWrapper": [[16, 5, 1, "", "model_type"]], "agentscope.models.GeminiChatWrapper": [[16, 2, 1, "", "__init__"], [16, 2, 1, "", "format"], [16, 5, 1, "", "generation_method"], [16, 5, 1, "", "model_type"]], "agentscope.models.GeminiEmbeddingWrapper": [[16, 5, 1, "", "model_type"]], "agentscope.models.ModelResponse": [[16, 2, 1, "", "__init__"], [16, 5, 1, "", "embedding"], [16, 5, 1, "", "image_urls"], [16, 5, 1, "", "json"], [16, 5, 1, "", "raw"], [16, 5, 1, "", "text"]], "agentscope.models.ModelWrapperBase": [[16, 2, 1, "", "__init__"], [16, 5, 1, "", "config_name"], [16, 2, 1, "", "format"], [16, 2, 1, "", "get_wrapper"], [16, 5, 1, "", "model_name"], [16, 5, 1, "", "model_type"], [16, 2, 1, "", "update_monitor"]], "agentscope.models.OllamaChatWrapper": [[16, 2, 1, "", "format"], [16, 5, 1, "", "model_type"]], "agentscope.models.OllamaEmbeddingWrapper": [[16, 2, 1, "", "format"], [16, 5, 1, "", "model_type"]], "agentscope.models.OllamaGenerationWrapper": [[16, 2, 1, "", "format"], [16, 5, 1, "", "model_type"]], "agentscope.models.OpenAIChatWrapper": [[16, 5, 1, "", "deprecated_model_type"], [16, 2, 1, "", "format"], [16, 5, 1, "", "model_type"]], "agentscope.models.OpenAIDALLEWrapper": [[16, 5, 1, "", "model_type"]], "agentscope.models.OpenAIEmbeddingWrapper": [[16, 5, 1, "", "model_type"]], "agentscope.models.OpenAIWrapperBase": [[16, 2, 1, "", "__init__"], [16, 2, 1, "", "format"]], "agentscope.models.PostAPIChatWrapper": [[16, 2, 1, "", "format"], [16, 5, 1, "", "model_type"]], "agentscope.models.PostAPIModelWrapperBase": [[16, 2, 1, "", "__init__"], [16, 5, 1, "", "model_type"]], "agentscope.models.ResponseParser": [[16, 2, 1, "", "to_dict"], [16, 2, 1, "", "to_list"]], "agentscope.models.ResponseParsingError": [[16, 2, 1, "", "__init__"], [16, 5, 1, "", "error_info"], [16, 5, 1, "", "parse_func"], [16, 5, 1, "", "response"]], "agentscope.models.dashscope_model": [[18, 1, 1, "", "DashScopeChatWrapper"], [18, 1, 1, "", "DashScopeImageSynthesisWrapper"], [18, 1, 1, "", "DashScopeMultiModalWrapper"], [18, 1, 1, "", "DashScopeTextEmbeddingWrapper"], [18, 1, 1, "", "DashScopeWrapperBase"]], "agentscope.models.dashscope_model.DashScopeChatWrapper": [[18, 5, 1, "", "config_name"], [18, 5, 1, "", "deprecated_model_type"], [18, 2, 1, "", "format"], [18, 5, 1, "", "model_name"], [18, 5, 1, "", "model_type"]], "agentscope.models.dashscope_model.DashScopeImageSynthesisWrapper": [[18, 5, 1, "", "config_name"], [18, 5, 1, "", "model_name"], [18, 5, 1, "", "model_type"]], "agentscope.models.dashscope_model.DashScopeMultiModalWrapper": [[18, 5, 1, "", "config_name"], [18, 2, 1, "", "format"], [18, 5, 1, "", "model_name"], [18, 5, 1, "", "model_type"]], "agentscope.models.dashscope_model.DashScopeTextEmbeddingWrapper": [[18, 5, 1, "", "config_name"], [18, 5, 1, "", "model_name"], [18, 5, 1, "", "model_type"]], "agentscope.models.dashscope_model.DashScopeWrapperBase": [[18, 2, 1, "", "__init__"], [18, 2, 1, "", "format"]], "agentscope.models.gemini_model": [[19, 1, 1, "", "GeminiChatWrapper"], [19, 1, 1, "", "GeminiEmbeddingWrapper"], [19, 1, 1, "", "GeminiWrapperBase"]], "agentscope.models.gemini_model.GeminiChatWrapper": [[19, 2, 1, "", "__init__"], [19, 5, 1, "", "config_name"], [19, 2, 1, "", "format"], [19, 5, 1, "", "generation_method"], [19, 5, 1, "", "model_name"], [19, 5, 1, "", "model_type"]], "agentscope.models.gemini_model.GeminiEmbeddingWrapper": [[19, 5, 1, "", "config_name"], [19, 5, 1, "", "model_name"], [19, 5, 1, "", "model_type"]], "agentscope.models.gemini_model.GeminiWrapperBase": [[19, 2, 1, "", "__init__"], [19, 2, 1, "", "list_models"]], "agentscope.models.model": [[20, 1, 1, "", "ModelWrapperBase"]], "agentscope.models.model.ModelWrapperBase": [[20, 2, 1, "", "__init__"], [20, 5, 1, "", "config_name"], [20, 2, 1, "", "format"], [20, 2, 1, "", "get_wrapper"], [20, 5, 1, "", "model_name"], [20, 5, 1, "", "model_type"], [20, 2, 1, "", "update_monitor"]], "agentscope.models.ollama_model": [[21, 1, 1, "", "OllamaChatWrapper"], [21, 1, 1, "", "OllamaEmbeddingWrapper"], [21, 1, 1, "", "OllamaGenerationWrapper"], [21, 1, 1, "", "OllamaWrapperBase"]], "agentscope.models.ollama_model.OllamaChatWrapper": [[21, 5, 1, "", "config_name"], [21, 2, 1, "", "format"], [21, 5, 1, "", "keep_alive"], [21, 5, 1, "", "model_name"], [21, 5, 1, "", "model_type"], [21, 5, 1, "", "options"]], "agentscope.models.ollama_model.OllamaEmbeddingWrapper": [[21, 5, 1, "", "config_name"], [21, 2, 1, "", "format"], [21, 5, 1, "", "keep_alive"], [21, 5, 1, "", "model_name"], [21, 5, 1, "", "model_type"], [21, 5, 1, "", "options"]], "agentscope.models.ollama_model.OllamaGenerationWrapper": [[21, 5, 1, "", "config_name"], [21, 2, 1, "", "format"], [21, 5, 1, "", "keep_alive"], [21, 5, 1, "", "model_name"], [21, 5, 1, "", "model_type"], [21, 5, 1, "", "options"]], "agentscope.models.ollama_model.OllamaWrapperBase": [[21, 2, 1, "", "__init__"], [21, 5, 1, "", "keep_alive"], [21, 5, 1, "", "model_name"], [21, 5, 1, "", "model_type"], [21, 5, 1, "", "options"]], "agentscope.models.openai_model": [[22, 1, 1, "", "OpenAIChatWrapper"], [22, 1, 1, "", "OpenAIDALLEWrapper"], [22, 1, 1, "", "OpenAIEmbeddingWrapper"], [22, 1, 1, "", "OpenAIWrapperBase"]], "agentscope.models.openai_model.OpenAIChatWrapper": [[22, 5, 1, "", "config_name"], [22, 5, 1, "", "deprecated_model_type"], [22, 2, 1, "", "format"], [22, 5, 1, "", "model_name"], [22, 5, 1, "", "model_type"]], "agentscope.models.openai_model.OpenAIDALLEWrapper": [[22, 5, 1, "", "config_name"], [22, 5, 1, "", "model_name"], [22, 5, 1, "", "model_type"]], "agentscope.models.openai_model.OpenAIEmbeddingWrapper": [[22, 5, 1, "", "config_name"], [22, 5, 1, "", "model_name"], [22, 5, 1, "", "model_type"]], "agentscope.models.openai_model.OpenAIWrapperBase": [[22, 2, 1, "", "__init__"], [22, 2, 1, "", "format"]], "agentscope.models.post_model": [[23, 1, 1, "", "PostAPIChatWrapper"], [23, 1, 1, "", "PostAPIDALLEWrapper"], [23, 1, 1, "", "PostAPIModelWrapperBase"]], "agentscope.models.post_model.PostAPIChatWrapper": [[23, 5, 1, "", "config_name"], [23, 2, 1, "", "format"], [23, 5, 1, "", "model_name"], [23, 5, 1, "", "model_type"]], "agentscope.models.post_model.PostAPIDALLEWrapper": [[23, 5, 1, "", "deprecated_model_type"], [23, 2, 1, "", "format"], [23, 5, 1, "", "model_type"]], "agentscope.models.post_model.PostAPIModelWrapperBase": [[23, 2, 1, "", "__init__"], [23, 5, 1, "", "config_name"], [23, 5, 1, "", "model_name"], [23, 5, 1, "", "model_type"]], "agentscope.models.response": [[24, 1, 1, "", "ModelResponse"], [24, 1, 1, "", "ResponseParser"], [24, 6, 1, "", "ResponseParsingError"]], "agentscope.models.response.ModelResponse": [[24, 2, 1, "", "__init__"], [24, 5, 1, "", "embedding"], [24, 5, 1, "", "image_urls"], [24, 5, 1, "", "json"], [24, 5, 1, "", "raw"], [24, 5, 1, "", "text"]], "agentscope.models.response.ResponseParser": [[24, 2, 1, "", "to_dict"], [24, 2, 1, "", "to_list"]], "agentscope.models.response.ResponseParsingError": [[24, 2, 1, "", "__init__"], [24, 5, 1, "", "error_info"], [24, 5, 1, "", "parse_func"], [24, 5, 1, "", "response"]], "agentscope.msghub": [[25, 1, 1, "", "MsgHubManager"], [25, 4, 1, "", "msghub"]], "agentscope.msghub.MsgHubManager": [[25, 2, 1, "", "__init__"], [25, 2, 1, "", "add"], [25, 2, 1, "", "broadcast"], [25, 2, 1, "", "delete"]], "agentscope.pipelines": [[26, 1, 1, "", "ForLoopPipeline"], [26, 1, 1, "", "IfElsePipeline"], [26, 1, 1, "", "PipelineBase"], [26, 1, 1, "", "SequentialPipeline"], [26, 1, 1, "", "SwitchPipeline"], [26, 1, 1, "", "WhileLoopPipeline"], [26, 4, 1, "", "forlooppipeline"], [27, 0, 0, "-", "functional"], [26, 4, 1, "", "ifelsepipeline"], [28, 0, 0, "-", "pipeline"], [26, 4, 1, "", "sequentialpipeline"], [26, 4, 1, "", "switchpipeline"], [26, 4, 1, "", "whilelooppipeline"]], "agentscope.pipelines.ForLoopPipeline": [[26, 2, 1, "", "__init__"]], "agentscope.pipelines.IfElsePipeline": [[26, 2, 1, "", "__init__"]], "agentscope.pipelines.PipelineBase": [[26, 2, 1, "", "__init__"]], "agentscope.pipelines.SequentialPipeline": [[26, 2, 1, "", "__init__"]], "agentscope.pipelines.SwitchPipeline": [[26, 2, 1, "", "__init__"]], "agentscope.pipelines.WhileLoopPipeline": [[26, 2, 1, "", "__init__"]], "agentscope.pipelines.functional": [[27, 4, 1, "", "forlooppipeline"], [27, 4, 1, "", "ifelsepipeline"], [27, 4, 1, "", "placeholder"], [27, 4, 1, "", "sequentialpipeline"], [27, 4, 1, "", "switchpipeline"], [27, 4, 1, "", "whilelooppipeline"]], "agentscope.pipelines.pipeline": [[28, 1, 1, "", "ForLoopPipeline"], [28, 1, 1, "", "IfElsePipeline"], [28, 1, 1, "", "PipelineBase"], [28, 1, 1, "", "SequentialPipeline"], [28, 1, 1, "", "SwitchPipeline"], [28, 1, 1, "", "WhileLoopPipeline"]], "agentscope.pipelines.pipeline.ForLoopPipeline": [[28, 2, 1, "", "__init__"]], "agentscope.pipelines.pipeline.IfElsePipeline": [[28, 2, 1, "", "__init__"]], "agentscope.pipelines.pipeline.PipelineBase": [[28, 2, 1, "", "__init__"]], "agentscope.pipelines.pipeline.SequentialPipeline": [[28, 2, 1, "", "__init__"]], "agentscope.pipelines.pipeline.SwitchPipeline": [[28, 2, 1, "", "__init__"]], "agentscope.pipelines.pipeline.WhileLoopPipeline": [[28, 2, 1, "", "__init__"]], "agentscope.prompt": [[29, 1, 1, "", "PromptEngine"], [29, 1, 1, "", "PromptType"]], "agentscope.prompt.PromptEngine": [[29, 2, 1, "", "__init__"], [29, 2, 1, "", "join"], [29, 2, 1, "", "join_to_list"], [29, 2, 1, "", "join_to_str"]], "agentscope.prompt.PromptType": [[29, 5, 1, "", "LIST"], [29, 5, 1, "", "STRING"]], "agentscope.rpc": [[30, 1, 1, "", "ResponseStub"], [30, 1, 1, "", "RpcAgentClient"], [30, 1, 1, "", "RpcAgentServicer"], [30, 1, 1, "", "RpcAgentStub"], [30, 1, 1, "", "RpcMsg"], [30, 4, 1, "", "add_RpcAgentServicer_to_server"], [30, 4, 1, "", "call_in_thread"], [31, 0, 0, "-", "rpc_agent_client"], [32, 0, 0, "-", "rpc_agent_pb2"], [33, 0, 0, "-", "rpc_agent_pb2_grpc"]], "agentscope.rpc.ResponseStub": [[30, 2, 1, "", "__init__"], [30, 2, 1, "", "get_response"], [30, 2, 1, "", "set_response"]], "agentscope.rpc.RpcAgentClient": [[30, 2, 1, "", "__init__"], [30, 2, 1, "", "call_func"], [30, 2, 1, "", "create_agent"], [30, 2, 1, "", "delete_agent"]], "agentscope.rpc.RpcAgentServicer": [[30, 2, 1, "", "call_func"]], "agentscope.rpc.RpcAgentStub": [[30, 2, 1, "", "__init__"]], "agentscope.rpc.RpcMsg": [[30, 5, 1, "", "DESCRIPTOR"]], "agentscope.rpc.rpc_agent_client": [[31, 1, 1, "", "ResponseStub"], [31, 1, 1, "", "RpcAgentClient"], [31, 4, 1, "", "call_in_thread"]], "agentscope.rpc.rpc_agent_client.ResponseStub": [[31, 2, 1, "", "__init__"], [31, 2, 1, "", "get_response"], [31, 2, 1, "", "set_response"]], "agentscope.rpc.rpc_agent_client.RpcAgentClient": [[31, 2, 1, "", "__init__"], [31, 2, 1, "", "call_func"], [31, 2, 1, "", "create_agent"], [31, 2, 1, "", "delete_agent"]], "agentscope.rpc.rpc_agent_pb2_grpc": [[33, 1, 1, "", "RpcAgent"], [33, 1, 1, "", "RpcAgentServicer"], [33, 1, 1, "", "RpcAgentStub"], [33, 4, 1, "", "add_RpcAgentServicer_to_server"]], "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgent": [[33, 2, 1, "", "call_func"]], "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentServicer": [[33, 2, 1, "", "call_func"]], "agentscope.rpc.rpc_agent_pb2_grpc.RpcAgentStub": [[33, 2, 1, "", "__init__"]], "agentscope.service": [[34, 1, 1, "", "ServiceExecStatus"], [34, 1, 1, "", "ServiceFactory"], [34, 1, 1, "", "ServiceResponse"], [34, 4, 1, "", "arxiv_search"], [34, 4, 1, "", "bing_search"], [34, 4, 1, "", "cos_sim"], [34, 4, 1, "", "create_directory"], [34, 4, 1, "", "create_file"], [34, 4, 1, "", "delete_directory"], [34, 4, 1, "", "delete_file"], [34, 4, 1, "", "digest_webpage"], [34, 4, 1, "", "download_from_url"], [35, 0, 0, "-", "execute_code"], [34, 4, 1, "", "execute_python_code"], [34, 4, 1, "", "execute_shell_command"], [38, 0, 0, "-", "file"], [34, 4, 1, "", "get_current_directory"], [34, 4, 1, "", "get_help"], [34, 4, 1, "", "google_search"], [34, 4, 1, "", "list_directory_content"], [34, 4, 1, "", "load_web"], [34, 4, 1, "", "move_directory"], [34, 4, 1, "", "move_file"], [34, 4, 1, "", "parse_html_to_text"], [34, 4, 1, "", "query_mongodb"], [34, 4, 1, "", "query_mysql"], [34, 4, 1, "", "query_sqlite"], [34, 4, 1, "", "read_json_file"], [34, 4, 1, "", "read_text_file"], [42, 0, 0, "-", "retrieval"], [34, 4, 1, "", "retrieve_from_list"], [45, 0, 0, "-", "service_factory"], [46, 0, 0, "-", "service_response"], [47, 0, 0, "-", "service_status"], [48, 0, 0, "-", "sql_query"], [34, 4, 1, "", "summarization"], [52, 0, 0, "-", "text_processing"], [54, 0, 0, "-", "web"], [34, 4, 1, "", "write_json_file"], [34, 4, 1, "", "write_text_file"]], "agentscope.service.ServiceExecStatus": [[34, 5, 1, "", "ERROR"], [34, 5, 1, "", "SUCCESS"]], "agentscope.service.ServiceFactory": [[34, 2, 1, "", "get"]], "agentscope.service.ServiceResponse": [[34, 2, 1, "", "__init__"]], "agentscope.service.execute_code": [[36, 0, 0, "-", "exec_python"], [37, 0, 0, "-", "exec_shell"]], "agentscope.service.execute_code.exec_python": [[36, 4, 1, "", "execute_python_code"], [36, 4, 1, "", "sys_python_guard"]], "agentscope.service.execute_code.exec_shell": [[37, 4, 1, "", "execute_shell_command"]], "agentscope.service.file": [[39, 0, 0, "-", "common"], [40, 0, 0, "-", "json"], [41, 0, 0, "-", "text"]], "agentscope.service.file.common": [[39, 4, 1, "", "create_directory"], [39, 4, 1, "", "create_file"], [39, 4, 1, "", "delete_directory"], [39, 4, 1, "", "delete_file"], [39, 4, 1, "", "get_current_directory"], [39, 4, 1, "", "list_directory_content"], [39, 4, 1, "", "move_directory"], [39, 4, 1, "", "move_file"]], "agentscope.service.file.json": [[40, 4, 1, "", "read_json_file"], [40, 4, 1, "", "write_json_file"]], "agentscope.service.file.text": [[41, 4, 1, "", "read_text_file"], [41, 4, 1, "", "write_text_file"]], "agentscope.service.retrieval": [[43, 0, 0, "-", "retrieval_from_list"], [44, 0, 0, "-", "similarity"]], "agentscope.service.retrieval.retrieval_from_list": [[43, 4, 1, "", "retrieve_from_list"]], "agentscope.service.retrieval.similarity": [[44, 4, 1, "", "cos_sim"]], "agentscope.service.service_factory": [[45, 1, 1, "", "ServiceFactory"]], "agentscope.service.service_factory.ServiceFactory": [[45, 2, 1, "", "get"]], "agentscope.service.service_response": [[46, 1, 1, "", "ServiceResponse"]], "agentscope.service.service_response.ServiceResponse": [[46, 2, 1, "", "__init__"]], "agentscope.service.service_status": [[47, 1, 1, "", "ServiceExecStatus"]], "agentscope.service.service_status.ServiceExecStatus": [[47, 5, 1, "", "ERROR"], [47, 5, 1, "", "SUCCESS"]], "agentscope.service.sql_query": [[49, 0, 0, "-", "mongodb"], [50, 0, 0, "-", "mysql"], [51, 0, 0, "-", "sqlite"]], "agentscope.service.sql_query.mongodb": [[49, 4, 1, "", "query_mongodb"]], "agentscope.service.sql_query.mysql": [[50, 4, 1, "", "query_mysql"]], "agentscope.service.sql_query.sqlite": [[51, 4, 1, "", "query_sqlite"]], "agentscope.service.text_processing": [[53, 0, 0, "-", "summarization"]], "agentscope.service.text_processing.summarization": [[53, 4, 1, "", "summarization"]], "agentscope.service.web": [[55, 0, 0, "-", "arxiv"], [56, 0, 0, "-", "download"], [57, 0, 0, "-", "search"], [58, 0, 0, "-", "web_digest"]], "agentscope.service.web.arxiv": [[55, 4, 1, "", "arxiv_search"]], "agentscope.service.web.download": [[56, 4, 1, "", "download_from_url"]], "agentscope.service.web.search": [[57, 4, 1, "", "bing_search"], [57, 4, 1, "", "google_search"]], "agentscope.service.web.web_digest": [[58, 4, 1, "", "digest_webpage"], [58, 4, 1, "", "is_valid_url"], [58, 4, 1, "", "load_web"], [58, 4, 1, "", "parse_html_to_text"]], "agentscope.utils": [[59, 1, 1, "", "MonitorBase"], [59, 1, 1, "", "MonitorFactory"], [59, 6, 1, "", "QuotaExceededError"], [60, 0, 0, "-", "common"], [61, 0, 0, "-", "logging_utils"], [62, 0, 0, "-", "monitor"], [59, 4, 1, "", "setup_logger"], [63, 0, 0, "-", "token_utils"], [64, 0, 0, "-", "tools"]], "agentscope.utils.MonitorBase": [[59, 2, 1, "", "add"], [59, 2, 1, "", "clear"], [59, 2, 1, "", "exists"], [59, 2, 1, "", "get_metric"], [59, 2, 1, "", "get_metrics"], [59, 2, 1, "", "get_quota"], [59, 2, 1, "", "get_unit"], [59, 2, 1, "", "get_value"], [59, 2, 1, "", "register"], [59, 2, 1, "", "register_budget"], [59, 2, 1, "", "remove"], [59, 2, 1, "", "set_quota"], [59, 2, 1, "", "update"]], "agentscope.utils.MonitorFactory": [[59, 2, 1, "", "flush"], [59, 2, 1, "", "get_monitor"]], "agentscope.utils.QuotaExceededError": [[59, 2, 1, "", "__init__"]], "agentscope.utils.common": [[60, 4, 1, "", "chdir"], [60, 4, 1, "", "create_tempdir"], [60, 4, 1, "", "if_change_database"], [60, 4, 1, "", "requests_get"], [60, 4, 1, "", "timer"], [60, 4, 1, "", "write_file"]], "agentscope.utils.logging_utils": [[61, 4, 1, "", "log_studio"], [61, 4, 1, "", "setup_logger"]], "agentscope.utils.monitor": [[62, 1, 1, "", "MonitorBase"], [62, 1, 1, "", "MonitorFactory"], [62, 6, 1, "", "QuotaExceededError"], [62, 1, 1, "", "SqliteMonitor"], [62, 4, 1, "", "get_full_name"], [62, 4, 1, "", "sqlite_cursor"], [62, 4, 1, "", "sqlite_transaction"]], "agentscope.utils.monitor.MonitorBase": [[62, 2, 1, "", "add"], [62, 2, 1, "", "clear"], [62, 2, 1, "", "exists"], [62, 2, 1, "", "get_metric"], [62, 2, 1, "", "get_metrics"], [62, 2, 1, "", "get_quota"], [62, 2, 1, "", "get_unit"], [62, 2, 1, "", "get_value"], [62, 2, 1, "", "register"], [62, 2, 1, "", "register_budget"], [62, 2, 1, "", "remove"], [62, 2, 1, "", "set_quota"], [62, 2, 1, "", "update"]], "agentscope.utils.monitor.MonitorFactory": [[62, 2, 1, "", "flush"], [62, 2, 1, "", "get_monitor"]], "agentscope.utils.monitor.QuotaExceededError": [[62, 2, 1, "", "__init__"]], "agentscope.utils.monitor.SqliteMonitor": [[62, 2, 1, "", "__init__"], [62, 2, 1, "", "add"], [62, 2, 1, "", "clear"], [62, 2, 1, "", "exists"], [62, 2, 1, "", "get_metric"], [62, 2, 1, "", "get_metrics"], [62, 2, 1, "", "get_quota"], [62, 2, 1, "", "get_unit"], [62, 2, 1, "", "get_value"], [62, 2, 1, "", "register"], [62, 2, 1, "", "register_budget"], [62, 2, 1, "", "remove"], [62, 2, 1, "", "set_quota"], [62, 2, 1, "", "update"]], "agentscope.utils.token_utils": [[63, 4, 1, "", "count_openai_token"], [63, 4, 1, "", "get_openai_max_length"], [63, 4, 1, "", "num_tokens_from_content"]], "agentscope.utils.tools": [[64, 4, 1, "", "to_dialog_str"], [64, 4, 1, "", "to_openai_dict"]], "agentscope.web": [[65, 4, 1, "", "init"], [66, 0, 0, "-", "studio"], [70, 0, 0, "-", "workstation"]], "agentscope.web.studio": [[67, 0, 0, "-", "constants"], [68, 0, 0, "-", "studio"], [69, 0, 0, "-", "utils"]], "agentscope.web.studio.studio": [[68, 4, 1, "", "fn_choice"], [68, 4, 1, "", "get_chat"], [68, 4, 1, "", "import_function_from_path"], [68, 4, 1, "", "init_uid_list"], [68, 4, 1, "", "reset_glb_var"], [68, 4, 1, "", "run_app"], [68, 4, 1, "", "send_audio"], [68, 4, 1, "", "send_image"], [68, 4, 1, "", "send_message"]], "agentscope.web.studio.utils": [[69, 6, 1, "", "ResetException"], [69, 4, 1, "", "audio2text"], [69, 4, 1, "", "check_uuid"], [69, 4, 1, "", "cycle_dots"], [69, 4, 1, "", "generate_image_from_name"], [69, 4, 1, "", "get_chat_msg"], [69, 4, 1, "", "get_player_input"], [69, 4, 1, "", "get_reset_msg"], [69, 4, 1, "", "init_uid_queues"], [69, 4, 1, "", "send_msg"], [69, 4, 1, "", "send_player_input"], [69, 4, 1, "", "send_reset_msg"], [69, 4, 1, "", "user_input"]], "agentscope.web.workstation": [[71, 0, 0, "-", "workflow"], [72, 0, 0, "-", "workflow_dag"], [73, 0, 0, "-", "workflow_node"], [74, 0, 0, "-", "workflow_utils"]], "agentscope.web.workstation.workflow": [[71, 4, 1, "", "compile_workflow"], [71, 4, 1, "", "load_config"], [71, 4, 1, "", "main"], [71, 4, 1, "", "start_workflow"]], "agentscope.web.workstation.workflow_dag": [[72, 1, 1, "", "ASDiGraph"], [72, 4, 1, "", "build_dag"], [72, 4, 1, "", "remove_duplicates_from_end"], [72, 4, 1, "", "sanitize_node_data"]], "agentscope.web.workstation.workflow_dag.ASDiGraph": [[72, 2, 1, "", "__init__"], [72, 2, 1, "", "add_as_node"], [72, 2, 1, "", "compile"], [72, 2, 1, "", "exec_node"], [72, 5, 1, "", "nodes_not_in_graph"], [72, 2, 1, "", "run"]], "agentscope.web.workstation.workflow_node": [[73, 1, 1, "", "BingSearchServiceNode"], [73, 1, 1, "", "CopyNode"], [73, 1, 1, "", "DialogAgentNode"], [73, 1, 1, "", "DictDialogAgentNode"], [73, 1, 1, "", "ForLoopPipelineNode"], [73, 1, 1, "", "GoogleSearchServiceNode"], [73, 1, 1, "", "IfElsePipelineNode"], [73, 1, 1, "", "ModelNode"], [73, 1, 1, "", "MsgHubNode"], [73, 1, 1, "", "MsgNode"], [73, 1, 1, "", "PlaceHolderNode"], [73, 1, 1, "", "PythonServiceNode"], [73, 1, 1, "", "ReActAgentNode"], [73, 1, 1, "", "ReadTextServiceNode"], [73, 1, 1, "", "SequentialPipelineNode"], [73, 1, 1, "", "SwitchPipelineNode"], [73, 1, 1, "", "TextToImageAgentNode"], [73, 1, 1, "", "UserAgentNode"], [73, 1, 1, "", "WhileLoopPipelineNode"], [73, 1, 1, "", "WorkflowNode"], [73, 1, 1, "", "WorkflowNodeType"], [73, 1, 1, "", "WriteTextServiceNode"], [73, 4, 1, "", "get_all_agents"]], "agentscope.web.workstation.workflow_node.BingSearchServiceNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.CopyNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.DialogAgentNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.DictDialogAgentNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.ForLoopPipelineNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.GoogleSearchServiceNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.IfElsePipelineNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.ModelNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.MsgHubNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.MsgNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.PlaceHolderNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.PythonServiceNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.ReActAgentNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.ReadTextServiceNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.SequentialPipelineNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.SwitchPipelineNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.TextToImageAgentNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.UserAgentNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.WhileLoopPipelineNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.WorkflowNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_node.WorkflowNodeType": [[73, 5, 1, "", "AGENT"], [73, 5, 1, "", "COPY"], [73, 5, 1, "", "MESSAGE"], [73, 5, 1, "", "MODEL"], [73, 5, 1, "", "PIPELINE"], [73, 5, 1, "", "SERVICE"]], "agentscope.web.workstation.workflow_node.WriteTextServiceNode": [[73, 2, 1, "", "__init__"], [73, 2, 1, "", "compile"], [73, 5, 1, "", "node_type"]], "agentscope.web.workstation.workflow_utils": [[74, 4, 1, "", "deps_converter"], [74, 4, 1, "", "dict_converter"], [74, 4, 1, "", "is_callable_expression"], [74, 4, 1, "", "kwarg_converter"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "property", "Python property"], "4": ["py", "function", "Python function"], "5": ["py", "attribute", "Python attribute"], "6": ["py", "exception", "Python exception"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:property", "4": "py:function", "5": "py:attribute", "6": "py:exception"}, "terms": {"": [0, 1, 2, 3, 4, 6, 7, 8, 9, 15, 16, 18, 22, 25, 34, 36, 57, 72, 73, 74, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91], "0": [10, 20, 21, 26, 28, 29, 34, 55, 59, 62, 65, 73, 80, 81, 84], "001": [16, 19, 84], "002": [79, 84], "03": [16, 19, 87], "03629": [1, 6], "04": 87, "1": [10, 12, 14, 16, 18, 19, 21, 23, 26, 28, 29, 34, 37, 45, 47, 53, 57, 65, 73, 79, 81, 84], "10": [1, 6, 34, 57, 85, 88], "100": [34, 49, 50, 84], "1000": 88, "120": [34, 56], "12001": 89, "123": [21, 84], "127": [65, 81], "1800": [1, 2, 7], "2": [16, 19, 21, 29, 34, 37, 45, 57, 73, 84], "20": 88, "200": 29, "2024": [16, 19, 87], "2048": [16, 23], "21": [16, 19], "22": 87, "2210": [1, 6], "3": [1, 4, 16, 20, 23, 29, 34, 56, 69, 73, 78, 79, 82, 84, 85], "30": [16, 23, 62], "300": [30, 31, 34, 36], "3306": [34, 50], "4": [73, 79, 84, 87, 88], "5": [20, 34, 58, 73, 79, 82, 84], "5000": [65, 81], "512x512": 84, "5m": [16, 21, 84], "6": 80, "80": 89, "8192": [1, 2, 7], "9": 78, "A": [0, 1, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16, 19, 21, 23, 24, 25, 26, 27, 28, 30, 31, 33, 34, 36, 41, 43, 44, 45, 49, 50, 51, 55, 56, 57, 59, 60, 62, 71, 72, 73, 79, 80, 85, 86, 89, 91], "AND": [34, 55], "AS": 67, "And": 82, "As": [29, 80, 82, 86], "At": [85, 89], "By": [80, 81, 89], "For": [1, 4, 7, 15, 16, 18, 20, 34, 55, 57, 58, 59, 62, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 93], "If": [0, 1, 4, 7, 12, 14, 16, 18, 19, 22, 29, 34, 36, 43, 46, 53, 58, 60, 71, 72, 78, 79, 80, 82, 84, 85, 86, 87, 88, 90, 91], "In": [0, 12, 14, 15, 16, 18, 19, 21, 22, 23, 25, 77, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 91], "It": [1, 4, 9, 15, 16, 18, 34, 36, 57, 61, 73, 75, 77, 80, 82, 83, 84, 86, 87, 88, 89, 94], "NOT": [34, 37], "No": 80, "OR": [34, 55], "On": 78, "One": [0, 25], "Or": 83, "Such": 87, "The": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 34, 36, 37, 39, 40, 41, 43, 45, 46, 49, 50, 51, 53, 55, 56, 57, 58, 59, 60, 61, 62, 72, 73, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89], "Then": [82, 89], "These": [80, 83, 85, 86, 87], "To": [21, 78, 79, 80, 81, 82, 83, 84, 85, 87, 88, 91], "Will": 92, "With": [16, 18, 29, 77, 80, 91], "_": [7, 26, 27, 28, 80], "__": [26, 27, 28], "__call__": [1, 5, 16, 19, 20, 82, 83, 84], "__delattr__": 86, "__getattr__": [85, 86], "__getitem__": 85, "__init__": [1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 33, 34, 46, 59, 62, 72, 73, 82, 84, 85, 86], "__name__": [82, 85], "__setattr__": [85, 86], "__setitem__": 85, "__type": 86, "_client": 15, "_default_monitor_table_nam": 62, "_default_system_prompt": [34, 53], "_default_token_limit_prompt": [34, 53], "_get_pric": 88, "_get_timestamp": 86, "_host": 15, "_is_placehold": 15, "_messag": 30, "_port": 15, "_stub": 15, "_task_id": 15, "_upb": 30, "ab": [1, 6, 34, 55], "abc": [1, 5, 12, 13, 16, 18, 19, 21, 22, 23, 59, 62, 73, 86], "abil": 80, "abl": 77, "about": [16, 18, 19, 72, 75, 79, 82, 84, 88, 90, 92, 94, 95], "abov": [16, 18, 19, 59, 62, 79, 80, 85, 87, 88, 89], "abstract": [1, 5, 12, 13, 59, 62, 73, 77, 82, 86], "abstractmethod": 83, "accept": [15, 29, 86, 87], "access": 86, "accident": [34, 50, 51], "accommod": [1, 2, 7, 15, 77], "accord": [29, 84, 87, 89, 91], "accordingli": 79, "account": [34, 50], "accumul": [59, 62], "achiev": [1, 6, 80, 87], "across": 83, "act": [1, 6, 16, 24, 27, 34, 57, 73, 80, 82, 83, 87], "action": [1, 2, 7, 8, 69, 72, 77, 80, 83], "activ": 78, "actor": [75, 77, 94], "actual": [0, 7, 25, 26, 27, 28, 79, 89], "acycl": 72, "ad": [1, 3, 4, 9, 12, 13, 14, 72, 82, 85, 86, 87, 91], "ada": [79, 84], "adapt": 87, "add": [12, 13, 14, 25, 59, 62, 72, 80, 81, 82, 83, 85, 86, 87, 88, 91], "add_as_nod": 72, "add_rpcagentservicer_to_serv": [30, 33], "addit": [1, 9, 34, 36, 53, 57, 60, 77, 78, 80, 82, 85, 89, 91], "addition": [79, 83, 86], "address": [15, 34, 49, 50, 82, 89, 91], "adjust": [82, 88], "admit": 15, "advanc": [16, 18, 77, 79, 80, 87], "adventur": 80, "adversari": [1, 2, 7, 8], "after": [7, 20, 21, 34, 53, 79, 80, 84, 89], "again": 91, "against": 77, "agent": [0, 12, 13, 14, 15, 16, 24, 25, 26, 27, 28, 30, 31, 33, 34, 45, 53, 57, 69, 73, 75, 78, 81, 83, 84, 85, 86, 87, 88, 90, 92, 94, 95], "agent1": [0, 25, 80, 83], "agent2": [0, 25, 80, 83], "agent3": [0, 25, 80, 83], "agent4": [80, 83], "agent5": 83, "agent_arg": [1, 7], "agent_class": [1, 7, 89], "agent_config": [0, 1, 7, 30, 31, 80], "agent_id": [1, 2, 7, 30, 31], "agent_kwarg": [1, 7, 89], "agenta": 89, "agentb": 89, "agentbas": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 25, 80, 83, 85, 89, 92], "agentpool": 92, "agentscop": [79, 81, 82, 83, 84, 85, 86, 87, 89, 92, 93, 95], "agre": 80, "agreement": [1, 4, 77, 80], "ai": [16, 19, 34, 53, 79, 82], "aim": 80, "al": 12, "alert": [59, 62], "algorithm": [1, 6, 82], "alic": [79, 87], "align": [16, 24, 87], "aliv": 80, "aliyun": [16, 18], "all": [0, 1, 2, 9, 12, 13, 14, 16, 18, 19, 20, 25, 26, 28, 30, 34, 39, 53, 55, 59, 62, 65, 73, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89], "alloc": 80, "allow": [16, 18, 19, 21, 22, 23, 34, 36, 50, 51, 73, 77, 80, 82, 83, 84, 85, 86, 87, 88, 89, 90], "allow_change_data": [34, 50, 51], "alon": 80, "along": 60, "alreadi": [34, 40, 41, 62, 73, 78, 85, 88, 91], "also": [1, 9, 15, 16, 18, 19, 21, 22, 23, 80, 81, 83, 84, 85, 86, 89, 90], "altern": [16, 18, 19, 78, 87], "among": [0, 25, 26, 28, 80, 83, 84], "amount": 88, "an": [1, 2, 4, 5, 6, 7, 8, 15, 16, 18, 20, 23, 26, 28, 30, 31, 34, 36, 37, 39, 40, 41, 53, 57, 59, 60, 62, 68, 69, 73, 75, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 94], "analog": 77, "analys": [34, 58], "andnot": [34, 55], "ani": [1, 4, 9, 15, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 34, 37, 39, 40, 41, 43, 45, 46, 49, 50, 51, 57, 58, 60, 61, 72, 73, 82, 83, 85, 86, 87, 90, 91], "annot": 85, "announc": [0, 25, 73, 80, 83], "anoth": [34, 57, 73, 80, 82, 83, 85, 89], "answer": 77, "api": [0, 15, 16, 18, 19, 20, 21, 22, 23, 34, 45, 53, 55, 57, 63, 64, 77, 79, 82, 85, 86, 87], "api_cal": 88, "api_kei": [16, 18, 19, 20, 22, 34, 57, 79, 80, 84, 85], "api_token": 20, "api_url": [16, 20, 23, 84], "appli": [86, 89], "applic": [68, 69, 71, 75, 77, 78, 79, 81, 82, 83, 87, 88, 90, 94, 95], "approach": [79, 83], "ar": [1, 2, 6, 7, 8, 12, 13, 14, 15, 16, 18, 19, 20, 26, 27, 28, 29, 34, 36, 37, 45, 53, 58, 60, 72, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91], "arbitrari": 87, "architectur": [77, 82], "arg": [1, 2, 3, 4, 6, 7, 8, 9, 16, 18, 19, 20, 21, 22, 23, 24, 29, 72, 80, 82, 83, 85, 86], "argument": [0, 1, 2, 6, 15, 16, 18, 19, 21, 22, 23, 25, 29, 34, 36, 45, 46, 57, 71, 72, 85], "arrow": 89, "arxiv": [1, 6, 34, 85], "arxiv_search": [34, 55, 85], "asdigraph": 72, "ask": [85, 90, 93], "asp": [34, 57], "asr": 69, "assign": [80, 81, 86], "assist": [1, 6, 15, 16, 18, 29, 79, 82, 86, 87, 90], "associ": [30, 33, 72, 80, 88], "assum": [34, 57, 80, 88], "attach": [16, 18, 79, 86], "attempt": [60, 80], "attribut": [12, 14, 15, 82, 86], "attribute_nam": 86, "attributeerror": 86, "au": [34, 55], "audienc": [1, 2, 9, 83], "audio": [15, 68, 69, 77, 79, 82, 84, 86, 87], "audio2text": 69, "audio_path": 69, "audio_term": 68, "authent": [34, 57, 85], "author": [20, 34, 55, 84], "auto": 7, "automat": [7, 34, 45, 77, 80, 84, 85, 86, 88, 89], "autonom": [77, 80], "auxiliari": 77, "avail": [7, 19, 34, 36, 60, 69, 79, 82, 83, 85, 89, 90], "avatar": 69, "avoid": [34, 49, 50, 51, 73, 88, 89], "b": [29, 34, 44, 45, 85, 89, 91], "back": 89, "background": 89, "base": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 45, 46, 47, 59, 62, 69, 71, 72, 73, 75, 77, 80, 82, 83, 84, 85, 86, 87, 88, 89, 94], "bash": [34, 37], "basic": [16, 19, 21, 79, 80, 86], "batch": 88, "bearer": [20, 84], "becom": 90, "been": [7, 73, 91], "befor": [16, 34, 53, 69, 78, 80, 86, 88, 89], "begin": [0, 16, 19, 25, 80, 87, 88], "beginn": 87, "behalf": [34, 57], "behavior": [1, 5, 80, 82, 86], "being": [7, 30, 31, 34, 36, 72, 80, 88], "below": [80, 82, 83, 87, 89, 90], "besid": [80, 82, 86], "best": 87, "better": [12, 14, 15, 16, 19, 79, 81, 91], "between": [12, 14, 16, 18, 23, 24, 34, 44, 72, 77, 79, 80, 81, 83, 85, 86, 87, 89], "bin": 78, "bing": [34, 57, 73, 85], "bing_api_kei": [34, 57], "bing_search": [34, 57, 85], "bingsearchservicenod": 73, "blob": [36, 60], "block": [29, 60, 80, 83], "bob": [16, 18, 79, 87], "bodi": [26, 27, 28], "bomb": 36, "bool": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 26, 27, 28, 34, 36, 40, 41, 43, 45, 50, 51, 58, 59, 60, 62, 65, 69, 73, 74, 82, 85, 86], "boolean": [12, 14, 34, 39, 40, 41, 55, 60, 85], "borrow": 60, "bot": 82, "both": [12, 13, 14, 29, 34, 36, 77, 87, 88, 89, 91], "box": 80, "branch": [27, 83], "break": [26, 27, 28, 79, 80, 83], "break_condit": 83, "break_func": [26, 27, 28], "breviti": [82, 83, 85, 86], "bridg": [16, 24], "brief": 91, "broadcast": [0, 25, 73, 80], "brows": [34, 57], "budget": [16, 22, 59, 62, 84], "buffer": 32, "bug": [90, 93], "build": [16, 19, 72, 75, 77, 79, 80, 82, 87, 92, 94], "build_dag": 72, "built": [34, 53, 77, 80, 81, 82, 92], "bulk": 86, "busi": [34, 57], "byte": [34, 36], "c": [34, 45, 85, 89], "calcul": 88, "call": [1, 2, 6, 7, 15, 16, 18, 19, 20, 22, 23, 30, 31, 34, 45, 59, 62, 72, 73, 79, 80, 81, 82, 83, 84, 85, 86, 88, 89], "call_credenti": 33, "call_func": [7, 30, 31, 33], "call_in_thread": [30, 31], "callabl": [1, 4, 5, 12, 13, 14, 16, 24, 26, 27, 28, 34, 43, 45, 58, 68, 72, 74, 86], "can": [0, 1, 2, 3, 4, 6, 7, 9, 12, 14, 15, 16, 18, 19, 20, 21, 29, 34, 36, 45, 72, 73, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91], "capabl": [75, 77, 80, 85, 94], "capac": [34, 57], "captur": [34, 36, 81], "care": [34, 37], "carrier": [77, 86], "case": [26, 28, 73, 80, 82], "case1": 83, "case2": 83, "case_oper": [26, 27, 28, 83], "cat": [34, 37, 55, 87], "catch": 60, "categor": [77, 83], "categori": 84, "caus": [16, 18], "cd": [34, 37, 78, 80, 91], "central": [75, 77, 78, 89, 94], "centric": 77, "certain": [12, 13, 59, 62, 72, 88], "challeng": 92, "chanc": 80, "chang": [1, 8, 34, 37, 50, 51, 60, 77, 88], "channel": [30, 33, 77], "channel_credenti": 33, "charact": [80, 87], "characterist": 82, "chart": 89, "chat": [15, 16, 18, 19, 21, 22, 23, 61, 63, 68, 69, 79, 80, 83, 84, 86, 87, 90], "chatbot": [68, 87], "chdir": 60, "check": [7, 34, 36, 58, 60, 69, 71, 74, 80, 82, 88, 91], "check_and_delete_ag": 7, "check_and_generate_ag": 7, "check_port": 7, "check_uuid": 69, "check_win": 80, "checkout": 91, "chemic": [34, 57], "child": 7, "choic": 80, "choos": [77, 79, 80], "chosen": [1, 3, 4, 80], "class": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 33, 34, 45, 46, 47, 59, 62, 72, 73, 80, 82, 83, 84, 85, 88, 89, 92], "classmethod": [1, 2, 16, 20, 24, 34, 45, 59, 62], "clean": [12, 13, 14, 72], "clear": [12, 13, 14, 16, 59, 62, 83, 86, 88, 91], "clear_audi": [1, 2], "clear_exist": 16, "clear_model_config": 16, "clearer": 81, "click": 81, "client": [1, 7, 15, 16, 22, 30, 31, 33, 84], "client_arg": [16, 20, 22, 84], "clone": [1, 7, 78], "clone_inst": [1, 7], "cloud": [16, 19], "clspipelin": 83, "co": [34, 55], "code": [0, 1, 2, 3, 4, 11, 16, 24, 25, 32, 34, 36, 58, 59, 60, 62, 71, 72, 73, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 95], "codebas": 93, "coher": [82, 86], "collabor": [83, 90], "collect": [34, 49, 73, 82, 85], "color": 81, "com": [15, 16, 18, 19, 21, 34, 36, 55, 57, 60, 78, 85, 86, 87, 91], "combin": [16, 19, 29, 87], "come": [80, 82, 85], "command": [1, 7, 34, 37, 69, 71, 78], "comment": [30, 33], "common": 5, "commun": [75, 79, 80, 83, 89, 91, 93, 94], "compar": [34, 43, 83, 91], "compat": [16, 23, 77, 87], "compatilbl": [16, 23], "compil": [72, 73], "compile_workflow": 71, "compiled_filenam": [71, 72], "complet": [85, 89], "completion_token": 88, "complex": [77, 79, 82, 83, 89], "compli": 71, "complianc": 88, "complic": 77, "compon": [29, 75, 77, 80, 94], "compos": 82, "comprehens": 82, "compress": 33, "compris": [77, 79], "comput": [12, 14, 34, 44, 72, 77, 82, 85], "concept": [80, 83, 89, 95], "concis": 91, "concret": 86, "condit": [26, 27, 28, 73, 80, 83], "condition_func": [26, 27, 28], "condition_oper": [26, 28], "conduit": 83, "confid": [34, 36], "config": [0, 1, 2, 3, 4, 6, 8, 12, 13, 14, 16, 18, 20, 22, 71, 72, 79], "config_nam": [16, 18, 19, 20, 21, 22, 23, 79, 80, 84, 87], "config_path": 71, "configur": [1, 2, 3, 4, 6, 8, 12, 13, 14, 16, 18, 19, 20, 21, 22, 23, 71, 72, 73, 79, 80, 82, 92], "connect": [15, 30, 31, 62, 72, 77, 89, 90], "consid": 80, "consider": [16, 19], "consist": [80, 81, 82, 86], "constraint": [16, 19, 87], "construct": [15, 72, 80, 82, 83, 85, 86, 92], "constructor": [30, 33, 34, 46, 84, 85], "consum": 89, "contain": [0, 1, 4, 6, 9, 16, 20, 21, 24, 26, 27, 28, 34, 36, 37, 39, 40, 41, 49, 50, 51, 53, 56, 60, 71, 72, 85, 87, 89], "content": [1, 2, 9, 15, 16, 18, 21, 34, 39, 40, 41, 46, 53, 55, 57, 58, 60, 61, 63, 77, 79, 80, 81, 82, 85, 86, 87, 89], "context": [29, 30, 33, 60, 82, 83, 86, 91], "contextmanag": 60, "continu": [26, 27, 28, 77, 79, 80, 82, 83, 87, 88], "contribut": [75, 90, 93, 94], "control": [21, 26, 27, 28, 75, 80, 83, 84, 89, 94], "conveni": 80, "convers": [14, 16, 19, 34, 45, 80, 81, 82, 84, 87, 95], "convert": [1, 2, 6, 8, 29, 64, 68, 69, 74, 82, 85, 87, 89], "cookbook": [15, 86], "copi": 73, "copynod": 73, "core": [77, 80, 82, 83], "cornerston": 82, "correspond": [26, 27, 28, 33, 34, 49, 77, 79, 80, 84, 89], "cos_sim": [34, 44, 85], "cosin": [34, 44, 85], "cost": [88, 89], "could": [34, 57, 87], "count": [63, 88], "count_openai_token": 63, "counterpart": 27, "cover": 0, "covnert": [34, 45], "cpu": 84, "craft": [75, 82, 87, 94, 95], "creat": [0, 1, 7, 15, 25, 30, 31, 34, 39, 60, 73, 80, 82, 85, 86, 87, 92, 95], "create_ag": [30, 31], "create_directori": [34, 39, 85], "create_fil": [34, 39, 85], "create_tempdir": 60, "create_with_agent_config": [1, 7], "creation": 86, "criteria": [85, 86], "critic": [0, 59, 61, 81, 86, 87], "crucial": [80, 81, 88], "cse": [34, 57], "cse_id": [34, 57], "curat": 82, "current": [1, 2, 3, 4, 15, 26, 27, 28, 34, 36, 37, 39, 53, 59, 60, 62, 84, 85, 86, 88], "cursor": 62, "custom": [34, 57, 69, 75, 77, 79, 80, 81, 84, 86, 87, 92, 94], "cycle_dot": 69, "d": 89, "dag": [72, 77], "dai": 80, "dall": [16, 22, 84], "dall_": 23, "dashscop": [16, 18, 87], "dashscope_chat": [16, 18, 84], "dashscope_image_synthesi": [16, 18, 84], "dashscope_multimod": [16, 18, 84], "dashscope_text_embed": [16, 18, 84], "dashscopechatwrapp": [16, 18, 84], "dashscopeimagesynthesiswrapp": [16, 18, 84], "dashscopemultimodalwrapp": [16, 18, 84], "dashscopetextembeddingwrapp": [16, 18, 84], "dashscopewrapperbas": [16, 18], "data": [1, 3, 4, 9, 13, 16, 24, 30, 31, 34, 40, 43, 50, 51, 60, 68, 72, 73, 77, 82, 83, 86, 87], "databas": [34, 49, 50, 51, 85], "date": [16, 18, 90], "daytim": 80, "db": [59, 62], "db_path": [59, 62], "dead_nam": 80, "dead_play": 80, "death": 80, "debug": [0, 59, 61, 65, 80, 81], "decid": [16, 19, 80, 87], "decis": [15, 16, 19], "decod": [1, 4], "decor": 7, "decoupl": [79, 84], "deduc": 80, "deduct": 80, "deep": [34, 55], "deeper": 80, "def": [15, 34, 45, 80, 82, 83, 84, 85, 86], "default": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 34, 36, 41, 43, 49, 50, 51, 53, 55, 56, 57, 59, 61, 62, 69, 72, 73, 77, 82, 85, 86, 88, 89], "default_ag": 83, "default_oper": [26, 27, 28], "default_respons": [1, 4], "defer": 82, "defin": [1, 2, 5, 7, 8, 33, 34, 43, 45, 72, 79, 82, 83, 85, 86, 88], "definit": [34, 57, 77, 86], "del": 86, "delet": [7, 12, 13, 14, 25, 30, 31, 34, 39, 62, 80, 85, 86], "delete_ag": [30, 31], "delete_directori": [34, 39, 85], "delete_fil": [34, 39, 85], "delv": 80, "demand": 82, "demonstr": [80, 82], "denot": 86, "dep_opt": 73, "dep_var": 74, "depend": [12, 13, 14, 34, 55, 57, 72, 77, 78, 89], "deploi": [16, 23, 79, 89], "deploy": [77, 79, 84, 89], "deprec": 92, "deprecated_model_typ": [16, 18, 22, 23], "deps_convert": 74, "depth": 82, "deriv": 82, "describ": [34, 45, 80, 83], "descript": [1, 6, 34, 45, 58, 82, 83, 85, 91], "descriptor": 30, "deseri": 15, "design": [1, 5, 12, 13, 14, 25, 73, 75, 79, 80, 81, 82, 83, 87, 89, 94, 95], "desir": [29, 87], "destin": [34, 39], "destination_path": [34, 39], "destruct": 36, "detail": [1, 6, 9, 16, 18, 24, 34, 57, 79, 80, 81, 82, 85, 86, 88, 89, 91], "determin": [7, 26, 27, 28, 34, 36, 59, 62, 80, 86], "dev": 91, "develop": [1, 6, 16, 18, 29, 34, 45, 57, 75, 77, 78, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 94], "dialog": [1, 2, 3, 4, 7, 8, 15, 25, 29, 77, 79, 83, 86], "dialog_ag": 79, "dialog_agent_config": 82, "dialogag": [1, 3, 73, 79], "dialogagentnod": 73, "dialogu": [1, 3, 4, 16, 18, 77, 81, 82, 83, 87], "dict": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 40, 43, 45, 46, 49, 57, 58, 59, 60, 61, 62, 64, 69, 71, 72, 73, 74, 77, 79, 82, 83, 85, 86, 87], "dict_convert": 74, "dictat": 80, "dictdialogag": [1, 4, 73, 80, 82], "dictdialogagentnod": 73, "dictionari": [1, 3, 4, 6, 9, 16, 22, 26, 27, 28, 34, 45, 55, 57, 59, 60, 62, 69, 71, 72, 74, 79, 84, 85, 86, 87], "did": 91, "differ": [1, 6, 7, 16, 19, 20, 24, 29, 34, 44, 49, 73, 75, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 94], "difficult": 87, "digest": [34, 58, 85], "digest_prompt": [34, 58], "digest_webpag": [34, 58, 85], "digraph": 72, "dingtalk": 93, "dir": 0, "direcotri": [34, 39], "direct": [72, 73, 86], "directli": [34, 36, 45, 78, 84, 85, 86, 87, 88], "directori": [0, 1, 9, 34, 37, 39, 40, 41, 59, 60, 61, 80, 84, 85], "directory_path": [34, 39], "disabl": [34, 36], "discord": 93, "discuss": [16, 19, 80, 90, 91], "disguis": 80, "disk": [12, 14], "displai": [34, 36, 69], "distinct": [73, 80, 82], "distinguish": [59, 62, 84, 86, 87, 89], "distribut": [1, 2, 16, 18, 19, 21, 22, 23, 75, 77, 78, 92, 94], "div": [34, 58], "dive": 80, "divers": [77, 82, 91], "divid": [80, 84], "do": [26, 27, 28, 34, 37, 57, 78, 80, 81, 83, 89], "doc": [16, 19, 77], "docker": [34, 36, 85], "docstr": [34, 45, 85], "document": [30, 33, 77, 85, 91], "doe": [26, 27, 28, 60, 86], "doesn": [1, 2, 7, 8, 12, 14], "dog": 87, "don": [59, 62, 80, 86, 89], "dot": 69, "download": [21, 34, 85], "download_from_url": [34, 56, 85], "drop_exist": 62, "dump": [85, 86], "duplic": [72, 73], "dure": [80, 85, 86], "dynam": [80, 82, 83], "e": [1, 4, 15, 16, 18, 19, 20, 21, 22, 23, 34, 36, 37, 39, 45, 46, 50, 77, 78, 79, 80, 84, 85, 86, 87, 88, 89, 91], "each": [0, 1, 6, 16, 18, 19, 20, 21, 22, 23, 25, 34, 57, 72, 77, 79, 82, 83, 85, 86, 87, 88, 89, 91], "eas": [75, 77, 83, 87, 94], "easi": [0, 25, 75, 94], "easili": [78, 80, 83, 89], "echo": [15, 86], "edg": 72, "edit": [34, 37, 78], "effect": [0, 1, 7, 25, 34, 57, 59, 62], "effici": 77, "effort": [77, 82], "either": [16, 19, 34, 37, 57, 79, 80, 86, 87], "eleg": [0, 25], "element": [34, 36, 43, 58, 72, 87], "elementari": 77, "elif": 83, "elimin": 80, "els": [26, 27, 28, 73, 80, 83, 85, 86], "else_body_oper": [26, 27, 28], "emb": [12, 14, 34, 43], "embed": [12, 14, 16, 18, 19, 21, 22, 24, 34, 43, 44, 79, 84, 85, 86], "embedding_model": [12, 14, 34, 43], "empow": [75, 77, 87, 94], "empti": [16, 21, 34, 45, 58, 60, 68, 72, 85, 87], "en": [34, 57, 85], "enabl": [73, 75, 77, 82, 83, 86, 87, 88, 94], "encapsul": [1, 7, 9, 16, 24, 29, 82, 83, 87], "encoding_format": 84, "encount": [81, 90], "encourag": [1, 6, 15, 16, 18], "end": [16, 19, 72, 80, 87], "endow": [80, 82], "enforc": 88, "engag": [82, 90], "engin": [1, 6, 16, 18, 29, 34, 57, 72, 75, 77, 82, 84, 92, 94], "enhanc": [75, 81, 85, 94], "enrich": 82, "ensembl": 82, "ensur": [77, 80, 82, 83, 88], "entir": 89, "entiti": 77, "entri": [0, 68], "enum": [10, 29, 34, 47, 55, 57, 73], "environ": [1, 2, 7, 8, 16, 19, 22, 34, 36, 77, 79, 80, 83, 84, 95], "environment": 83, "equal": 80, "equip": 82, "equival": 85, "error": [0, 16, 24, 34, 36, 37, 39, 40, 41, 46, 47, 49, 50, 51, 53, 55, 56, 57, 59, 60, 61, 81, 85, 91], "error_info": [16, 24], "especi": [34, 36, 87, 88], "essenti": [79, 82, 86], "etc": [34, 36, 46, 57, 85], "eval": [36, 60], "evalu": [72, 73, 83], "even": 80, "event": [7, 68, 80], "eventclass": 7, "eventdata": 68, "everi": 80, "everyon": 90, "exactli": 89, "exampl": [0, 1, 4, 6, 15, 16, 18, 20, 25, 29, 34, 45, 53, 55, 57, 58, 77, 79, 80, 83, 84, 86, 87, 88, 89, 91, 92], "exce": [1, 9, 34, 36, 53, 59, 62, 88], "exceed": [7, 59, 62, 88], "except": [16, 23, 24, 59, 60, 62, 69, 77, 85, 86, 88], "exchang": 77, "exec_nod": 72, "execut": [1, 5, 6, 26, 27, 28, 34, 36, 37, 46, 47, 49, 50, 51, 56, 57, 60, 72, 73, 77, 79, 80, 83, 85, 89], "execute_func": [1, 6], "execute_python_cod": [34, 36, 85], "execute_shell_command": [34, 37], "exert": [34, 57], "exeuct": [26, 27], "exist": [7, 16, 18, 34, 40, 41, 58, 59, 60, 62, 82, 83, 86, 88], "existing_ag": 83, "exit": [79, 83, 89], "expand": 82, "expect": [34, 43, 81, 87], "expedit": 82, "experi": [81, 90], "experiment": 88, "expir": 7, "explain": 91, "explanatori": [34, 45, 85], "explicitli": [34, 57], "explor": 80, "export": [12, 13, 14, 86], "export_config": [1, 2], "express": [59, 62, 72, 74], "extend": [1, 7, 72, 83, 86], "extens": [77, 82], "extern": [86, 88], "extra": [16, 18, 21, 22], "extract": [1, 4, 16, 20, 34, 45, 58, 73, 85], "extract_name_and_id": 80, "ey": [80, 91], "f": [82, 85, 86, 88, 89], "facilit": [83, 86], "factori": [34, 45, 59, 62], "fail": [1, 4, 16, 23, 24, 60], "failur": 85, "fals": [0, 1, 7, 9, 12, 13, 14, 15, 16, 26, 27, 28, 33, 34, 36, 40, 41, 50, 51, 58, 60, 62, 65, 69, 73, 80, 83, 86, 89], "fastchat": [16, 23, 80, 84], "fault": [1, 4, 75, 77, 94], "fault_handl": [1, 4], "featur": [75, 77, 81, 88, 89, 90, 93, 94], "fed": 84, "feed": [16, 24, 34, 53, 58], "feedback": 91, "feel": [80, 91], "fetch": 88, "few": 80, "field": [1, 4, 9, 16, 19, 21, 24, 34, 58, 77, 79, 84, 85, 86, 87], "figur": [16, 18], "figure1": [16, 18], "figure2": [16, 18], "figure3": [16, 18], "file": [0, 1, 9, 11, 12, 13, 14, 15, 16, 18, 20, 30, 33, 34, 36, 37, 56, 58, 59, 60, 61, 62, 69, 71, 77, 79, 80, 82, 84, 85, 86, 87], "file_path": [12, 13, 14, 34, 39, 40, 41, 60, 85, 86], "filenotfounderror": 71, "filepath": [34, 56], "filesystem": 36, "fill": [34, 58, 85, 87], "filter": [12, 13, 14, 59, 62, 86, 88], "filter_func": [12, 13, 14, 86], "filter_regex": [59, 62], "final": [72, 82, 87], "find": [34, 37, 49, 84, 85, 87, 89, 91], "find_available_port": 7, "fine": 81, "first": [16, 18, 21, 25, 34, 55, 59, 62, 72, 75, 78, 86, 87, 89, 91, 94, 95], "firstli": 80, "fit": [1, 6, 82, 87], "fix": [90, 91], "flag": 80, "flask": 84, "flexibl": [77, 79, 82], "flexibli": 87, "float": [12, 14, 16, 22, 34, 36, 43, 44, 59, 60, 62, 84], "flow": [26, 27, 28, 73, 79, 80, 81, 83], "flush": [59, 62, 69], "fn_choic": 68, "focus": [88, 91], "follow": [0, 1, 4, 6, 15, 16, 18, 19, 20, 21, 23, 25, 26, 28, 29, 34, 53, 57, 59, 61, 62, 78, 79, 80, 81, 84, 85, 86, 87, 88, 89], "forc": [34, 57], "fork": 36, "forlooppipelin": [26, 27, 28], "forlooppipelinenod": 73, "form": [85, 86], "format": [1, 3, 4, 6, 9, 10, 15, 16, 18, 19, 20, 21, 22, 23, 24, 29, 34, 36, 45, 53, 59, 62, 63, 80, 81, 82, 85, 86, 91], "format_map": [29, 80, 87], "formul": 15, "forward": [16, 21], "found": [6, 7, 16, 19, 71, 73, 80], "foundat": 82, "fragment": [12, 13, 14], "framework": 15, "free": [80, 91], "from": [1, 2, 3, 4, 6, 8, 12, 13, 14, 15, 16, 19, 20, 21, 22, 25, 29, 34, 36, 37, 39, 43, 45, 49, 55, 56, 57, 58, 59, 60, 62, 68, 69, 72, 73, 77, 79, 80, 83, 85, 86, 87, 88, 89, 91, 92], "fulfil": 77, "full": 62, "func": [7, 34, 45, 85], "func_cal": [1, 6], "func_intro": 85, "func_nam": [30, 31], "funcpipelin": 83, "function": [1, 2, 3, 4, 6, 7, 12, 14, 15, 16, 18, 19, 20, 24, 26, 28, 29, 30, 31, 34, 36, 43, 44, 45, 49, 53, 58, 59, 60, 62, 68, 71, 72, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 92], "function_nam": [68, 85], "fundament": [77, 82], "further": 85, "furthermor": 77, "futur": [34, 49, 81, 92], "g": [1, 4, 15, 16, 18, 19, 20, 21, 22, 23, 34, 36, 37, 45, 46, 50, 77, 79, 80, 84, 85, 87, 88], "gain": 80, "game_werewolf": [1, 4, 80], "gather": 82, "gemini": [16, 19, 79, 87], "gemini_api_kei": 84, "gemini_chat": [16, 19, 84], "gemini_embed": [16, 19, 84], "geminichatwrapp": [16, 19, 84], "geminiembeddingwrapp": [16, 19, 84], "geminiwrapperbas": [16, 19], "gener": [1, 2, 3, 4, 7, 9, 15, 16, 18, 19, 21, 22, 32, 34, 36, 45, 60, 62, 68, 69, 71, 73, 77, 79, 81, 82, 84, 85, 86, 87, 89], "generate_agent_id": [1, 2], "generate_arg": [16, 18, 20, 22, 80, 84], "generate_cont": [16, 19], "generate_image_from_nam": 69, "generatecont": [16, 19], "generation_method": [16, 19], "get": [7, 12, 14, 15, 16, 20, 30, 31, 34, 39, 45, 59, 60, 62, 63, 69, 77, 85, 91], "get_all_ag": 73, "get_chat": 68, "get_chat_msg": 69, "get_current_directori": [34, 39], "get_embed": [12, 14, 86], "get_full_nam": [62, 88], "get_help": 34, "get_memori": [12, 13, 14, 29, 82, 86], "get_metr": [59, 62, 88], "get_monitor": [59, 62, 88], "get_openai_max_length": 63, "get_player_input": 69, "get_quota": [59, 62, 88], "get_reset_msg": 69, "get_respons": [30, 31], "get_task_id": 7, "get_unit": [59, 62, 88], "get_valu": [59, 62, 88], "get_wrapp": [16, 20], "git": [78, 91], "github": [16, 19, 36, 55, 60, 78, 91, 93], "give": 80, "given": [1, 2, 6, 7, 8, 16, 18, 20, 25, 29, 34, 37, 55, 56, 57, 58, 60, 68, 69, 71, 72, 73, 82, 83, 85, 87], "glanc": 80, "global": 68, "go": 82, "goal": 87, "gone": 81, "good": 80, "googl": [16, 19, 30, 34, 45, 57, 73, 79, 85], "google_search": [34, 57, 85], "googlesearchservicenod": 73, "govern": [34, 57], "gpt": [20, 79, 80, 82, 84, 87, 88], "graph": [72, 77], "grasp": 80, "greater": 80, "grep": [34, 37], "group": [0, 25, 34, 57, 80, 83, 90], "growth": 90, "grpc": [1, 7, 30, 33], "guid": [80, 81, 82], "h": [34, 58], "ha": [0, 1, 2, 3, 4, 7, 8, 16, 18, 25, 34, 36, 43, 57, 80, 81, 82, 87, 89, 91], "handl": [1, 4, 34, 45, 60, 68, 73, 80, 83, 85, 86, 87], "hard": [1, 2, 3, 4, 12, 14], "hardwar": 60, "hash": 69, "hasn": 80, "have": [12, 14, 16, 18, 19, 61, 73, 78, 80, 82, 86, 87, 88, 89, 90, 91], "header": [16, 20, 23, 60, 84], "heal": 80, "healing_used_tonight": 80, "hello": 81, "help": [1, 6, 15, 16, 18, 29, 34, 53, 79, 80, 81, 82, 84, 87, 91], "helper": [77, 80, 83], "her": 80, "here": [34, 46, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91], "hex": 86, "hi": [16, 18, 79, 87], "hierarch": 77, "high": [75, 77, 94], "higher": [12, 14, 78], "highest": [34, 43], "highli": 87, "highlight": 85, "hint": [80, 82, 87], "hint_prompt": [29, 87], "histor": 86, "histori": [1, 2, 7, 8, 16, 18, 29, 80, 83, 87], "home": [34, 57], "hook": 91, "host": [1, 2, 7, 15, 30, 31, 34, 36, 49, 50, 65, 80, 89], "hostmsg": 80, "hostnam": [1, 2, 7, 15, 30, 31, 34, 49, 89], "how": [12, 13, 14, 16, 18, 21, 79, 80, 81, 82, 83, 84, 88, 89, 90, 91, 92, 95], "how_to_format_inputs_to_chatgpt_model": [15, 86], "howev": [15, 85, 86, 87], "html": [34, 58, 85], "html_selected_tag": [34, 58], "html_text": [34, 58], "html_to_text": [34, 58], "http": [1, 6, 15, 16, 18, 19, 21, 34, 36, 55, 57, 60, 78, 81, 84, 85, 86, 87, 91], "hub": [25, 73, 80, 83], "hub_manag": 83, "huggingfac": [20, 79, 84, 87], "human": [36, 60], "human_ev": [36, 60], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 34, 36, 39, 40, 43, 46, 49, 53, 55, 57, 58, 59, 60, 61, 62, 69, 71, 72, 73, 75, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 94, 95], "id": [1, 2, 7, 15, 16, 20, 22, 23, 30, 31, 34, 55, 68, 79, 86], "id_list": [34, 55], "idea": [1, 6, 16, 19, 91], "ident": 80, "identifi": [0, 7, 15, 16, 18, 20, 21, 22, 23, 34, 57, 72, 79, 80, 81, 84, 86], "idx": 80, "if_body_oper": [26, 27, 28], "if_change_databas": 60, "ifelsepipelin": [26, 27, 28], "ifelsepipelinenod": 73, "ignor": 82, "illustr": [80, 83], "imag": [1, 8, 15, 16, 18, 24, 34, 36, 46, 68, 69, 77, 79, 82, 84, 85, 86, 87], "image_term": 68, "image_url": [16, 24], "imaginari": 80, "immedi": [15, 75, 80, 81, 82, 89, 94], "impl_typ": [59, 62], "implement": [1, 2, 5, 6, 15, 16, 18, 20, 26, 28, 36, 55, 60, 73, 77, 82, 83, 84, 86, 87, 88], "impli": 89, "import": [0, 1, 12, 16, 26, 30, 34, 36, 59, 62, 65, 68, 79, 80, 81, 82, 83, 84, 85, 87, 88, 89], "import_function_from_path": 68, "importantand": [34, 58], "impos": [34, 36], "improv": [90, 91], "in_subprocess": [1, 7], "includ": [0, 1, 2, 4, 7, 8, 26, 28, 34, 37, 39, 40, 41, 57, 60, 72, 77, 79, 80, 82, 84, 85, 86, 91], "including_self": [1, 7], "incom": 82, "increas": [59, 62], "increment": [7, 88], "independ": [77, 89], "index": [1, 6, 12, 13, 14, 34, 55, 75, 86], "indic": [34, 39, 40, 41, 59, 60, 62, 80, 81, 82, 85, 86, 89], "individu": [34, 57], "infer": [20, 23, 79, 84], "info": [0, 59, 61, 72, 81], "inform": [1, 2, 7, 8, 9, 15, 16, 19, 24, 34, 53, 55, 57, 58, 72, 73, 77, 80, 82, 83, 85, 86, 88, 90], "inher": 77, "inherit": [1, 2, 15, 16, 20, 80, 83, 84, 89], "init": [0, 1, 7, 29, 30, 31, 59, 62, 65, 76, 79, 80, 81, 84, 88], "init_set": 7, "init_uid_list": 68, "init_uid_queu": 69, "initi": [0, 1, 2, 3, 4, 6, 7, 8, 9, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 59, 62, 68, 69, 71, 72, 73, 79, 82, 83, 84, 85, 86, 88], "initial_announc": 83, "inject": 87, "innov": [75, 94], "input": [1, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 26, 27, 28, 30, 31, 34, 53, 58, 68, 69, 72, 73, 77, 79, 80, 82, 83, 84, 87, 89], "insecur": 33, "insid": 85, "insight": 90, "inspect": 85, "instal": [21, 75, 77, 80, 91, 94, 95], "instanc": [1, 2, 7, 15, 59, 62, 72, 80, 81, 83, 84, 86, 87, 89], "instanti": [83, 86], "instruct": [34, 53, 77, 82, 84, 87], "int": [1, 2, 4, 6, 7, 9, 12, 13, 14, 15, 16, 23, 26, 27, 28, 29, 30, 31, 34, 36, 43, 45, 49, 50, 51, 53, 55, 56, 57, 58, 60, 63, 65, 69, 85, 86], "integr": [77, 95], "intenum": [10, 29, 34, 47, 73], "interact": [26, 28, 34, 36, 37, 77, 79, 80, 81, 82, 83, 86, 89], "interest": 90, "interf": 36, "interfac": [26, 28, 59, 62, 68, 73, 77, 81, 82, 83, 84, 85, 87, 88], "interlay": 77, "intern": 82, "interv": [16, 23], "introduc": [77, 79, 80, 82, 85, 86, 89], "intuit": 77, "invalid": 60, "investopedia": [34, 57], "invit": 90, "invoc": [0, 79, 84], "invok": [1, 3, 4, 34, 37, 58, 73, 82, 83, 87], "involv": [80, 91], "ioerror": 60, "ip": [34, 49, 50, 89], "ipython": [34, 36], "is_callable_express": 74, "is_play": 69, "is_valid_url": 58, "isinst": 82, "isn": 81, "issu": [60, 81, 90, 91], "item": [64, 85, 86], "iter": [1, 6, 12, 13, 14, 73, 83, 86], "its": [1, 3, 12, 14, 20, 29, 34, 39, 45, 49, 60, 72, 79, 80, 82, 84, 85, 86, 87, 88, 89, 91], "itself": 86, "job": [34, 58], "join": [29, 75, 80, 85, 93, 94], "join_to_list": 29, "join_to_str": 29, "jpg": [79, 87], "jr": [34, 55], "json": [0, 1, 4, 6, 10, 12, 14, 15, 16, 23, 24, 29, 34, 45, 57, 58, 60, 71, 79, 80, 82, 85, 86, 87], "json_arg": [16, 23], "jsondecodeerror": [1, 4], "just": [26, 27, 28, 29, 83, 88], "k": [34, 43, 86], "k1": [26, 28], "k2": [26, 28], "keep": [16, 18, 19, 34, 53, 58, 81, 90, 91], "keep_al": [16, 21, 84], "keep_raw": [34, 58], "kei": [1, 4, 6, 9, 16, 18, 22, 23, 34, 53, 57, 58, 61, 73, 79, 82, 84, 85, 86, 88, 95], "keyerror": 86, "keyword": [16, 18, 21, 22, 34, 57, 85], "kill": [36, 80], "kind": [26, 28], "know": 80, "knowledg": [34, 43, 89], "known": 80, "kwarg": [1, 2, 3, 4, 6, 7, 8, 9, 15, 16, 18, 19, 20, 21, 22, 23, 24, 34, 45, 49, 50, 51, 57, 61, 72, 74, 82, 84, 85, 86], "kwarg_convert": 74, "l": [34, 37, 39], "lack": 60, "lambda": [26, 27, 28], "languag": [1, 3, 4, 77, 82, 83, 85, 87], "larg": [77, 85, 87, 89], "last": [12, 14, 16, 18, 79, 80, 87], "later": 82, "latest": 90, "launch": [1, 2, 7, 71, 77, 89], "launch_serv": [1, 2, 7, 89], "launcher": [1, 7], "layer": [34, 36, 77], "lazy_launch": [1, 2, 7], "lead": [1, 9], "learn": [34, 55, 57, 80, 85, 88], "least": [1, 4], "leav": [34, 49], "lecun": [34, 55], "length": [16, 23, 29, 63, 87], "less": [34, 53, 77], "let": [77, 80], "level": [0, 59, 61, 75, 77, 81, 94], "li": [34, 58], "licens": [55, 77], "life": 80, "like": [26, 27, 28, 79, 80, 83, 87], "limit": [1, 9, 16, 22, 34, 36, 53, 60, 88], "line": [1, 7, 69, 71, 80, 81, 82], "link": [34, 57, 58, 86], "list": [0, 1, 3, 4, 6, 7, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 29, 34, 39, 43, 44, 55, 57, 63, 68, 69, 72, 73, 74, 79, 80, 82, 83, 84, 85, 86, 88], "list_directory_cont": [34, 39], "list_model": 19, "listen": [1, 2, 7], "liter": [0, 15, 59, 61, 72, 81], "littl": [34, 49], "ll": [80, 81, 88], "llama2": [84, 87], "llm": [77, 87], "load": [0, 1, 2, 3, 4, 6, 8, 12, 13, 14, 16, 19, 21, 71, 73, 79, 80, 84, 85, 86], "load_config": 71, "load_from_config": [1, 2], "load_memori": [1, 2], "load_model_by_config_nam": 16, "load_web": [34, 58, 85], "local": [0, 1, 2, 7, 16, 18, 59, 61, 62, 77, 79, 80, 86, 89, 91], "local_attr": 15, "local_mod": [1, 2, 7], "localhost": [1, 2, 7, 34, 50, 89], "locat": [15, 34, 56, 80, 87], "log": [0, 11, 59, 60, 61, 75, 80, 82, 94, 95], "log_level": [0, 81], "log_studio": 61, "logger": [0, 59, 61, 86], "logger_level": [0, 80, 81], "logic": [1, 5, 26, 28, 73, 82, 83], "loguru": [59, 61, 81], "london": 87, "long": [10, 21, 29, 83, 84], "longer": 88, "look": 80, "loop": [1, 6, 26, 27, 28, 73, 79, 80], "loop_body_oper": [26, 27, 28], "lst": 72, "lukasschwab": 55, "lynch": 80, "m": [81, 91], "mac": 78, "machin": 89, "made": [88, 91], "mai": [1, 4, 16, 18, 19, 34, 57, 72, 80, 82, 83, 87, 88, 89, 91], "main": [16, 24, 71, 80, 82, 83, 85, 89, 91], "mainli": [85, 89], "maintain": [15, 82, 86], "mainthread": 60, "major": 80, "majority_vot": 80, "make": [15, 16, 19, 82, 87, 88, 89], "manag": [11, 25, 60, 73, 77, 78, 79, 80, 82, 83, 88], "mani": [34, 49, 50, 87], "manipul": 86, "manner": [75, 89, 94], "manual": 83, "map": [1, 6, 26, 27, 28, 83], "master": [36, 60], "match": [12, 13, 14, 80], "matplotlib": [34, 36], "max": [1, 2, 7, 29, 63, 84, 87], "max_game_round": 80, "max_it": [1, 6], "max_iter": 83, "max_length": [16, 20, 23, 29], "max_length_of_model": 20, "max_loop": [26, 27, 28], "max_pool_s": [1, 2, 7], "max_result": [34, 55], "max_retri": [1, 4, 16, 20, 23, 84], "max_return_token": [34, 53], "max_summary_length": 29, "max_timeout_second": [1, 2, 7], "max_werewolf_discussion_round": 80, "maxcount_result": [34, 49, 50, 51], "maximum": [1, 4, 6, 16, 23, 26, 27, 28, 34, 36, 43, 49, 50, 51, 55, 87, 88], "maximum_memory_byt": [34, 36], "mayb": [1, 6, 15, 16, 18], "md": 84, "me": 80, "mean": [0, 1, 2, 12, 14, 16, 22, 25, 79], "meanwhil": 89, "mechan": [75, 77, 79, 83, 94], "meet": [26, 27, 28, 82, 87], "member": 91, "memori": [1, 2, 3, 4, 7, 8, 9, 15, 21, 29, 34, 36, 43, 75, 77, 80, 82, 84, 87, 92, 94], "memory_config": [1, 2, 3, 4, 8, 82], "memorybas": [12, 13, 14], "merg": [16, 18], "messag": [0, 1, 2, 3, 4, 7, 9, 16, 18, 19, 21, 22, 23, 25, 30, 31, 34, 37, 39, 40, 41, 43, 46, 49, 50, 51, 53, 56, 60, 61, 68, 69, 73, 75, 79, 80, 82, 84, 85, 87, 88, 89, 91, 92], "message_from_alic": 79, "message_from_bob": 79, "messagebas": [15, 16, 18, 19, 20, 21, 22, 23], "messages_kei": [16, 23, 84], "met": 83, "metadata": [33, 86], "method": [1, 5, 7, 9, 15, 16, 19, 24, 72, 73, 79, 82, 86, 87, 88, 89], "metric": [12, 14, 59, 62, 86], "metric_nam": [59, 62], "metric_name_a": [59, 62], "metric_name_b": [59, 62], "metric_unit": [59, 62, 88], "metric_valu": [59, 62], "microsoft": [34, 57, 85], "might": [80, 91], "migrat": 89, "mind": 82, "mine": [16, 18], "minim": 82, "minor": 89, "miss": [30, 33, 82], "misunderstand": [16, 18], "mit": 55, "mix": 83, "mixtur": [87, 89], "mkt": [34, 57], "modal": [77, 86], "mode": [60, 78], "model": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 15, 29, 34, 43, 45, 53, 58, 59, 62, 63, 72, 73, 75, 77, 82, 85, 86, 87, 88, 92, 94, 95], "model_a": 88, "model_a_metr": 88, "model_b": 88, "model_b_metr": 88, "model_config": [0, 79, 80, 84], "model_config_nam": [1, 2, 3, 4, 6, 8, 79, 80, 82], "model_config_or_path": 84, "model_dump": 88, "model_nam": [16, 18, 19, 20, 21, 22, 23, 59, 62, 63, 79, 80, 84, 87, 88], "model_name_for_openai": 20, "model_respons": 85, "model_typ": [16, 18, 19, 20, 21, 22, 23, 79, 80, 84], "modelnod": 73, "modelrespons": [4, 16, 24], "modelscop": [78, 79, 84], "modelscope_cfg_dict": 79, "modelwrapp": 84, "modelwrapperbas": [16, 18, 19, 20, 21, 22, 23, 29, 34, 43, 53, 58, 84, 87], "moder": 80, "modifi": [1, 6, 36, 82], "modul": [0, 1, 12, 14, 16, 26, 29, 30, 34, 46, 59, 65, 68, 72, 75, 77, 81, 86], "module_nam": 68, "module_path": 68, "mongodb": [34, 85], "monitor": [7, 16, 20, 59, 75, 92, 94], "monitor_metr": 62, "monitorbas": [59, 62, 88], "monitorfactori": [59, 62, 88], "more": [0, 1, 6, 16, 18, 19, 25, 34, 57, 79, 80, 81, 82, 85, 86, 89], "most": [15, 80, 86, 87], "move": [34, 39, 85], "move_directori": [34, 39, 85], "move_fil": [34, 39, 85], "msg": [15, 16, 18, 19, 21, 22, 23, 25, 29, 64, 68, 69, 79, 80, 81, 82, 83, 87, 89], "msg_hub": 83, "msg_id": 69, "msghub": [0, 75, 76, 79, 92, 94], "msghubmanag": [0, 25, 83], "msghubnod": 73, "msgnode": 73, "msgtype": 29, "much": [0, 25, 83, 91], "multi": [16, 19, 75, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 94], "multimod": [16, 18, 84, 87], "multipl": [13, 15, 16, 18, 26, 27, 28, 59, 62, 73, 79, 80, 83, 85, 87, 88, 89, 91], "must": [16, 18, 19, 59, 62, 80, 82, 87, 89], "my_arg1": 84, "my_arg2": 84, "my_dashscope_chat_config": 84, "my_dashscope_image_synthesis_config": 84, "my_dashscope_multimodal_config": 84, "my_dashscope_text_embedding_config": 84, "my_gemini_chat_config": 84, "my_gemini_embedding_config": 84, "my_model": 84, "my_model_config": 84, "my_ollama_chat_config": 84, "my_ollama_embedding_config": 84, "my_ollama_generate_config": 84, "my_postapiwrapper_config": 84, "myagent": 80, "mymodelwrapp": 84, "mysql": [34, 49, 85], "mythought": 15, "n": [16, 18, 26, 28, 29, 34, 53, 58, 78, 80, 82, 84, 85, 87], "n1": 80, "n2": 80, "nalic": 87, "name": [0, 1, 2, 3, 4, 6, 7, 8, 9, 15, 16, 18, 19, 20, 21, 22, 23, 30, 31, 34, 36, 45, 49, 50, 51, 53, 59, 61, 62, 69, 71, 72, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 91], "nativ": [34, 36], "natur": [34, 36, 80, 86], "navig": 82, "nbob": 87, "nconstraint": 80, "necessari": [60, 72, 77, 83, 85, 86], "need": [1, 6, 7, 20, 34, 53, 73, 78, 80, 82, 84, 85, 86, 87, 88, 89], "negative_prompt": 84, "neither": 80, "networkx": 72, "new": [7, 12, 13, 14, 25, 30, 31, 34, 39, 59, 62, 78, 83, 84, 85, 86, 88, 90, 93], "new_ag": 83, "new_particip": [25, 83], "newlin": 87, "next": [69, 73, 83, 95], "nfor": 80, "ngame": 80, "nice": 87, "night": 80, "nin": 80, "node": [72, 73, 74], "node_id": [72, 73], "node_info": 72, "node_typ": 73, "nodes_not_in_graph": 72, "non": [34, 36, 72, 77, 89], "none": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 36, 43, 49, 50, 51, 55, 58, 59, 60, 61, 62, 65, 68, 69, 71, 72, 73, 79, 82, 83, 85, 86, 87, 89], "nor": 80, "normal": 85, "note": [1, 6, 7, 16, 18, 21, 34, 37, 78, 79, 80, 82, 83, 85, 87, 88], "noth": [26, 27, 28], "notic": [34, 53, 80], "notif": 91, "notifi": [1, 2], "notimplementederror": [82, 86], "noun": [34, 57], "now": [34, 49, 80, 83, 91], "nplayer": 80, "nseer": 80, "nsummar": [34, 53], "nthe": 80, "nthere": 80, "num_dot": 69, "num_inst": [1, 7], "num_result": [34, 57, 85], "num_tokens_from_cont": 63, "number": [1, 2, 4, 6, 7, 12, 13, 14, 16, 23, 26, 27, 28, 29, 34, 43, 44, 49, 50, 51, 53, 55, 56, 57, 60, 80, 81, 83, 85, 86, 87, 88, 89], "nvictori": 80, "nvillag": 80, "nwerewolv": 80, "nwitch": 80, "nyou": [34, 53, 80], "o": [34, 36, 60], "obei": 87, "object": [0, 1, 7, 9, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 29, 30, 31, 33, 34, 45, 46, 49, 50, 51, 56, 58, 59, 62, 72, 73, 80, 82, 83, 85, 86, 87, 89], "object_nam": 86, "observ": [0, 1, 2, 7, 25, 80, 81, 82, 83], "obtain": [1, 7, 34, 58, 88], "occupi": 7, "occur": [60, 82, 85], "offer": [77, 79], "offici": [77, 91], "often": [15, 85, 86, 87], "okai": 80, "oldest": 7, "ollama": [16, 21, 87], "ollama_chat": [16, 21, 84], "ollama_embed": [16, 21, 84], "ollama_gener": [16, 21, 84], "ollamachatwrapp": [16, 21, 84], "ollamaembeddingwrapp": [16, 21, 84], "ollamagenerationwrapp": [16, 21, 84], "ollamawrapperbas": [16, 21], "omit": [82, 83, 85, 86, 89], "onc": [59, 62, 79, 88, 91], "one": [15, 16, 18, 19, 20, 34, 43, 59, 61, 69, 73, 80, 82, 83, 85, 87], "ongo": 82, "onli": [1, 2, 7, 15, 34, 36, 49, 59, 60, 62, 80, 85, 86, 87, 88, 89], "open": [15, 34, 45, 53, 60, 79, 80, 91], "openai": [15, 16, 20, 22, 23, 34, 36, 45, 60, 63, 64, 79, 80, 85, 86, 87, 88], "openai_api_kei": [16, 22, 79], "openai_cfg_dict": 79, "openai_chat": [16, 20, 22, 79, 80, 84], "openai_dall_": [16, 22, 79, 84], "openai_embed": [16, 22, 79, 84], "openai_model_config": 79, "openai_organ": [16, 22, 79], "openai_respons": 88, "openaichatwrapp": [16, 22, 84], "openaidallewrapp": [16, 22, 84], "openaiembeddingwrapp": [16, 22, 84], "openaiwrapperbas": [16, 22, 84], "oper": [1, 2, 26, 27, 28, 29, 34, 36, 39, 40, 41, 49, 55, 59, 60, 62, 72, 73, 77, 80, 82, 83, 85, 86], "opportun": 80, "opt": 73, "opt_kwarg": 73, "optim": [77, 89], "option": [0, 1, 2, 3, 4, 7, 8, 9, 12, 13, 14, 15, 16, 21, 24, 25, 26, 27, 29, 30, 31, 33, 34, 36, 43, 55, 58, 59, 60, 62, 73, 77, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88], "orchestr": [80, 83], "order": [12, 14, 16, 18, 34, 43, 72, 77, 80, 83, 89], "ordinari": 80, "org": [1, 6], "organ": [1, 3, 4, 13, 16, 20, 22, 34, 57, 79, 80, 81, 84, 87, 91], "orient": 83, "origin": [12, 14, 34, 43, 62, 86, 88], "other": [0, 1, 2, 4, 7, 8, 15, 25, 34, 36, 49, 80, 82, 83, 86, 87, 89, 90, 91], "otherwis": [0, 1, 7, 12, 14, 34, 45, 46, 53, 58, 85], "our": [15, 16, 19, 80, 87, 89, 90, 91], "out": [1, 2, 26, 27, 28, 80, 81, 91], "outlast": 80, "outlin": [80, 83, 85], "output": [0, 1, 4, 6, 25, 26, 27, 28, 34, 36, 37, 58, 72, 73, 80, 81, 82, 83], "outsid": 83, "over": [73, 81], "overridden": [1, 5], "overutil": 88, "overview": [77, 85], "overwrit": [12, 13, 14, 34, 40, 41, 86], "overwritten": 60, "own": [1, 6, 15, 16, 18, 75, 79, 80, 92, 94], "p": [34, 58], "packag": [0, 1, 16, 26, 30, 34, 59, 65, 78], "page": [34, 58, 75, 85, 86], "pair": 87, "paper": [1, 6, 34, 55, 89], "paradigm": 89, "parallel": [77, 89], "param": [58, 60, 85], "paramet": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 36, 37, 39, 40, 41, 43, 44, 45, 46, 49, 50, 51, 53, 55, 56, 57, 58, 59, 60, 61, 62, 71, 72, 73, 80, 85, 86, 87, 89], "params_prompt": 85, "parent": 73, "pars": [1, 4, 16, 24, 34, 40, 58, 60, 71, 85, 87], "parse_dict": [1, 4], "parse_func": [1, 4, 16, 23, 24], "parse_html_to_text": [34, 58], "parser": 24, "part": [73, 87, 90, 91], "parti": [16, 19, 79, 87], "partial": 29, "particip": [0, 25, 26, 27, 73, 80], "particular": 88, "particularli": 88, "pass": [0, 1, 2, 3, 4, 7, 12, 13, 14, 15, 16, 19, 25, 34, 45, 73, 79, 80, 83, 84, 85, 86, 87], "password": [34, 50], "past": [80, 82], "path": [0, 16, 34, 39, 40, 41, 56, 59, 60, 62, 68, 69, 71, 79, 84, 85], "path_log": [59, 61], "path_sav": [65, 81], "pattern": 83, "paus": 88, "peac": 80, "perform": [1, 3, 8, 72, 73, 75, 77, 80, 82, 83, 85, 87, 91, 94], "period": 88, "permiss": [34, 57, 60], "permissionerror": 60, "person": [34, 57, 80], "pertain": 77, "phase": 80, "phenomenon": [34, 57], "pictur": [16, 18, 79, 87], "piec": [13, 34, 36, 85, 86], "pip": 91, "pipe": [7, 80, 83], "pipe1": 83, "pipe2": 83, "pipe3": 83, "pipelin": [73, 75, 77, 79, 92, 94], "pipelinebas": [5, 26, 28, 83], "pivot": 82, "placehold": [15, 16, 18, 19, 21, 22, 23, 26, 27, 28, 73, 83], "placeholder_attr": 15, "placeholdermessag": 15, "placeholdernod": 73, "plai": [15, 80, 86, 87], "plain": [1, 4], "platform": [75, 77, 78, 89, 90, 94], "player": [68, 69, 80], "player1": 80, "player2": 80, "player3": 80, "player4": 80, "player5": 80, "player6": 80, "player_nam": 80, "pleas": [1, 4, 6, 7, 21, 34, 37, 57, 79, 80, 83, 85, 86, 87, 88, 89, 91], "plot": [34, 36], "plt": [34, 36], "plu": [84, 87], "png": 87, "point": [68, 85, 87], "poison": 80, "polici": [29, 87], "pool": [7, 80, 82], "pop": 80, "port": [1, 2, 7, 15, 30, 31, 34, 49, 50, 65, 89], "pose": [34, 36], "possibl": 91, "post": [16, 20, 23, 80], "post_api": [16, 20, 23, 84], "post_api_chat": [16, 23], "post_api_dal": 23, "post_api_dall_": 23, "post_arg": [16, 23], "postapichatwrapp": [16, 23], "postapidallewrapp": 23, "postapimodelwrapp": [16, 23], "postapimodelwrapperbas": [16, 23, 84], "potenti": [1, 9, 34, 36, 80, 81], "potion": 80, "power": [34, 57, 80], "practic": 83, "pre": [77, 82, 91], "prebuilt": [75, 94], "predat": 80, "predecessor": 72, "predefin": [80, 82], "prefer": [78, 83, 87], "prefix": [16, 18, 29, 34, 55, 59, 62, 69], "prepar": [29, 82, 85, 95], "prepare_funcs_prompt": [1, 6], "preprocess": [34, 58], "present": [34, 36, 77, 80], "preserv": [12, 14, 34, 43], "preserve_ord": [12, 14, 34, 43], "prevent": [16, 19, 36, 73, 83, 88], "primari": [79, 82], "print": [1, 4, 6, 34, 57, 79, 82, 85, 87, 88], "pro": [16, 19, 84, 87], "problem": [6, 85, 90, 91], "problemat": 81, "proce": [71, 80], "process": [1, 3, 4, 7, 9, 29, 34, 36, 53, 58, 72, 80, 81, 82, 83, 85, 86, 87, 89, 91], "process_messag": 7, "produc": [1, 3, 4, 82], "program": [34, 57, 75, 77, 80, 83, 86, 89, 94], "programm": [34, 57], "progress": 90, "project": [0, 10, 78, 81, 82], "prompt": [1, 2, 3, 4, 6, 9, 10, 15, 16, 18, 19, 21, 34, 45, 53, 58, 64, 75, 77, 80, 82, 85, 86, 92, 94], "prompt_token": 88, "prompt_typ": [1, 3, 4, 29], "promptengin": [29, 92], "prompttyp": [1, 3, 4, 29, 86], "properli": [34, 45, 80, 85], "properti": [1, 2, 85, 86], "propos": 91, "proto": [30, 33], "protobuf": 33, "protocol": [1, 5, 32], "provid": [1, 3, 4, 7, 9, 12, 14, 16, 19, 34, 36, 45, 53, 57, 58, 59, 60, 62, 69, 71, 72, 73, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91], "proxi": 89, "pull": [16, 19, 21, 78, 90], "pure": [75, 94], "purg": 86, "purpos": [16, 24, 80, 82], "py": [36, 55, 60, 71, 77, 80], "pypi": 78, "python": [1, 4, 34, 36, 37, 57, 71, 72, 73, 75, 77, 78, 79, 80, 81, 85, 86, 94], "python3": 78, "pythonservicenod": 73, "qianwen": [16, 18], "qr": 90, "queri": [12, 14, 34, 43, 49, 50, 51, 55, 57, 60, 85, 86], "query_mongodb": [34, 49, 85], "query_mysql": [34, 50, 85], "query_sqlit": [34, 51, 85], "question": [34, 57, 77, 85, 90], "queue": 69, "quick": [16, 18, 75, 94, 95], "quickli": [79, 84, 87], "quota": [59, 62], "quotaexceedederror": [59, 62, 88], "quotaexceederror": [59, 62], "qwen": [84, 87], "rais": [1, 4, 9, 16, 23, 24, 59, 62, 71, 72, 82, 86, 91], "randomli": [1, 7], "rang": [12, 13, 26, 28, 73, 80, 83], "rate": 88, "rather": [86, 87], "raw": [16, 24, 34, 58, 72], "raw_info": 72, "re": [1, 6, 16, 18, 29, 34, 58, 78, 80, 87, 91], "reach": 80, "react": [1, 6, 82], "reactag": [1, 6, 73, 82], "reactagentnod": 73, "read": [16, 22, 34, 40, 41, 73, 79, 80, 84, 85], "read_json_fil": [34, 40, 85], "read_model_config": 16, "read_text_fil": [34, 41, 85], "readabl": 81, "readi": [77, 80, 82, 89, 91], "readm": 84, "readtextservicenod": 73, "real": [15, 89, 90], "reason": [1, 6], "recal": 82, "receiv": [79, 83, 89], "recent": 86, "recent_n": [12, 13, 14, 86], "recommend": [78, 81, 87], "record": [1, 2, 7, 15, 81, 82, 86], "recurs": 73, "redirect": [59, 61, 81], "refer": [1, 4, 6, 15, 16, 18, 19, 34, 55, 57, 77, 79, 80, 84, 85, 86, 87, 89], "regist": [59, 62, 79, 84], "register_budget": [59, 62, 88], "registr": [59, 62, 88], "regul": 88, "regular": [59, 62], "relat": [1, 12, 26, 30, 34, 60, 73, 87, 88, 90], "relationship": 89, "relev": [12, 14, 86, 90, 91], "reli": [88, 89], "reliabl": [75, 94], "remain": [80, 83], "rememb": [78, 80, 91], "remov": [1, 2, 36, 59, 62, 72, 83, 86], "remove_duplicates_from_end": 72, "renam": 85, "reorgan": 87, "repeat": [73, 80], "repeatedli": 83, "replac": [83, 89], "repli": [1, 2, 3, 4, 6, 7, 8, 9, 69, 80, 82, 85, 86, 89], "replic": 73, "repons": 82, "report": 93, "repositori": [16, 19, 55, 78, 79, 90], "repres": [1, 3, 4, 9, 26, 28, 34, 57, 72, 73, 77, 81, 83, 86, 87, 89], "represent": [15, 86], "reproduc": 91, "reqeust": [30, 31], "request": [1, 2, 7, 16, 19, 21, 23, 30, 33, 34, 56, 58, 60, 81, 85, 90], "requests_get": 60, "requir": [0, 1, 4, 9, 16, 18, 20, 21, 22, 23, 25, 27, 59, 62, 72, 75, 78, 82, 83, 84, 85, 86, 87, 88, 94], "require_url": [1, 9, 82], "required_kei": [1, 9, 82], "reset": [68, 69, 86], "reset_audi": [1, 2], "reset_glb_var": 68, "resetexcept": 69, "resili": 77, "resolv": 91, "resourc": [77, 86], "respect": [34, 36], "respond": [80, 87], "respons": [0, 1, 2, 3, 4, 7, 8, 10, 15, 16, 25, 29, 30, 31, 34, 46, 58, 60, 73, 77, 79, 80, 82, 83, 85, 86, 91], "responseformat": 10, "responsepars": [16, 24], "responseparsingerror": [16, 24], "responsestub": [30, 31], "rest": [34, 57, 87], "result": [1, 2, 6, 7, 34, 39, 46, 49, 50, 51, 55, 56, 57, 58, 72, 73, 80, 82, 85, 87], "resurrect": 80, "retain": 82, "retri": [1, 4, 16, 23, 34, 56, 75, 94], "retriev": [12, 14, 34, 68, 69, 73, 85, 86], "retrieve_by_embed": [12, 14, 86], "retrieve_from_list": [34, 43, 85], "retry_interv": [16, 23], "return": [1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 18, 19, 21, 22, 23, 24, 26, 27, 28, 30, 31, 34, 36, 37, 39, 40, 41, 43, 44, 45, 49, 50, 51, 53, 55, 56, 57, 58, 59, 60, 62, 69, 71, 72, 73, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91], "return_typ": 86, "return_var": 73, "reveal": 80, "revers": [12, 14], "rewrit": 15, "risk": [34, 36], "rm": [34, 37], "rm_audienc": [1, 2], "rn": [34, 55], "robust": [75, 77, 94], "role": [1, 3, 15, 16, 18, 19, 34, 53, 61, 69, 79, 82, 86, 87], "round": 80, "rout": 73, "rpc": [1, 2, 7, 15, 75, 77, 89], "rpc_servicer_method": 7, "rpcagent": [1, 7, 15, 33], "rpcagentcli": [15, 30, 31], "rpcagentserverlaunch": [1, 7, 89], "rpcagentservic": [7, 30, 33], "rpcagentstub": [30, 33], "rpcmsg": [7, 30], "rpcserversidewrapp": 7, "rule": [80, 87], "run": [0, 7, 34, 36, 68, 72, 77, 78, 85, 89], "run_app": 68, "runnabl": 72, "runtim": [0, 77, 86, 89], "safeti": [34, 36], "sai": [1, 4, 80], "same": [0, 25, 59, 62, 73, 85, 87, 88, 89], "sanit": 72, "sanitize_node_data": 72, "satisfi": [34, 53], "save": [0, 11, 29, 30, 31, 34, 56, 80], "save_api_invok": 0, "save_cod": 0, "save_dir": 0, "save_log": 0, "scale": [85, 89], "scan": 90, "scenario": [15, 16, 18, 83, 86, 87], "scene": 85, "schema": [1, 6, 34, 45, 85], "score": [34, 43], "score_func": [34, 43], "scratch": 92, "script": [77, 78, 79, 84], "search": [0, 34, 55, 73, 75, 85], "search_queri": [34, 55], "second": [16, 18, 34, 36, 60, 87], "secondari": 82, "secretli": 80, "section": [79, 80, 83, 87], "secur": [34, 36], "sed": [34, 37], "see": [80, 81, 87, 91], "seed": [16, 18, 21, 22, 84], "seek": 90, "seem": [80, 89], "seen": [15, 73, 89], "seen_ag": 73, "seer": 80, "segment": [12, 13, 14], "select": [34, 58, 60, 68, 83, 86], "selected_tags_text": [34, 58], "self": [15, 34, 45, 80, 82, 83, 84, 85, 86], "self_define_func": [34, 58], "self_parse_func": [34, 58], "sell": [34, 57], "send": [15, 60, 61, 68, 69, 86], "send_audio": 68, "send_imag": 68, "send_messag": 68, "send_msg": 69, "send_player_input": 69, "send_reset_msg": 69, "sender": [15, 79, 86], "sent": [60, 80, 89], "separ": [88, 89, 91], "sequenc": [0, 1, 2, 7, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 34, 43, 58, 73, 77, 82, 83, 86], "sequenti": [26, 28, 72, 73, 79], "sequentialpipelin": [26, 27, 28, 79, 80], "sequentialpipelinenod": 73, "seral": [30, 31], "seri": [1, 7, 73, 77, 88], "serial": [15, 30, 31, 34, 40, 85, 86], "serv": [73, 80, 82, 83, 88], "server": [1, 2, 7, 15, 21, 30, 31, 33, 34, 49, 50, 89], "server_a": 89, "servic": [1, 7, 8, 30, 33, 73, 75, 79, 80, 82, 89, 92, 94], "service_bot": 82, "service_func": [34, 45], "servicebot": 82, "serviceexecstatu": [34, 46, 47, 53, 55, 57, 85], "serviceexestatu": [34, 46, 85], "servicefactori": [34, 45, 85], "servicercontext": 7, "servicerespons": [1, 6, 34, 36, 37, 39, 40, 41, 43, 44, 46, 49, 50, 51, 53, 55, 56, 57, 58, 60], "session": [34, 37], "set": [0, 1, 2, 3, 7, 9, 12, 14, 15, 16, 22, 29, 30, 31, 34, 36, 59, 62, 71, 72, 73, 78, 83, 84, 85, 86, 88], "set_quota": [59, 62, 88], "set_respons": [30, 31], "setitim": [34, 36, 60], "setup": [7, 59, 61, 77, 81, 83], "setup_logg": [59, 61], "setup_rpc_agent_serv": 7, "sever": [16, 24, 77, 80, 82], "share": [0, 25, 83, 90], "she": 80, "shell": [34, 37], "should": [0, 1, 2, 15, 16, 18, 19, 20, 21, 22, 23, 29, 34, 45, 61, 77, 79, 80, 84, 85, 86, 87], "shouldn": [15, 16, 21], "show": [34, 36, 39, 77, 89, 90], "shown": [78, 87], "shrink": [10, 29, 87], "shrink_polici": 29, "shrinkpolici": [10, 29], "shutdown": [1, 7], "side": [7, 80], "sig": 85, "signal": [34, 36, 60, 69], "signatur": 85, "signific": 73, "similar": [34, 80, 83, 85, 86, 87], "simpl": [1, 3, 16, 19, 79, 81, 87, 89], "simplic": 87, "simplifi": [77, 80, 83, 87], "simultan": 89, "sinc": [34, 36, 60, 87, 89], "singl": [16, 18, 19, 77, 86, 87], "singleton": [59, 62], "size": [7, 12, 13, 14, 84, 86, 87], "slower": 81, "small": 84, "smoothli": 87, "snippet": [34, 57, 80, 91], "so": [34, 37, 45, 57, 78, 85, 87], "social": 80, "socket": 7, "solut": [16, 18, 87, 89], "solv": [6, 77, 82], "some": [1, 2, 7, 8, 10, 34, 36, 57, 67, 82, 83, 84, 85, 87, 88, 91], "some_messag": 83, "someon": [34, 57], "someth": [80, 81], "sometim": [80, 87], "soon": 85, "sophist": 80, "sort": 72, "sourc": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 36, 37, 39, 40, 41, 43, 44, 45, 46, 47, 49, 50, 51, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 68, 69, 71, 72, 73, 74, 79, 82, 84, 86], "source_kwarg": 73, "source_path": [34, 39], "space": 29, "speak": [1, 2, 4, 9, 16, 19, 80, 82, 87], "speaker": [81, 86, 87], "special": [26, 28, 43, 80, 81, 82, 89], "specif": [0, 1, 7, 9, 12, 14, 16, 20, 30, 31, 34, 36, 59, 62, 69, 72, 73, 77, 78, 79, 81, 82, 84, 85, 86, 88, 89], "specifi": [1, 4, 5, 12, 13, 16, 20, 22, 34, 36, 39, 45, 56, 60, 73, 79, 80, 82, 83, 84, 85, 86, 87, 88], "speech": 79, "sql": [34, 50, 60, 85], "sql_queri": 60, "sqlite": [34, 49, 59, 62, 85], "sqlite3": 88, "sqlite_cursor": 62, "sqlite_transact": 62, "sqlitemonitor": [62, 88], "src": 77, "stabil": [75, 94], "stage": 88, "stai": [21, 84, 90], "stand": [79, 81], "standalon": [79, 83], "standard": [34, 36, 80, 81, 86], "star": 90, "start": [1, 2, 7, 16, 18, 21, 34, 55, 65, 71, 77, 81, 82, 84, 87, 88, 89, 91], "start_ev": 7, "start_workflow": 71, "state": [34, 37, 77, 81, 82], "static": [16, 24, 33], "statu": [34, 46, 47, 55, 57, 85], "stderr": [59, 61, 81], "stem": [34, 36], "step": [72, 78, 79, 82, 83, 91, 95], "step1": 95, "step2": 95, "step3": 95, "still": [29, 80, 81, 88], "stop": [1, 7], "stop_ev": 7, "storag": 77, "store": [1, 2, 7, 9, 12, 13, 14, 34, 58, 68, 82, 86], "str": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 29, 30, 31, 34, 36, 37, 39, 40, 41, 45, 46, 49, 50, 51, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 68, 69, 71, 72, 73, 74, 82, 84, 85, 86], "straightforward": [16, 19, 79], "strateg": 80, "strategi": [10, 16, 18, 19, 21, 77, 80, 83, 92], "streamlin": [75, 83, 94], "strengthen": 77, "string": [1, 3, 4, 6, 9, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 29, 34, 36, 37, 45, 55, 57, 58, 60, 64, 71, 72, 74, 81, 85, 86], "structur": [13, 73, 79, 83, 86, 87, 95], "stub": [30, 31], "studio": 61, "style": [29, 34, 45, 64, 85, 87], "sub": [30, 31], "subclass": [1, 5, 7, 73, 77, 82, 83, 85, 86, 87], "submit": 90, "subprocess": [1, 7], "subsequ": 73, "subset": [34, 58], "substanc": [34, 57, 86], "success": [0, 34, 39, 40, 41, 46, 47, 53, 57, 58, 59, 60, 61, 62, 81, 85], "successfulli": [34, 53, 81], "sucess": [34, 37], "sugar": 77, "suggest": [34, 45, 85, 90, 91], "suit": 72, "suitabl": [16, 18, 75, 82, 86, 87, 94], "summar": [10, 29, 34, 82, 85, 87], "summari": [1, 4, 29, 34, 53, 80], "summarize_model": 29, "super": [84, 86], "superclass": 82, "suppli": 83, "support": [34, 36, 37, 46, 49, 55, 59, 62, 72, 75, 77, 80, 83, 85, 87, 88, 89, 90, 92, 94], "suppos": [88, 89], "sure": 88, "surviv": 80, "survivor": 80, "suspect": 80, "suspici": 80, "switch": [26, 27, 28, 73, 83], "switch_result": 83, "switchpipelin": [26, 27, 28], "switchpipelinenod": 73, "syntact": 77, "synthesi": [16, 18, 84], "sys_prompt": [1, 2, 3, 4, 6, 79, 80, 82], "sys_python_guard": 36, "system": [1, 2, 3, 4, 6, 11, 15, 16, 18, 29, 34, 36, 53, 58, 77, 80, 82, 86, 87, 88, 89], "system_prompt": [29, 34, 53, 87], "sythesi": 84, "t": [1, 2, 7, 8, 12, 14, 15, 16, 21, 59, 62, 80, 81, 86, 89], "tabl": [62, 82, 83, 85], "table_nam": 62, "tackl": 85, "tag": [34, 58], "tailor": [80, 82], "take": [1, 4, 7, 12, 14, 34, 43, 59, 62, 77, 79, 80, 82, 85, 87], "taken": [1, 2, 7, 8, 80, 83], "target": [29, 33, 80, 87, 89], "task": [1, 2, 7, 8, 15, 77, 82, 84, 85], "task_id": [7, 15], "task_msg": 7, "teammat": 80, "teardown": 83, "technic": 89, "tediou": 85, "tell": [15, 86], "temperatur": [16, 18, 20, 21, 22, 80, 84], "templat": [26, 28, 82], "temporari": 60, "temporarymemori": [12, 14], "tensorflow": 77, "term": [34, 57, 79, 83, 88], "termin": [21, 34, 36, 79, 80], "test": [36, 77], "text": [1, 4, 8, 16, 18, 24, 34, 53, 58, 68, 69, 73, 79, 82, 84, 85, 86, 87], "texttoimageag": [1, 8, 73, 82], "texttoimageagentnod": 73, "textual": [1, 4], "than": [16, 18, 34, 53, 80, 81, 86, 87], "thank": [81, 87], "thei": [29, 79, 80, 83, 89], "them": [1, 7, 15, 26, 28, 34, 37, 80, 81, 82, 84, 85, 87, 88, 91], "themselv": [80, 83], "therefor": 87, "thi": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 15, 16, 18, 19, 20, 22, 24, 25, 30, 31, 34, 36, 43, 55, 57, 59, 60, 62, 71, 72, 73, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91], "thing": [34, 57, 89], "think": [69, 80], "third": [79, 87], "those": 88, "thought": [1, 2, 4, 7, 8, 15, 80], "thread": [30, 31, 61], "three": [0, 25, 75, 77, 94], "thrive": 91, "through": [73, 79, 80, 82, 83, 84, 86, 89], "throw": 88, "thrown": 88, "tht": 15, "thu": 83, "ti": [34, 55], "time": [1, 9, 15, 34, 36, 59, 60, 62, 73, 80, 85, 86, 87, 89, 90, 91], "timeout": [1, 2, 7, 9, 16, 20, 23, 30, 31, 33, 34, 36, 56, 58, 62, 69], "timeouterror": [1, 9], "timer": 60, "timestamp": [15, 81, 86], "titl": [34, 55, 57, 91], "to_all_continu": 80, "to_all_r": 80, "to_all_vot": 80, "to_dialog_str": 64, "to_dict": [16, 24], "to_dist": [1, 2, 89], "to_list": [16, 24], "to_mem": [12, 13, 14, 86], "to_openai_dict": 64, "to_seer": 80, "to_seer_result": 80, "to_str": [15, 86], "to_witch_resurrect": 80, "to_wolv": 80, "to_wolves_r": 80, "to_wolves_vot": 80, "todai": [16, 18, 87], "todo": [1, 8, 13, 29], "togeth": 80, "toke": 20, "token": [34, 53, 63, 88], "token_limit_prompt": [34, 53], "token_num": 88, "token_num_us": 88, "toler": [75, 77, 94], "tongyi": [16, 18], "tongyi_chat": [16, 18], "tonight": 80, "too": [10, 29, 34, 49, 50], "took": 79, "tool": [1, 6, 34, 45, 77, 78, 85], "top": [34, 43, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91], "top_k": [12, 14, 34, 43], "topic": 80, "topolog": 72, "total": [16, 22, 80, 88], "touch": 81, "townsfolk": 80, "trace": [0, 59, 61, 81], "track": [73, 81, 88], "tracker": 91, "transact": 62, "transform": 84, "transmiss": 77, "travers": 73, "treat": [1, 4, 87], "trigger": [26, 27, 28, 59, 62], "true": [0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 26, 27, 28, 34, 43, 58, 79, 80, 82, 83, 86, 89], "truncat": [10, 29], "try": [80, 82, 85, 86, 88], "tupl": [1, 2, 3, 4, 6, 7, 8, 9, 34, 41, 45], "turbo": [20, 79, 80, 84, 88], "turn": [34, 45, 80], "tutori": [77, 79, 80, 81, 82, 85, 86, 88, 89], "two": [34, 36, 43, 44, 55, 57, 79, 80, 83, 84, 85, 86, 87, 89], "txt": 41, "type": [1, 2, 3, 4, 6, 7, 9, 12, 14, 16, 18, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30, 31, 34, 36, 37, 39, 40, 41, 43, 44, 45, 49, 50, 51, 53, 55, 56, 57, 58, 59, 60, 62, 72, 73, 79, 82, 83, 84, 85, 86], "typic": [34, 40, 82, 86], "u": [16, 19, 34, 57, 80, 85, 90, 91], "ui": [65, 68, 69], "uid": [61, 68, 69], "under": [29, 78, 81, 84, 88], "underli": 87, "underpin": 82, "understand": [34, 45, 81, 83, 85, 92], "undetect": 80, "unexpect": 81, "unfold": 80, "unifi": [0, 82, 85, 87], "unintend": 83, "union": [0, 1, 2, 7, 9, 12, 14, 15, 16, 18, 19, 21, 22, 23, 25, 34, 36, 82, 83, 86], "uniqu": [1, 2, 34, 57, 59, 62, 73, 79, 82, 86, 88], "unit": [12, 14, 15, 59, 62, 88], "unittest": [59, 62, 77], "unix": [34, 36, 60], "unless": 80, "unlik": 86, "unlock": 80, "unoccupi": 7, "unset": 79, "until": [79, 80, 83], "untrust": [34, 36], "up": [71, 78, 88, 90], "updat": [16, 19, 20, 59, 62, 80, 82, 86, 87, 90], "update_alive_play": 80, "update_config": [12, 13], "update_monitor": [16, 20], "update_valu": 15, "upon": [83, 86], "url": [1, 9, 15, 16, 18, 23, 24, 34, 56, 58, 60, 77, 79, 82, 85, 86, 87], "url_to_png1": 87, "url_to_png2": 87, "url_to_png3": 87, "urlpars": 58, "us": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 34, 36, 37, 43, 45, 46, 49, 50, 51, 53, 57, 58, 59, 62, 67, 69, 72, 73, 75, 77, 79, 80, 81, 82, 83, 84, 86, 87, 89, 91, 92, 94], "usabl": 77, "usag": [1, 4, 15, 34, 57, 59, 62, 77, 79, 80, 82, 86, 92], "use_dock": [34, 36], "use_memori": [1, 2, 3, 4, 8, 80, 82], "user": [1, 3, 4, 9, 15, 16, 18, 19, 29, 34, 43, 50, 53, 68, 69, 75, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 90, 94], "user_ag": 79, "user_agent_config": 82, "user_input": [69, 87], "user_messag": 87, "user_proxy_ag": 82, "userag": [1, 7, 9, 73, 79], "useragentnod": 73, "usernam": [34, 50, 85, 91], "util": [74, 75, 77, 79, 80, 81, 85, 88], "uuid": 69, "uuid4": 86, "v1": [34, 57, 84], "v2": 84, "valid": [1, 4, 58, 72], "valu": [0, 1, 7, 10, 12, 14, 15, 16, 20, 29, 30, 31, 34, 47, 59, 61, 62, 73, 85, 86, 87, 88], "valueerror": 72, "variabl": [16, 19, 22, 34, 55, 57, 68, 79, 80, 84, 87], "varieti": [34, 57, 77, 80], "variou": [34, 36, 46, 72, 75, 82, 84, 85, 87, 88, 94], "ve": [80, 91], "vector": [12, 14], "verbos": [1, 6], "veri": [0, 25, 34, 37], "version": [1, 2, 26, 27, 34, 53, 89, 91], "versu": 83, "vertex": [16, 19], "via": [1, 4, 79, 80, 81], "video": [15, 34, 46, 77, 79, 82, 85, 86], "villag": 80, "vim": [34, 37], "virtual": [82, 95], "visual": 81, "vl": [16, 18, 84, 87], "vllm": [16, 23, 80, 84], "voic": 82, "vote": 80, "vote_r": 80, "wa": 86, "wai": [15, 81, 86, 88, 89], "wait": [1, 7, 89, 91], "wait_for_readi": 33, "wait_until_termin": [1, 7, 89], "want": [34, 37, 88], "wanx": 84, "warn": [0, 34, 36, 59, 61, 81], "watch": 90, "we": [0, 1, 4, 6, 15, 16, 18, 19, 25, 29, 34, 43, 46, 49, 77, 78, 79, 80, 81, 82, 83, 84, 85, 87, 89, 90, 91], "weather": 87, "web": [0, 34, 75, 77, 81, 85, 86], "web_text_or_url": [34, 58], "webpag": [34, 58], "websit": [1, 9, 15, 79, 82, 86], "webui": [75, 77, 94, 95], "welcom": [16, 19, 80, 81, 90, 91], "well": [34, 45, 53, 80, 85], "werewolf": [1, 4], "werewolv": 80, "what": [0, 16, 18, 25, 34, 57, 79, 87, 95], "when": [0, 1, 2, 4, 7, 10, 15, 16, 18, 23, 24, 26, 27, 28, 29, 34, 36, 37, 45, 59, 62, 72, 73, 77, 80, 81, 84, 85, 86, 87, 88, 89, 91], "where": [1, 4, 15, 16, 18, 19, 21, 22, 23, 34, 39, 40, 41, 58, 60, 72, 73, 79, 80, 82, 83, 86, 87, 89], "whether": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 16, 26, 27, 28, 34, 36, 40, 41, 43, 50, 51, 53, 58, 59, 60, 62, 69, 74, 80, 86, 88, 89, 91], "which": [0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 26, 27, 28, 30, 31, 34, 45, 55, 57, 59, 60, 61, 62, 73, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89], "while": [26, 28, 34, 45, 73, 79, 80, 81, 83, 85, 89], "whilelooppipelin": [26, 27, 28], "whilelooppipelinenod": 73, "who": [15, 34, 57, 78, 80, 84, 86], "whose": [72, 87], "why": 95, "wide": 89, "win": 80, "window": [34, 36, 78], "witch": 80, "witch_nam": 80, "within": [1, 6, 34, 36, 49, 50, 51, 73, 77, 79, 80, 82, 83, 86], "without": [0, 1, 2, 7, 25, 73, 80, 82, 83, 87, 89], "wolf": 80, "wolv": 80, "won": 80, "wonder": [16, 18], "work": [34, 39, 43, 60, 80, 86, 87, 91], "workflow": [26, 28, 72, 73, 74, 89], "workflownod": 73, "workflownodetyp": 73, "world": 81, "worri": 89, "worth": 83, "would": 80, "wrap": [1, 2, 16, 19, 34, 46, 85], "wrapper": [1, 7, 16, 18, 19, 20, 21, 22, 23, 77, 85, 87, 92], "write": [12, 14, 34, 39, 41, 60, 73, 85, 89, 91], "write_fil": 60, "write_json_fil": [34, 40, 85], "write_text_fil": [34, 41, 85], "writetextservicenod": 73, "written": [34, 40, 41, 60, 85], "wrong": 81, "www": [34, 57], "x": [1, 2, 3, 4, 6, 7, 8, 9, 15, 26, 27, 28, 30, 31, 79, 80, 82, 83, 85, 89], "x1": [0, 25], "x2": [0, 25], "x_in": 72, "xxx": [79, 80, 84, 85], "xxx1": 87, "xxx2": 87, "xxxxx": [34, 58], "yet": [34, 37, 89], "yield": 62, "you": [1, 6, 12, 14, 15, 16, 18, 19, 20, 21, 29, 34, 36, 37, 53, 58, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91], "your": [1, 3, 6, 15, 20, 34, 57, 59, 62, 75, 78, 79, 85, 88, 90, 92, 94, 95], "your_api_kei": [20, 84], "your_config_nam": 84, "your_cse_id": [34, 57], "your_google_api_kei": [34, 57], "your_organ": [20, 84], "your_save_path": 81, "yourag": 85, "yyi": 84, "zero": [88, 89], "zh": [16, 18], "\u7701\u7565\u4ee3\u7801\u4ee5\u7b80\u5316": 86, "\u9489\u9489": 93}, "titles": ["agentscope", "agentscope.agents", "agentscope.agents.agent", "agentscope.agents.dialog_agent", "agentscope.agents.dict_dialog_agent", "agentscope.agents.operator", "agentscope.agents.react_agent", "agentscope.agents.rpc_agent", "agentscope.agents.text_to_image_agent", "agentscope.agents.user_agent", "agentscope.constants", "agentscope.file_manager", "agentscope.memory", "agentscope.memory.memory", "agentscope.memory.temporary_memory", "agentscope.message", "agentscope.models", "agentscope.models.config", "agentscope.models.dashscope_model", "agentscope.models.gemini_model", "agentscope.models.model", "agentscope.models.ollama_model", "agentscope.models.openai_model", "agentscope.models.post_model", "agentscope.models.response", "agentscope.msghub", "agentscope.pipelines", "agentscope.pipelines.functional", "agentscope.pipelines.pipeline", "agentscope.prompt", "agentscope.rpc", "agentscope.rpc.rpc_agent_client", "agentscope.rpc.rpc_agent_pb2", "agentscope.rpc.rpc_agent_pb2_grpc", "agentscope.service", "agentscope.service.execute_code", "agentscope.service.execute_code.exec_python", "agentscope.service.execute_code.exec_shell", "agentscope.service.file", "agentscope.service.file.common", "agentscope.service.file.json", "agentscope.service.file.text", "agentscope.service.retrieval", "agentscope.service.retrieval.retrieval_from_list", "agentscope.service.retrieval.similarity", "agentscope.service.service_factory", "agentscope.service.service_response", "agentscope.service.service_status", "agentscope.service.sql_query", "agentscope.service.sql_query.mongodb", "agentscope.service.sql_query.mysql", "agentscope.service.sql_query.sqlite", "agentscope.service.text_processing", "agentscope.service.text_processing.summarization", "agentscope.service.web", "agentscope.service.web.arxiv", "agentscope.service.web.download", "agentscope.service.web.search", "agentscope.service.web.web_digest", "agentscope.utils", "agentscope.utils.common", "agentscope.utils.logging_utils", "agentscope.utils.monitor", "agentscope.utils.token_utils", "agentscope.utils.tools", "agentscope.web", "agentscope.web.studio", "agentscope.web.studio.constants", "agentscope.web.studio.studio", "agentscope.web.studio.utils", "agentscope.web.workstation", "agentscope.web.workstation.workflow", "agentscope.web.workstation.workflow_dag", "agentscope.web.workstation.workflow_node", "agentscope.web.workstation.workflow_utils", "AgentScope Documentation", "agentscope", "About AgentScope", "Installation", "Quick Start", "Crafting Your First Application", "Logging and WebUI", "Customizing Your Own Agent", "Pipeline and MsgHub", "Model", "Service", "Memory", "Prompt Engineering", "Monitor", "Distribution", "Joining AgentScope Community", "Contribute to AgentScope", "Advanced Exploration", "Get Involved", "Welcome to AgentScope Tutorial Hub", "Getting Started"], "titleterms": {"1": [80, 89], "2": [80, 89], "3": 80, "4": 80, "5": 80, "For": 91, "Will": 87, "about": [77, 85, 86, 87, 89], "actor": 89, "ad": 83, "advanc": [75, 88, 92, 94], "agent": [1, 2, 3, 4, 5, 6, 7, 8, 9, 77, 79, 80, 82, 89], "agentbas": 82, "agentpool": 82, "agentscop": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 88, 90, 91, 94], "an": 88, "api": [75, 80, 84, 88], "applic": [80, 89], "arxiv": 55, "ask": 91, "basic": [84, 88], "branch": 91, "broadcast": 83, "budget": 88, "bug": 91, "build": 84, "built": [85, 87], "categori": 83, "challeng": 87, "chang": 91, "chat": 81, "class": [86, 87], "clone": 91, "code": [77, 91], "codebas": 91, "combin": 83, "commit": 91, "common": [39, 60], "commun": 90, "compon": 87, "concept": 77, "conda": 78, "config": [17, 80], "configur": 84, "constant": [10, 67], "construct": 87, "contribut": 91, "convers": 79, "craft": 80, "creat": [78, 79, 83, 84, 89, 91], "custom": 82, "dashscop": 84, "dashscope_model": 18, "dashscopechatwrapp": 87, "dashscopemultimodalwrapp": 87, "defin": 80, "delet": 83, "deprec": 87, "design": 77, "detail": 84, "dialog_ag": 3, "dialogag": 82, "dict_dialog_ag": 4, "dingtalk": 90, "discord": 90, "distinguish": 88, "distribut": 89, "document": 75, "download": 56, "dynam": 87, "each": 80, "engin": 87, "environ": 78, "exampl": 85, "exec_python": 36, "exec_shel": 37, "execute_cod": [35, 36, 37], "explor": [75, 82, 92, 94], "factori": 85, "featur": [87, 91], "file": [38, 39, 40, 41], "file_manag": 11, "first": 80, "flow": 89, "fork": 91, "forlooppipelin": 83, "format": [84, 87], "from": [78, 82, 84], "function": [27, 85], "futur": 87, "game": 80, "gemini": 84, "gemini_model": 19, "geminichatwrapp": 87, "get": [75, 80, 88, 93, 94, 95], "github": 90, "handl": 88, "how": [77, 85], "hub": [75, 94], "i": 77, "ifelsepipelin": 83, "implement": [80, 89], "indic": 75, "inform": 81, "initi": [80, 87], "instal": 78, "instanc": 88, "integr": 81, "involv": [75, 93, 94], "join": [87, 90], "json": 40, "kei": [77, 87], "leverag": 80, "list": 87, "log": 81, "logger": 81, "logging_util": 61, "logic": 80, "make": 91, "master": 89, "memori": [12, 13, 14, 86], "memorybas": 86, "messag": [15, 77, 81, 83, 86], "messagebas": 86, "metric": 88, "mode": 89, "model": [16, 17, 18, 19, 20, 21, 22, 23, 24, 79, 80, 84, 89], "mongodb": 49, "monitor": [62, 88], "msg": 86, "msghub": [25, 80, 83], "mysql": 50, "navig": [75, 94], "new": 91, "next": 80, "note": 81, "ollama": 84, "ollama_model": 21, "ollamachatwrapp": 87, "ollamagenerationwrapp": 87, "openai": 84, "openai_model": 22, "openaichatwrapp": 87, "oper": 5, "orchestr": 89, "output": 87, "own": [82, 84], "paramet": 84, "particip": 83, "peer": 89, "pip": 78, "pipelin": [26, 27, 28, 80, 83], "placehold": 89, "post": 84, "post_model": 23, "prefix": 88, "prepar": [79, 80], "prompt": [29, 87], "promptengin": 87, "pull": 91, "quick": [79, 81], "quota": 88, "react_ag": 6, "refer": 75, "regist": 88, "remov": 88, "report": 91, "repositori": 91, "request": [84, 91], "reset": 88, "respons": 24, "retriev": [42, 43, 44, 88], "retrieval_from_list": 43, "review": 91, "role": 80, "rpc": [30, 31, 32, 33], "rpc_agent": 7, "rpc_agent_cli": 31, "rpc_agent_pb2": 32, "rpc_agent_pb2_grpc": 33, "run": [80, 81], "scratch": 84, "search": 57, "sequentialpipelin": 83, "servic": [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 77, 84, 85], "service_factori": 45, "service_respons": 46, "service_statu": 47, "servicerespons": 85, "set": [80, 81], "similar": 44, "slave": 89, "sourc": 78, "sql_queri": [48, 49, 50, 51], "sqlite": 51, "start": [75, 79, 80, 94, 95], "step": [80, 89], "step1": 79, "step2": 79, "step3": 79, "strategi": 87, "string": 87, "structur": 77, "studio": [66, 67, 68, 69], "submit": 91, "summar": 53, "support": 84, "switchpipelin": 83, "system": 81, "tabl": 75, "temporary_memori": 14, "temporarymemori": 86, "text": 41, "text_process": [52, 53], "text_to_image_ag": 8, "token_util": 63, "tool": 64, "tutori": [75, 94], "type": 87, "understand": [82, 88], "up": [80, 81], "updat": 88, "us": [78, 85, 88], "usag": [83, 88, 89], "user_ag": 9, "userag": 82, "util": [59, 60, 61, 62, 63, 64, 69], "virtual": 78, "virtualenv": 78, "wai": 87, "web": [54, 55, 56, 57, 58, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], "web_digest": 58, "webui": 81, "welcom": [75, 94], "werewolf": 80, "what": 77, "whilelooppipelin": 83, "why": 77, "workflow": [71, 77], "workflow_dag": 72, "workflow_nod": 73, "workflow_util": 74, "workstat": [70, 71, 72, 73, 74], "wrapper": 84, "your": [80, 82, 84, 91], "\u9489\u9489": 90}}) \ No newline at end of file diff --git a/en/tutorial/101-agentscope.html b/en/tutorial/101-agentscope.html index 6124609d3..472a0033c 100644 --- a/en/tutorial/101-agentscope.html +++ b/en/tutorial/101-agentscope.html @@ -65,15 +65,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/102-installation.html b/en/tutorial/102-installation.html index 6b68698cb..a88607a91 100644 --- a/en/tutorial/102-installation.html +++ b/en/tutorial/102-installation.html @@ -65,15 +65,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/103-example.html b/en/tutorial/103-example.html index 42a67e4a4..eb41bcdd3 100644 --- a/en/tutorial/103-example.html +++ b/en/tutorial/103-example.html @@ -65,15 +65,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/104-usecase.html b/en/tutorial/104-usecase.html index 70d35c046..e4f02e1d6 100644 --- a/en/tutorial/104-usecase.html +++ b/en/tutorial/104-usecase.html @@ -65,15 +65,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/105-logging.html b/en/tutorial/105-logging.html index e10a0e0e1..19f483a08 100644 --- a/en/tutorial/105-logging.html +++ b/en/tutorial/105-logging.html @@ -65,15 +65,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/201-agent.html b/en/tutorial/201-agent.html index 46ccc8c42..d37ec832b 100644 --- a/en/tutorial/201-agent.html +++ b/en/tutorial/201-agent.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/202-pipeline.html b/en/tutorial/202-pipeline.html index 110c9ef9e..a85337424 100644 --- a/en/tutorial/202-pipeline.html +++ b/en/tutorial/202-pipeline.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/203-model.html b/en/tutorial/203-model.html index 9415e7a59..f39d2bf3b 100644 --- a/en/tutorial/203-model.html +++ b/en/tutorial/203-model.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/204-service.html b/en/tutorial/204-service.html index 5c27a7647..083b7cdc6 100644 --- a/en/tutorial/204-service.html +++ b/en/tutorial/204-service.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/205-memory.html b/en/tutorial/205-memory.html index a9439ede0..e51108422 100644 --- a/en/tutorial/205-memory.html +++ b/en/tutorial/205-memory.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/206-prompt.html b/en/tutorial/206-prompt.html index 9c38830a1..e4468acc1 100644 --- a/en/tutorial/206-prompt.html +++ b/en/tutorial/206-prompt.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/207-monitor.html b/en/tutorial/207-monitor.html index 757d12ec2..64c92c401 100644 --- a/en/tutorial/207-monitor.html +++ b/en/tutorial/207-monitor.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/208-distribute.html b/en/tutorial/208-distribute.html index 60fc2efdc..86f661841 100644 --- a/en/tutorial/208-distribute.html +++ b/en/tutorial/208-distribute.html @@ -70,15 +70,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/301-community.html b/en/tutorial/301-community.html index 630e21219..e8aecae5f 100644 --- a/en/tutorial/301-community.html +++ b/en/tutorial/301-community.html @@ -62,15 +62,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/302-contribute.html b/en/tutorial/302-contribute.html index f7722aa06..ba4b0e721 100644 --- a/en/tutorial/302-contribute.html +++ b/en/tutorial/302-contribute.html @@ -23,7 +23,7 @@ - + @@ -62,15 +62,17 @@

    AgentScope API Reference

    @@ -167,7 +169,7 @@

    Code Review - +


    diff --git a/en/tutorial/advance.html b/en/tutorial/advance.html index 4cd89764f..1aa1b4e66 100644 --- a/en/tutorial/advance.html +++ b/en/tutorial/advance.html @@ -68,15 +68,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/contribute.html b/en/tutorial/contribute.html index 53c9abb89..747cfe429 100644 --- a/en/tutorial/contribute.html +++ b/en/tutorial/contribute.html @@ -62,15 +62,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/main.html b/en/tutorial/main.html index 302bfc689..05b082d24 100644 --- a/en/tutorial/main.html +++ b/en/tutorial/main.html @@ -56,15 +56,17 @@

    AgentScope API Reference

    diff --git a/en/tutorial/quick_start.html b/en/tutorial/quick_start.html index e27d52f79..f86cbe771 100644 --- a/en/tutorial/quick_start.html +++ b/en/tutorial/quick_start.html @@ -65,15 +65,17 @@

    AgentScope API Reference

    diff --git a/zh_CN/.doctrees/agentscope.agents.agent.doctree b/zh_CN/.doctrees/agentscope.agents.agent.doctree new file mode 100644 index 000000000..019e34d93 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.agent.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.dialog_agent.doctree b/zh_CN/.doctrees/agentscope.agents.dialog_agent.doctree new file mode 100644 index 000000000..dd8f078f1 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.dialog_agent.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.dict_dialog_agent.doctree b/zh_CN/.doctrees/agentscope.agents.dict_dialog_agent.doctree new file mode 100644 index 000000000..c23f548fc Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.dict_dialog_agent.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.doctree b/zh_CN/.doctrees/agentscope.agents.doctree index 9813f81de..88db80c93 100644 Binary files a/zh_CN/.doctrees/agentscope.agents.doctree and b/zh_CN/.doctrees/agentscope.agents.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.operator.doctree b/zh_CN/.doctrees/agentscope.agents.operator.doctree new file mode 100644 index 000000000..0469cf8cb Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.operator.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.react_agent.doctree b/zh_CN/.doctrees/agentscope.agents.react_agent.doctree new file mode 100644 index 000000000..a9d805503 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.react_agent.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.rpc_agent.doctree b/zh_CN/.doctrees/agentscope.agents.rpc_agent.doctree new file mode 100644 index 000000000..5c2b64f83 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.rpc_agent.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.text_to_image_agent.doctree b/zh_CN/.doctrees/agentscope.agents.text_to_image_agent.doctree new file mode 100644 index 000000000..132629a88 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.text_to_image_agent.doctree differ diff --git a/zh_CN/.doctrees/agentscope.agents.user_agent.doctree b/zh_CN/.doctrees/agentscope.agents.user_agent.doctree new file mode 100644 index 000000000..b55ee4bfd Binary files /dev/null and b/zh_CN/.doctrees/agentscope.agents.user_agent.doctree differ diff --git a/zh_CN/.doctrees/agentscope.constants.doctree b/zh_CN/.doctrees/agentscope.constants.doctree new file mode 100644 index 000000000..355710fa5 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.constants.doctree differ diff --git a/zh_CN/.doctrees/agentscope.file_manager.doctree b/zh_CN/.doctrees/agentscope.file_manager.doctree new file mode 100644 index 000000000..479af1816 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.file_manager.doctree differ diff --git a/zh_CN/.doctrees/agentscope.memory.doctree b/zh_CN/.doctrees/agentscope.memory.doctree index 8301aeb52..72597ac40 100644 Binary files a/zh_CN/.doctrees/agentscope.memory.doctree and b/zh_CN/.doctrees/agentscope.memory.doctree differ diff --git a/zh_CN/.doctrees/agentscope.memory.memory.doctree b/zh_CN/.doctrees/agentscope.memory.memory.doctree new file mode 100644 index 000000000..19d490ea5 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.memory.memory.doctree differ diff --git a/zh_CN/.doctrees/agentscope.memory.temporary_memory.doctree b/zh_CN/.doctrees/agentscope.memory.temporary_memory.doctree new file mode 100644 index 000000000..b1aaeb46d Binary files /dev/null and b/zh_CN/.doctrees/agentscope.memory.temporary_memory.doctree differ diff --git a/zh_CN/.doctrees/agentscope.message.doctree b/zh_CN/.doctrees/agentscope.message.doctree new file mode 100644 index 000000000..e8172f0b1 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.message.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.config.doctree b/zh_CN/.doctrees/agentscope.models.config.doctree new file mode 100644 index 000000000..6b5dc39f5 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.config.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.dashscope_model.doctree b/zh_CN/.doctrees/agentscope.models.dashscope_model.doctree new file mode 100644 index 000000000..687e348aa Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.dashscope_model.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.doctree b/zh_CN/.doctrees/agentscope.models.doctree index 753ad70f2..30a8d59bb 100644 Binary files a/zh_CN/.doctrees/agentscope.models.doctree and b/zh_CN/.doctrees/agentscope.models.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.gemini_model.doctree b/zh_CN/.doctrees/agentscope.models.gemini_model.doctree new file mode 100644 index 000000000..76cf7332d Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.gemini_model.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.model.doctree b/zh_CN/.doctrees/agentscope.models.model.doctree new file mode 100644 index 000000000..15bcb6d72 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.model.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.ollama_model.doctree b/zh_CN/.doctrees/agentscope.models.ollama_model.doctree new file mode 100644 index 000000000..4e1974b6e Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.ollama_model.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.openai_model.doctree b/zh_CN/.doctrees/agentscope.models.openai_model.doctree new file mode 100644 index 000000000..42b2246da Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.openai_model.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.post_model.doctree b/zh_CN/.doctrees/agentscope.models.post_model.doctree new file mode 100644 index 000000000..eec092a0b Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.post_model.doctree differ diff --git a/zh_CN/.doctrees/agentscope.models.response.doctree b/zh_CN/.doctrees/agentscope.models.response.doctree new file mode 100644 index 000000000..08ea4e53d Binary files /dev/null and b/zh_CN/.doctrees/agentscope.models.response.doctree differ diff --git a/zh_CN/.doctrees/agentscope.msghub.doctree b/zh_CN/.doctrees/agentscope.msghub.doctree new file mode 100644 index 000000000..1db82037b Binary files /dev/null and b/zh_CN/.doctrees/agentscope.msghub.doctree differ diff --git a/zh_CN/.doctrees/agentscope.pipelines.doctree b/zh_CN/.doctrees/agentscope.pipelines.doctree index f651416bd..fbdbacffd 100644 Binary files a/zh_CN/.doctrees/agentscope.pipelines.doctree and b/zh_CN/.doctrees/agentscope.pipelines.doctree differ diff --git a/zh_CN/.doctrees/agentscope.pipelines.functional.doctree b/zh_CN/.doctrees/agentscope.pipelines.functional.doctree new file mode 100644 index 000000000..14a6e1a8c Binary files /dev/null and b/zh_CN/.doctrees/agentscope.pipelines.functional.doctree differ diff --git a/zh_CN/.doctrees/agentscope.pipelines.pipeline.doctree b/zh_CN/.doctrees/agentscope.pipelines.pipeline.doctree new file mode 100644 index 000000000..2f8f438ca Binary files /dev/null and b/zh_CN/.doctrees/agentscope.pipelines.pipeline.doctree differ diff --git a/zh_CN/.doctrees/agentscope.prompt.doctree b/zh_CN/.doctrees/agentscope.prompt.doctree new file mode 100644 index 000000000..ffd83ff77 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.prompt.doctree differ diff --git a/zh_CN/.doctrees/agentscope.rpc.doctree b/zh_CN/.doctrees/agentscope.rpc.doctree index 951e5ed0e..736a9f0cc 100644 Binary files a/zh_CN/.doctrees/agentscope.rpc.doctree and b/zh_CN/.doctrees/agentscope.rpc.doctree differ diff --git a/zh_CN/.doctrees/agentscope.rpc.rpc_agent_client.doctree b/zh_CN/.doctrees/agentscope.rpc.rpc_agent_client.doctree new file mode 100644 index 000000000..93ffc8b62 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.rpc.rpc_agent_client.doctree differ diff --git a/zh_CN/.doctrees/agentscope.rpc.rpc_agent_pb2.doctree b/zh_CN/.doctrees/agentscope.rpc.rpc_agent_pb2.doctree new file mode 100644 index 000000000..c7cafa795 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.rpc.rpc_agent_pb2.doctree differ diff --git a/zh_CN/.doctrees/agentscope.rpc.rpc_agent_pb2_grpc.doctree b/zh_CN/.doctrees/agentscope.rpc.rpc_agent_pb2_grpc.doctree new file mode 100644 index 000000000..4fc2980d8 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.rpc.rpc_agent_pb2_grpc.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.doctree b/zh_CN/.doctrees/agentscope.service.doctree index 0e3bee969..17989ffec 100644 Binary files a/zh_CN/.doctrees/agentscope.service.doctree and b/zh_CN/.doctrees/agentscope.service.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.execute_code.exec_python.doctree b/zh_CN/.doctrees/agentscope.service.execute_code.exec_python.doctree new file mode 100644 index 000000000..eb570c03c Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.execute_code.exec_python.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.execute_code.exec_shell.doctree b/zh_CN/.doctrees/agentscope.service.execute_code.exec_shell.doctree new file mode 100644 index 000000000..7b57c1fe4 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.execute_code.exec_shell.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.file.common.doctree b/zh_CN/.doctrees/agentscope.service.file.common.doctree new file mode 100644 index 000000000..11580d6c5 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.file.common.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.file.json.doctree b/zh_CN/.doctrees/agentscope.service.file.json.doctree new file mode 100644 index 000000000..3f305541d Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.file.json.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.file.text.doctree b/zh_CN/.doctrees/agentscope.service.file.text.doctree new file mode 100644 index 000000000..d601881bc Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.file.text.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.retrieval.retrieval_from_list.doctree b/zh_CN/.doctrees/agentscope.service.retrieval.retrieval_from_list.doctree new file mode 100644 index 000000000..4f0363d65 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.retrieval.retrieval_from_list.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.retrieval.similarity.doctree b/zh_CN/.doctrees/agentscope.service.retrieval.similarity.doctree new file mode 100644 index 000000000..57eac9229 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.retrieval.similarity.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.service_factory.doctree b/zh_CN/.doctrees/agentscope.service.service_factory.doctree new file mode 100644 index 000000000..39c2bac3f Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.service_factory.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.service_response.doctree b/zh_CN/.doctrees/agentscope.service.service_response.doctree new file mode 100644 index 000000000..e1b1188c6 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.service_response.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.service_status.doctree b/zh_CN/.doctrees/agentscope.service.service_status.doctree new file mode 100644 index 000000000..d4c8527d3 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.service_status.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.sql_query.mongodb.doctree b/zh_CN/.doctrees/agentscope.service.sql_query.mongodb.doctree new file mode 100644 index 000000000..dca86a372 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.sql_query.mongodb.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.sql_query.mysql.doctree b/zh_CN/.doctrees/agentscope.service.sql_query.mysql.doctree new file mode 100644 index 000000000..155455d30 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.sql_query.mysql.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.sql_query.sqlite.doctree b/zh_CN/.doctrees/agentscope.service.sql_query.sqlite.doctree new file mode 100644 index 000000000..b9da4502c Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.sql_query.sqlite.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.text_processing.summarization.doctree b/zh_CN/.doctrees/agentscope.service.text_processing.summarization.doctree new file mode 100644 index 000000000..0e1a8536a Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.text_processing.summarization.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.web.arxiv.doctree b/zh_CN/.doctrees/agentscope.service.web.arxiv.doctree new file mode 100644 index 000000000..5b3fe0687 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.web.arxiv.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.web.download.doctree b/zh_CN/.doctrees/agentscope.service.web.download.doctree new file mode 100644 index 000000000..90f11cf84 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.web.download.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.web.search.doctree b/zh_CN/.doctrees/agentscope.service.web.search.doctree new file mode 100644 index 000000000..60b0a584b Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.web.search.doctree differ diff --git a/zh_CN/.doctrees/agentscope.service.web.web_digest.doctree b/zh_CN/.doctrees/agentscope.service.web.web_digest.doctree new file mode 100644 index 000000000..413597a72 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.service.web.web_digest.doctree differ diff --git a/zh_CN/.doctrees/agentscope.utils.common.doctree b/zh_CN/.doctrees/agentscope.utils.common.doctree new file mode 100644 index 000000000..be9986d87 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.utils.common.doctree differ diff --git a/zh_CN/.doctrees/agentscope.utils.doctree b/zh_CN/.doctrees/agentscope.utils.doctree index 60a65dfff..72ec0a15a 100644 Binary files a/zh_CN/.doctrees/agentscope.utils.doctree and b/zh_CN/.doctrees/agentscope.utils.doctree differ diff --git a/zh_CN/.doctrees/agentscope.utils.logging_utils.doctree b/zh_CN/.doctrees/agentscope.utils.logging_utils.doctree new file mode 100644 index 000000000..bbcab54d4 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.utils.logging_utils.doctree differ diff --git a/zh_CN/.doctrees/agentscope.utils.monitor.doctree b/zh_CN/.doctrees/agentscope.utils.monitor.doctree new file mode 100644 index 000000000..84f4d8eee Binary files /dev/null and b/zh_CN/.doctrees/agentscope.utils.monitor.doctree differ diff --git a/zh_CN/.doctrees/agentscope.utils.token_utils.doctree b/zh_CN/.doctrees/agentscope.utils.token_utils.doctree new file mode 100644 index 000000000..a2b01716c Binary files /dev/null and b/zh_CN/.doctrees/agentscope.utils.token_utils.doctree differ diff --git a/zh_CN/.doctrees/agentscope.utils.tools.doctree b/zh_CN/.doctrees/agentscope.utils.tools.doctree new file mode 100644 index 000000000..720cd7211 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.utils.tools.doctree differ diff --git a/zh_CN/.doctrees/agentscope.web.studio.constants.doctree b/zh_CN/.doctrees/agentscope.web.studio.constants.doctree new file mode 100644 index 000000000..7ee2e3465 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.web.studio.constants.doctree differ diff --git a/zh_CN/.doctrees/agentscope.web.studio.studio.doctree b/zh_CN/.doctrees/agentscope.web.studio.studio.doctree new file mode 100644 index 000000000..b1e6df005 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.web.studio.studio.doctree differ diff --git a/zh_CN/.doctrees/agentscope.web.studio.utils.doctree b/zh_CN/.doctrees/agentscope.web.studio.utils.doctree new file mode 100644 index 000000000..ba266e07a Binary files /dev/null and b/zh_CN/.doctrees/agentscope.web.studio.utils.doctree differ diff --git a/zh_CN/.doctrees/agentscope.web.workstation.workflow.doctree b/zh_CN/.doctrees/agentscope.web.workstation.workflow.doctree new file mode 100644 index 000000000..92296af22 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.web.workstation.workflow.doctree differ diff --git a/zh_CN/.doctrees/agentscope.web.workstation.workflow_dag.doctree b/zh_CN/.doctrees/agentscope.web.workstation.workflow_dag.doctree new file mode 100644 index 000000000..1ceba0034 Binary files /dev/null and b/zh_CN/.doctrees/agentscope.web.workstation.workflow_dag.doctree differ diff --git a/zh_CN/.doctrees/agentscope.web.workstation.workflow_node.doctree b/zh_CN/.doctrees/agentscope.web.workstation.workflow_node.doctree new file mode 100644 index 000000000..b2e40b1dd Binary files /dev/null and b/zh_CN/.doctrees/agentscope.web.workstation.workflow_node.doctree differ diff --git a/zh_CN/.doctrees/agentscope.web.workstation.workflow_utils.doctree b/zh_CN/.doctrees/agentscope.web.workstation.workflow_utils.doctree new file mode 100644 index 000000000..95a34045b Binary files /dev/null and b/zh_CN/.doctrees/agentscope.web.workstation.workflow_utils.doctree differ diff --git a/zh_CN/.doctrees/environment.pickle b/zh_CN/.doctrees/environment.pickle index 4c5218c59..5d896e87e 100644 Binary files a/zh_CN/.doctrees/environment.pickle and b/zh_CN/.doctrees/environment.pickle differ diff --git a/zh_CN/.doctrees/index.doctree b/zh_CN/.doctrees/index.doctree index ee6965334..b578558c9 100644 Binary files a/zh_CN/.doctrees/index.doctree and b/zh_CN/.doctrees/index.doctree differ diff --git a/zh_CN/_modules/agentscope/_init.html b/zh_CN/_modules/agentscope/_init.html index c0a8b15e2..8fde1edd1 100644 --- a/zh_CN/_modules/agentscope/_init.html +++ b/zh_CN/_modules/agentscope/_init.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    diff --git a/zh_CN/_modules/agentscope/agents/agent.html b/zh_CN/_modules/agentscope/agents/agent.html index 0941c604f..d1d574787 100644 --- a/zh_CN/_modules/agentscope/agents/agent.html +++ b/zh_CN/_modules/agentscope/agents/agent.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -121,7 +123,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] class AgentBase(Operator, metaclass=_RecordInitSettingMeta): """Base class for all agents. @@ -131,6 +133,8 @@

    agentscope.agents.agent 源代码

     
         _version: int = 1
     
    +
    +[文档] def __init__( self, name: str, @@ -175,10 +179,11 @@

    agentscope.agents.agent 源代码

     
             # The audience of this agent, which means if this agent generates a
             # response, it will be passed to all agents in the audience.
    -        self._audience = None
    +        self._audience = None
    +
    -[文档] +[文档] @classmethod def generate_agent_id(cls) -> str: """Generate the agent_id of this agent instance""" @@ -187,7 +192,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def reply(self, x: dict = None) -> dict: """Define the actions taken by this agent. @@ -209,7 +214,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def load_from_config(self, config: dict) -> None: """Load configuration for this agent. @@ -219,7 +224,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def export_config(self) -> dict: """Return configuration of this agent. @@ -230,7 +235,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def load_memory(self, memory: Sequence[dict]) -> None: r"""Load input memory."""
    @@ -247,7 +252,7 @@

    agentscope.agents.agent 源代码

             return res
     
     
    -[文档] +[文档] def speak( self, content: Union[str, dict], @@ -257,7 +262,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def observe(self, x: Union[dict, Sequence[dict]]) -> None: """Observe the input, store it in memory without response to it. @@ -270,7 +275,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def reset_audience(self, audience: Sequence[AgentBase]) -> None: """Set the audience of this agent, which means if this agent generates a response, it will be passed to all audiences. @@ -286,7 +291,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def clear_audience(self) -> None: """Remove the audience of this agent.""" # TODO: we leave the consideration of nested msghub for future. @@ -295,7 +300,7 @@

    agentscope.agents.agent 源代码

     
     
     
    -[文档] +[文档] def rm_audience( self, audience: Union[Sequence[AgentBase], AgentBase], @@ -329,7 +334,7 @@

    agentscope.agents.agent 源代码

             return self._agent_id
     
     
    -[文档] +[文档] def to_dist( self, host: str = "localhost", diff --git a/zh_CN/_modules/agentscope/agents/dialog_agent.html b/zh_CN/_modules/agentscope/agents/dialog_agent.html index 1e684c24a..5a8937145 100644 --- a/zh_CN/_modules/agentscope/agents/dialog_agent.html +++ b/zh_CN/_modules/agentscope/agents/dialog_agent.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -106,11 +108,13 @@

    agentscope.agents.dialog_agent 源代码

     
     
     
    -[文档] +[文档] class DialogAgent(AgentBase): """A simple agent used to perform a dialogue. Your can set its role by `sys_prompt`.""" +
    +[文档] def __init__( self, name: str, @@ -152,11 +156,12 @@

    agentscope.agents.dialog_agent 源代码

                 logger.warning(
                     "The argument `prompt_type` is deprecated and "
                     "will be removed in the future.",
    -            )
    +            )
    + # TODO change typing from dict to MSG
    -[文档] +[文档] def reply(self, x: dict = None) -> dict: """Reply function of the agent. Processes the input data, generates a prompt using the current dialogue memory and system diff --git a/zh_CN/_modules/agentscope/agents/dict_dialog_agent.html b/zh_CN/_modules/agentscope/agents/dict_dialog_agent.html index 628e9bb7f..c1bdad418 100644 --- a/zh_CN/_modules/agentscope/agents/dict_dialog_agent.html +++ b/zh_CN/_modules/agentscope/agents/dict_dialog_agent.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -108,6 +110,8 @@

    agentscope.agents.dict_dialog_agent 源代码

    from ..utils.tools import _convert_to_str +
    +[文档] def parse_dict(response: ModelResponse) -> ModelResponse: """Parse function for DictDialogAgent""" try: @@ -124,16 +128,20 @@

    agentscope.agents.dict_dialog_agent 源代码

    # TODO: maybe using a more robust json library to handle this case response_dict = json.loads(response.text.replace("'", '"')) - return ModelResponse(raw=response_dict) + return ModelResponse(raw=response_dict)
    + +
    +[文档] def default_response(response: ModelResponse) -> ModelResponse: """The default response of fault_handler""" - return ModelResponse(raw={"speak": response.text}) + return ModelResponse(raw={"speak": response.text})
    +
    -[文档] +[文档] class DictDialogAgent(AgentBase): """An agent that generates response in a dict format, where user can specify the required fields in the response via prompt, e.g. @@ -156,6 +164,8 @@

    agentscope.agents.dict_dialog_agent 源代码

    For usage example, please refer to the example of werewolf in `examples/game_werewolf`""" +
    +[文档] def __init__( self, name: str, @@ -183,23 +193,20 @@

    agentscope.agents.dict_dialog_agent 源代码

    Whether the agent has memory. memory_config (`Optional[dict]`, defaults to `None`): The config of memory. - parse_func (`Optional[Callable[..., Any]]`, - defaults to `parse_dict`): + parse_func (`Optional[Callable[..., Any]]`, defaults to `parse_dict`): The function used to parse the model output, e.g. `json.loads`, which is used to extract json from the output. - fault_handler (`Optional[Callable[..., Any]]`, - defaults to `default_response`): + fault_handler (`Optional[Callable[..., Any]]`, defaults to `default_response`): The function used to handle the fault when parse_func fails to parse the model output. max_retries (`Optional[int]`, defaults to `None`): The maximum number of retries when failed to parse the model output. - prompt_type (`Optional[PromptType]`, defaults to - `PromptType.LIST`): + prompt_type (`Optional[PromptType]`, defaults to `PromptType.LIST`): The type of the prompt organization, chosen from `PromptType.LIST` or `PromptType.STRING`. - """ + """ # noqa super().__init__( name=name, sys_prompt=sys_prompt, @@ -217,11 +224,12 @@

    agentscope.agents.dict_dialog_agent 源代码

    logger.warning( "The argument `prompt_type` is deprecated and " "will be removed in the future.", - ) + )
    + # TODO change typing from dict to MSG
    -[文档] +[文档] def reply(self, x: dict = None) -> dict: """Reply function of the agent. Processes the input data, generates a prompt using the current diff --git a/zh_CN/_modules/agentscope/agents/operator.html b/zh_CN/_modules/agentscope/agents/operator.html index fd4e5e4b5..6b124c993 100644 --- a/zh_CN/_modules/agentscope/agents/operator.html +++ b/zh_CN/_modules/agentscope/agents/operator.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -102,7 +104,7 @@

    agentscope.agents.operator 源代码

     
     
     
    -[文档] +[文档] class Operator(ABC): """ Abstract base class `Operator` defines a protocol for classes that diff --git a/zh_CN/_modules/agentscope/agents/react_agent.html b/zh_CN/_modules/agentscope/agents/react_agent.html index cae4be23f..edd1c4589 100644 --- a/zh_CN/_modules/agentscope/agents/react_agent.html +++ b/zh_CN/_modules/agentscope/agents/react_agent.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -163,7 +165,7 @@

    agentscope.agents.react_agent 源代码

     
     
     
    -[文档] +[文档] class ReActAgent(AgentBase): """An agent class that implements the ReAct algorithm. More details refer to https://arxiv.org/abs/2210.03629. @@ -174,6 +176,8 @@

    agentscope.agents.react_agent 源代码

         their own needs.
         """
     
    +
    +[文档] def __init__( self, name: str, @@ -225,10 +229,11 @@

    agentscope.agents.react_agent 源代码

                 )
     
             # Put sys prompt into memory
    -        self.memory.add(Msg("system", self.sys_prompt, role="system"))
    +        self.memory.add(Msg("system", self.sys_prompt, role="system"))
    +
    -[文档] +[文档] def reply(self, x: dict = None) -> dict: """The reply function that achieves the ReAct algorithm. The more details please refer to https://arxiv.org/abs/2210.03629""" @@ -336,7 +341,7 @@

    agentscope.agents.react_agent 源代码

     
     
     
    -[文档] +[文档] def execute_func(self, index: int, func_call: dict) -> dict: """Execute the tool function and return the result. @@ -381,7 +386,7 @@

    agentscope.agents.react_agent 源代码

     
     
     
    -[文档] +[文档] def prepare_funcs_prompt(self, tools: List[Tuple]) -> Tuple[str, dict]: """Convert function descriptions from json schema format to string prompt format. diff --git a/zh_CN/_modules/agentscope/agents/rpc_agent.html b/zh_CN/_modules/agentscope/agents/rpc_agent.html index ca9c16542..522e79291 100644 --- a/zh_CN/_modules/agentscope/agents/rpc_agent.html +++ b/zh_CN/_modules/agentscope/agents/rpc_agent.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -135,6 +137,8 @@

    agentscope.agents.rpc_agent 源代码

     )
     
     
    +
    +[文档] def rpc_servicer_method( # type: ignore[no-untyped-def] func, ): @@ -150,14 +154,17 @@

    agentscope.agents.rpc_agent 源代码

                 raise RuntimeError(error_msg)
             return func(rpc_agent, msg)
     
    -    return inner
    +    return inner
    +
    -[文档] +[文档] class RpcAgent(AgentBase): """A wrapper to extend an AgentBase into a gRPC Client.""" +
    +[文档] def __init__( self, name: str, @@ -238,7 +245,8 @@

    agentscope.agents.rpc_agent 源代码

                 )
                 self.client.create_agent(
                     agent_configs if create_with_agent_configs else None,
    -            )
    +            )
    + def _launch_server(self) -> None: """Launch a rpc server and update the port and the client""" @@ -251,7 +259,7 @@

    agentscope.agents.rpc_agent 源代码

             )
     
     
    -[文档] +[文档] def reply(self, x: dict = None) -> dict: if self.client is None: self._launch_server() @@ -264,7 +272,7 @@

    agentscope.agents.rpc_agent 源代码

     
     
     
    -[文档] +[文档] def observe(self, x: Union[dict, Sequence[dict]]) -> None: if self.client is None: self._launch_server() @@ -275,7 +283,7 @@

    agentscope.agents.rpc_agent 源代码

     
     
     
    -[文档] +[文档] def clone_instances( self, num_instances: int, @@ -323,7 +331,7 @@

    agentscope.agents.rpc_agent 源代码

     
     
     
    -[文档] +[文档] def stop(self) -> None: """Stop the RpcAgent and the rpc server.""" if self.server_launcher is not None: @@ -335,6 +343,8 @@

    agentscope.agents.rpc_agent 源代码

     
     
     
    +
    +[文档] def setup_rpc_agent_server( agent_class: Type[AgentBase], agent_args: tuple, @@ -431,16 +441,22 @@

    agentscope.agents.rpc_agent 源代码

         logger.info(
             f"rpc server [{agent_class.__name__}] at port [{port}] stopped "
             "successfully",
    -    )
    +    )
    + +
    +[文档] def find_available_port() -> int: """Get an unoccupied socket port number.""" with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind(("", 0)) - return s.getsockname()[1] + return s.getsockname()[1]
    + +
    +[文档] def check_port(port: Optional[int] = None) -> int: """Check if the port is available. @@ -467,14 +483,17 @@

    agentscope.agents.rpc_agent 源代码

                     f"Port [{port}] is occupied, use [{new_port}] instead",
                 )
                 return new_port
    -    return port
    +    return port
    +
    -[文档] +[文档] class RpcAgentServerLauncher: """Launcher of rpc agent server.""" +
    +[文档] def __init__( self, agent_class: Type[AgentBase] = None, @@ -517,7 +536,8 @@

    agentscope.agents.rpc_agent 源代码

             self.local_mode = local_mode
             self.server = None
             self.stop_event = None
    -        self.parent_con = None
    +        self.parent_con = None
    + def _launch_in_main(self) -> None: """Launch gRPC server in main-process""" @@ -573,7 +593,7 @@

    agentscope.agents.rpc_agent 源代码

             )
     
     
    -[文档] +[文档] def launch(self, in_subprocess: bool = True) -> None: """launch a rpc agent server. @@ -589,7 +609,7 @@

    agentscope.agents.rpc_agent 源代码

     
     
     
    -[文档] +[文档] def wait_until_terminate(self) -> None: """Wait for server process""" if self.server is not None: @@ -597,7 +617,7 @@

    agentscope.agents.rpc_agent 源代码

     
     
     
    -[文档] +[文档] def shutdown(self) -> None: """Shutdown the rpc agent server.""" if self.server is not None: @@ -616,9 +636,13 @@

    agentscope.agents.rpc_agent 源代码

     
     
     
    +
    +[文档] class RpcServerSideWrapper(RpcAgentServicer): """A wrapper to extend an AgentBase into a gRPC Servicer.""" +
    +[文档] def __init__( self, agent_class: Type[AgentBase], @@ -663,14 +687,20 @@

    agentscope.agents.rpc_agent 源代码

             self.task_id_lock = threading.Lock()
             self.agent_id_lock = threading.Lock()
             self.task_id_counter = 0
    -        self.agent_pool: dict[str, AgentBase] = {}
    +        self.agent_pool: dict[str, AgentBase] = {}
    + +
    +[文档] def get_task_id(self) -> int: """Get the auto-increment task id.""" with self.task_id_lock: self.task_id_counter += 1 - return self.task_id_counter + return self.task_id_counter
    + +
    +[文档] def check_and_generate_agent( self, agent_id: str, @@ -697,8 +727,11 @@

    agentscope.agents.rpc_agent 源代码

                         )
                     agent_instance._agent_id = agent_id  # pylint: disable=W0212
                     self.agent_pool[agent_id] = agent_instance
    -                logger.info(f"create agent instance [{agent_id}]")
    +                logger.info(f"create agent instance [{agent_id}]")
    + +
    +[文档] def check_and_delete_agent(self, agent_id: str) -> None: """ Check whether the agent exists, and delete the agent instance @@ -710,8 +743,11 @@

    agentscope.agents.rpc_agent 源代码

             with self.agent_id_lock:
                 if agent_id in self.agent_pool:
                     self.agent_pool.pop(agent_id)
    -                logger.info(f"delete agent instance [{agent_id}]")
    +                logger.info(f"delete agent instance [{agent_id}]")
    + +
    +[文档] def call_func(self, request: RpcMsg, _: ServicerContext) -> RpcMsg: """Call the specific servicer function.""" if hasattr(self, request.target_func): @@ -727,7 +763,8 @@

    agentscope.agents.rpc_agent 源代码

                         content=f"Unsupported method {request.target_func}",
                         role="assistant",
                     ).serialize(),
    -            )
    +            )
    + def _reply(self, request: RpcMsg) -> RpcMsg: """Call function of RpcAgentService @@ -823,6 +860,8 @@

    agentscope.agents.rpc_agent 源代码

             self.check_and_delete_agent(request.agent_id)
             return RpcMsg()
     
    +
    +[文档] def process_messages( self, task_id: int, @@ -846,7 +885,9 @@

    agentscope.agents.rpc_agent 源代码

                     content=f"Error in agent [{agent_id}]:\n{error_msg}",
                 )
             with cond:
    -            cond.notify_all()
    +            cond.notify_all()
    +
    +
    diff --git a/zh_CN/_modules/agentscope/agents/text_to_image_agent.html b/zh_CN/_modules/agentscope/agents/text_to_image_agent.html index 3655cb839..557016512 100644 --- a/zh_CN/_modules/agentscope/agents/text_to_image_agent.html +++ b/zh_CN/_modules/agentscope/agents/text_to_image_agent.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -104,7 +106,7 @@

    agentscope.agents.text_to_image_agent 源代码

    <
    -[文档] +[文档] class TextToImageAgent(AgentBase): """ A agent used to perform text to image tasks. @@ -112,6 +114,8 @@

    agentscope.agents.text_to_image_agent 源代码

    < TODO: change the agent into a service. """ +
    +[文档] def __init__( self, name: str, @@ -138,10 +142,11 @@

    agentscope.agents.text_to_image_agent 源代码

    < model_config_name=model_config_name, use_memory=use_memory, memory_config=memory_config, - ) + )
    +
    -[文档] +[文档] def reply(self, x: dict = None) -> dict: if self.memory: self.memory.add(x) diff --git a/zh_CN/_modules/agentscope/agents/user_agent.html b/zh_CN/_modules/agentscope/agents/user_agent.html index a078c1c24..c1c59b92e 100644 --- a/zh_CN/_modules/agentscope/agents/user_agent.html +++ b/zh_CN/_modules/agentscope/agents/user_agent.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -107,10 +109,12 @@

    agentscope.agents.user_agent 源代码

     
     
     
    -[文档] +[文档] class UserAgent(AgentBase): """User agent class""" +
    +[文档] def __init__(self, name: str = "User", require_url: bool = False) -> None: """Initialize a UserAgent object. @@ -126,10 +130,11 @@

    agentscope.agents.user_agent 源代码

             super().__init__(name=name)
     
             self.name = name
    -        self.require_url = require_url
    +        self.require_url = require_url
    +
    -[文档] +[文档] def reply( self, x: dict = None, @@ -202,7 +207,7 @@

    agentscope.agents.user_agent 源代码

     
     
     
    -[文档] +[文档] def speak( self, content: Union[str, dict], diff --git a/zh_CN/_modules/agentscope/constants.html b/zh_CN/_modules/agentscope/constants.html new file mode 100644 index 000000000..f7b2e83ff --- /dev/null +++ b/zh_CN/_modules/agentscope/constants.html @@ -0,0 +1,195 @@ + + + + + + + agentscope.constants — AgentScope 文档 + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    agentscope.constants 源代码

    +# -*- coding: utf-8 -*-
    +""" Some constants used in the project"""
    +from numbers import Number
    +from enum import IntEnum
    +
    +PACKAGE_NAME = "agentscope"
    +MSG_TOKEN = f"[{PACKAGE_NAME}_msg]"
    +
    +
    +# default values
    +
    +# for file manager
    +_DEFAULT_DIR = "./runs"
    +_DEFAULT_LOG_LEVEL = "INFO"
    +_DEFAULT_SUBDIR_CODE = "code"
    +_DEFAULT_SUBDIR_FILE = "file"
    +_DEFAULT_SUBDIR_INVOKE = "invoke"
    +_DEFAULT_CFG_NAME = ".config"
    +_DEFAULT_IMAGE_NAME = "image_{}_{}.png"
    +_DEFAULT_SQLITE_DB_PATH = "agentscope.db"
    +
    +
    +# for model wrapper
    +_DEFAULT_MAX_RETRIES = 3
    +_DEFAULT_MESSAGES_KEY = "inputs"
    +_DEFAULT_RETRY_INTERVAL = 1
    +_DEFAULT_API_BUDGET = None
    +# for execute python
    +_DEFAULT_PYPI_MIRROR = "http://mirrors.aliyun.com/pypi/simple/"
    +_DEFAULT_TRUSTED_HOST = "mirrors.aliyun.com"
    +# for monitor
    +_DEFAULT_MONITOR_TABLE_NAME = "monitor_metrics"
    +# for summarization
    +_DEFAULT_SUMMARIZATION_PROMPT = """
    +TEXT: {}
    +"""
    +_DEFAULT_SYSTEM_PROMPT = """
    +You are a helpful agent to summarize the text.
    +You need to keep all the key information of the text in the summary.
    +"""
    +_DEFAULT_TOKEN_LIMIT_PROMPT = """
    +Summarize the text after TEXT in less than {} tokens:
    +"""
    +
    +# typing
    +Embedding = list[Number]
    +
    +
    +# enums
    +
    +[文档] +class ResponseFormat(IntEnum): + """Enum for model response format.""" + + NONE = 0 + JSON = 1
    + + + +
    +[文档] +class ShrinkPolicy(IntEnum): + """Enum for shrink strategies when the prompt is too long.""" + + TRUNCATE = 0 + SUMMARIZE = 1
    + +
    + +
    +
    +
    + +
    + +
    +

    © 版权所有 2024, Alibaba Tongyi Lab。

    +
    + + 利用 Sphinx 构建,使用的 + 主题 + 由 Read the Docs 开发. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/zh_CN/_modules/agentscope/memory/memory.html b/zh_CN/_modules/agentscope/memory/memory.html index 962d0ffa6..9d9196ea5 100644 --- a/zh_CN/_modules/agentscope/memory/memory.html +++ b/zh_CN/_modules/agentscope/memory/memory.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -110,12 +112,14 @@

    agentscope.memory.memory 源代码

     
     
     
    -[文档] +[文档] class MemoryBase(ABC): """Base class for memory.""" _version: int = 1 +
    +[文档] def __init__( self, config: Optional[dict] = None, @@ -126,10 +130,11 @@

    agentscope.memory.memory 源代码

                 config (`Optional[dict]`, defaults to `None`):
                     Configuration of this memory.
             """
    -        self.config = {} if config is None else config
    +        self.config = {} if config is None else config
    +
    -[文档] +[文档] def update_config(self, config: dict) -> None: """ Configure memory as specified in config @@ -138,7 +143,7 @@

    agentscope.memory.memory 源代码

     
     
     
    -[文档] +[文档] @abstractmethod def get_memory( self, @@ -152,7 +157,7 @@

    agentscope.memory.memory 源代码

     
     
     
    -[文档] +[文档] @abstractmethod def add(self, memories: Union[list[dict], dict, None]) -> None: """ @@ -161,7 +166,7 @@

    agentscope.memory.memory 源代码

     
     
     
    -[文档] +[文档] @abstractmethod def delete(self, index: Union[Iterable, int]) -> None: """ @@ -171,7 +176,7 @@

    agentscope.memory.memory 源代码

     
     
     
    -[文档] +[文档] @abstractmethod def load( self, @@ -185,7 +190,7 @@

    agentscope.memory.memory 源代码

     
     
     
    -[文档] +[文档] @abstractmethod def export( self, @@ -196,14 +201,14 @@

    agentscope.memory.memory 源代码

     
     
     
    -[文档] +[文档] @abstractmethod def clear(self) -> None: """Clean memory, depending on how the memory are stored"""
    -[文档] +[文档] @abstractmethod def size(self) -> int: """Returns the number of memory segments in memory.""" diff --git a/zh_CN/_modules/agentscope/memory/temporary_memory.html b/zh_CN/_modules/agentscope/memory/temporary_memory.html index cedee0ed0..0c26e0e67 100644 --- a/zh_CN/_modules/agentscope/memory/temporary_memory.html +++ b/zh_CN/_modules/agentscope/memory/temporary_memory.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -115,12 +117,14 @@

    agentscope.memory.temporary_memory 源代码

    -[文档]
    +[文档]
     class TemporaryMemory(MemoryBase):
         """
         In-memory memory module, not writing to hard disk
         """
     
    +
    +[文档] def __init__( self, config: Optional[dict] = None, @@ -134,10 +138,11 @@

    agentscope.memory.temporary_memory 源代码

    if isinstance(embedding_model, str):
                 self.embedding_model = load_model_by_config_name(embedding_model)
             else:
    -            self.embedding_model = embedding_model
    +            self.embedding_model = embedding_model
    +
    -[文档] +[文档] def add( self, memories: Union[Sequence[dict], dict, None], @@ -172,7 +177,7 @@

    agentscope.memory.temporary_memory 源代码

    -[文档]
    +[文档]
         def delete(self, index: Union[Iterable, int]) -> None:
             if self.size() == 0:
                 logger.warning(
    @@ -204,7 +209,7 @@ 

    agentscope.memory.temporary_memory 源代码

    -[文档]
    +[文档]
         def export(
             self,
             to_mem: bool = False,
    @@ -226,7 +231,7 @@ 

    agentscope.memory.temporary_memory 源代码

    -[文档]
    +[文档]
         def load(
             self,
             memories: Union[str, dict, list],
    @@ -265,21 +270,21 @@ 

    agentscope.memory.temporary_memory 源代码

    -[文档]
    +[文档]
         def clear(self) -> None:
             """Clean memory, depending on how the memory are stored"""
             self._content = []
    -[文档] +[文档] def size(self) -> int: """Returns the number of memory segments in memory.""" return len(self._content)
    -[文档] +[文档] def retrieve_by_embedding( self, query: Union[str, Embedding], @@ -336,7 +341,7 @@

    agentscope.memory.temporary_memory 源代码

    -[文档]
    +[文档]
         def get_embeddings(
             self,
             embedding_model: Callable[[Union[str, dict]], Embedding] = None,
    @@ -365,7 +370,7 @@ 

    agentscope.memory.temporary_memory 源代码

    -[文档]
    +[文档]
         def get_memory(
             self,
             recent_n: Optional[int] = None,
    diff --git a/zh_CN/_modules/agentscope/message.html b/zh_CN/_modules/agentscope/message.html
    new file mode 100644
    index 000000000..4b660a5e3
    --- /dev/null
    +++ b/zh_CN/_modules/agentscope/message.html
    @@ -0,0 +1,585 @@
    +
    +
    +
    +
    +  
    +  
    +  agentscope.message — AgentScope  文档
    +      
    +      
    +      
    +
    +  
    +  
    +  
    +        
    +        
    +        
    +        
    +        
    +        
    +        
    +        
    +    
    +    
    +     
    +
    +
    + 
    +  
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    agentscope.message 源代码

    +# -*- coding: utf-8 -*-
    +"""The base class for message unit"""
    +
    +from typing import Any, Optional, Union, Sequence, Literal
    +from uuid import uuid4
    +import json
    +
    +from loguru import logger
    +
    +from .rpc import RpcAgentClient, ResponseStub, call_in_thread
    +from .utils.tools import _get_timestamp
    +
    +
    +
    +[文档] +class MessageBase(dict): + """Base Message class, which is used to maintain information for dialog, + memory and used to construct prompt. + """ + +
    +[文档] + def __init__( + self, + name: str, + content: Any, + role: Literal["user", "system", "assistant"] = "assistant", + url: Optional[Union[Sequence[str], str]] = None, + timestamp: Optional[str] = None, + **kwargs: Any, + ) -> None: + """Initialize the message object + + Args: + name (`str`): + The name of who send the message. It's often used in + role-playing scenario to tell the name of the sender. + content (`Any`): + The content of the message. + role (`Literal["system", "user", "assistant"]`, defaults to "assistant"): + The role of who send the message. It can be one of the + `"system"`, `"user"`, or `"assistant"`. Default to + `"assistant"`. + url (`Optional[Union[list[str], str]]`, defaults to None): + A url to file, image, video, audio or website. + timestamp (`Optional[str]`, defaults to None): + The timestamp of the message, if None, it will be set to + current time. + **kwargs (`Any`): + Other attributes of the message. + """ # noqa + # id and timestamp will be added to the object as its attributes + # rather than items in dict + self.id = uuid4().hex + if timestamp is None: + self.timestamp = _get_timestamp() + else: + self.timestamp = timestamp + + self.name = name + self.content = content + self.role = role + + if url: + self.url = url + else: + self.url = None + + self.update(kwargs)
    + + + def __getattr__(self, key: Any) -> Any: + try: + return self[key] + except KeyError as e: + raise AttributeError(f"no attribute '{key}'") from e + + def __setattr__(self, key: Any, value: Any) -> None: + self[key] = value + + def __delattr__(self, key: Any) -> None: + try: + del self[key] + except KeyError as e: + raise AttributeError(f"no attribute '{key}'") from e + +
    +[文档] + def to_str(self) -> str: + """Return the string representation of the message""" + raise NotImplementedError
    + + +
    +[文档] + def serialize(self) -> str: + """Return the serialized message.""" + raise NotImplementedError
    +
    + + + +
    +[文档] +class Msg(MessageBase): + """The Message class.""" + +
    +[文档] + def __init__( + self, + name: str, + content: Any, + role: Literal["system", "user", "assistant"] = None, + url: Optional[Union[Sequence[str], str]] = None, + timestamp: Optional[str] = None, + echo: bool = False, + **kwargs: Any, + ) -> None: + """Initialize the message object + + Args: + name (`str`): + The name of who send the message. + content (`Any`): + The content of the message. + role (`Literal["system", "user", "assistant"]`): + Used to identify the source of the message, e.g. the system + information, the user input, or the model response. This + argument is used to accommodate most Chat API formats. + url (`Optional[Union[list[str], str]]`, defaults to `None`): + A url to file, image, video, audio or website. + timestamp (`Optional[str]`, defaults to `None`): + The timestamp of the message, if None, it will be set to + current time. + **kwargs (`Any`): + Other attributes of the message. + """ + + if role is None: + logger.warning( + "A new field `role` is newly added to the message. " + "Please specify the role of the message. Currently we use " + 'a default "assistant" value.', + ) + + super().__init__( + name=name, + content=content, + role=role or "assistant", + url=url, + timestamp=timestamp, + **kwargs, + ) + if echo: + logger.chat(self)
    + + +
    +[文档] + def to_str(self) -> str: + """Return the string representation of the message""" + return f"{self.name}: {self.content}"
    + + +
    +[文档] + def serialize(self) -> str: + return json.dumps({"__type": "Msg", **self})
    +
    + + + +
    +[文档] +class Tht(MessageBase): + """The Thought message is used to record the thought of the agent to + help them make decisions and responses. Generally, it shouldn't be + passed to or seen by the other agents. + + In our framework, we formulate the thought in prompt as follows: + - For OpenAI API calling: + + .. code-block:: python + + [ + ... + { + "role": "assistant", + "name": "thought", + "content": "I should ..." + }, + ... + ] + + - For open-source models that accepts string as input: + + .. code-block:: python + + ... + {self.name} thought: I should ... + ... + + We admit that there maybe better ways to formulate the thought. Users + are encouraged to create their own thought formulation methods by + inheriting `MessageBase` class and rewrite the `__init__` and `to_str` + function. + + .. code-block:: python + + class MyThought(MessageBase): + def to_str(self) -> str: + # implement your own thought formulation method + pass + """ + +
    +[文档] + def __init__( + self, + content: Any, + timestamp: Optional[str] = None, + ) -> None: + super().__init__( + name="thought", + content=content, + role="assistant", + timestamp=timestamp, + )
    + + +
    +[文档] + def to_str(self) -> str: + """Return the string representation of the message""" + return f"{self.name} thought: {self.content}"
    + + +
    +[文档] + def serialize(self) -> str: + return json.dumps({"__type": "Tht", **self})
    +
    + + + +
    +[文档] +class PlaceholderMessage(MessageBase): + """A placeholder for the return message of RpcAgent.""" + + PLACEHOLDER_ATTRS = { + "_host", + "_port", + "_client", + "_task_id", + "_stub", + "_is_placeholder", + } + + LOCAL_ATTRS = { + "name", + "timestamp", + *PLACEHOLDER_ATTRS, + } + +
    +[文档] + def __init__( + self, + name: str, + content: Any, + url: Optional[Union[Sequence[str], str]] = None, + timestamp: Optional[str] = None, + host: str = None, + port: int = None, + task_id: int = None, + client: Optional[RpcAgentClient] = None, + x: dict = None, + **kwargs: Any, + ) -> None: + """A placeholder message, records the address of the real message. + + Args: + name (`str`): + The name of who send the message. It's often used in + role-playing scenario to tell the name of the sender. + However, you can also only use `role` when calling openai api. + The usage of `name` refers to + https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models. + content (`Any`): + The content of the message. + role (`Literal["system", "user", "assistant"]`, defaults to "assistant"): + The role of the message, which can be one of the `"system"`, + `"user"`, or `"assistant"`. + url (`Optional[Union[list[str], str]]`, defaults to None): + A url to file, image, video, audio or website. + timestamp (`Optional[str]`, defaults to None): + The timestamp of the message, if None, it will be set to + current time. + host (`str`, defaults to `None`): + The hostname of the rpc server where the real message is + located. + port (`int`, defaults to `None`): + The port of the rpc server where the real message is located. + task_id (`int`, defaults to `None`): + The task id of the real message in the rpc server. + client (`RpcAgentClient`, defaults to `None`): + An RpcAgentClient instance used to connect to the generator of + this placeholder. + x (`dict`, defaults to `None`): + Input parameters used to call rpc methods on the client. + """ # noqa + super().__init__( + name=name, + content=content, + url=url, + timestamp=timestamp, + **kwargs, + ) + # placeholder indicates whether the real message is still in rpc server + self._is_placeholder = True + if client is None: + self._stub: ResponseStub = None + self._host: str = host + self._port: int = port + self._task_id: int = task_id + else: + self._stub = call_in_thread(client, x, "_reply") + self._host = client.host + self._port = client.port + self._task_id = None
    + + + def __is_local(self, key: Any) -> bool: + return ( + key in PlaceholderMessage.LOCAL_ATTRS or not self._is_placeholder + ) + + def __getattr__(self, __name: str) -> Any: + """Get attribute value from PlaceholderMessage. Get value from rpc + agent server if necessary. + + Args: + __name (`str`): + Attribute name. + """ + if not self.__is_local(__name): + self.update_value() + return MessageBase.__getattr__(self, __name) + + def __getitem__(self, __key: Any) -> Any: + """Get item value from PlaceholderMessage. Get value from rpc + agent server if necessary. + + Args: + __key (`Any`): + Item name. + """ + if not self.__is_local(__key): + self.update_value() + return MessageBase.__getitem__(self, __key) + +
    +[文档] + def to_str(self) -> str: + return f"{self.name}: {self.content}"
    + + +
    +[文档] + def update_value(self) -> MessageBase: + """Get attribute values from rpc agent server immediately""" + if self._is_placeholder: + # retrieve real message from rpc agent server + self.__update_task_id() + client = RpcAgentClient(self._host, self._port) + result = client.call_func( + func_name="_get", + value=json.dumps({"task_id": self._task_id}), + ) + msg = deserialize(result) + status = msg.pop("__status", "OK") + if status == "ERROR": + raise RuntimeError(msg.content) + self.update(msg) + # the actual value has been updated, not a placeholder any more + self._is_placeholder = False + return self
    + + + def __update_task_id(self) -> None: + if self._stub is not None: + resp = deserialize(self._stub.get_response()) + self._task_id = resp["task_id"] # type: ignore[call-overload] + self._stub = None + +
    +[文档] + def serialize(self) -> str: + if self._is_placeholder: + self.__update_task_id() + return json.dumps( + { + "__type": "PlaceholderMessage", + "name": self.name, + "content": None, + "timestamp": self.timestamp, + "host": self._host, + "port": self._port, + "task_id": self._task_id, + }, + ) + else: + states = { + k: v + for k, v in self.items() + if k not in PlaceholderMessage.PLACEHOLDER_ATTRS + } + states["__type"] = "Msg" + return json.dumps(states)
    +
    + + + +_MSGS = { + "Msg": Msg, + "Tht": Tht, + "PlaceholderMessage": PlaceholderMessage, +} + + +
    +[文档] +def deserialize(s: str) -> Union[MessageBase, Sequence]: + """Deserialize json string into MessageBase""" + js_msg = json.loads(s) + msg_type = js_msg.pop("__type") + if msg_type == "List": + return [deserialize(s) for s in js_msg["__value"]] + elif msg_type not in _MSGS: + raise NotImplementedError( + "Deserialization of {msg_type} is not supported.", + ) + return _MSGS[msg_type](**js_msg)
    + + + +
    +[文档] +def serialize(messages: Union[Sequence[MessageBase], MessageBase]) -> str: + """Serialize multiple MessageBase instance""" + if isinstance(messages, MessageBase): + return messages.serialize() + seq = [msg.serialize() for msg in messages] + return json.dumps({"__type": "List", "__value": seq})
    + +
    + +
    +
    +
    + +
    + +
    +

    © 版权所有 2024, Alibaba Tongyi Lab。

    +
    + + 利用 Sphinx 构建,使用的 + 主题 + 由 Read the Docs 开发. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/zh_CN/_modules/agentscope/models.html b/zh_CN/_modules/agentscope/models.html index 85ad70639..e80b771ae 100644 --- a/zh_CN/_modules/agentscope/models.html +++ b/zh_CN/_modules/agentscope/models.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    diff --git a/zh_CN/_modules/agentscope/models/dashscope_model.html b/zh_CN/_modules/agentscope/models/dashscope_model.html index 535f65b6b..796be1b20 100644 --- a/zh_CN/_modules/agentscope/models/dashscope_model.html +++ b/zh_CN/_modules/agentscope/models/dashscope_model.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -116,9 +118,13 @@

    agentscope.models.dashscope_model 源代码

     from ..file_manager import file_manager
     
     
    +
    +[文档] class DashScopeWrapperBase(ModelWrapperBase, ABC): """The model wrapper for DashScope API.""" +
    +[文档] def __init__( self, config_name: str, @@ -159,8 +165,11 @@

    agentscope.models.dashscope_model 源代码

             self.max_length = None
     
             # Set monitor accordingly
    -        self._register_default_metrics()
    +        self._register_default_metrics()
    + +
    +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -169,11 +178,13 @@

    agentscope.models.dashscope_model 源代码

                 f"Model Wrapper [{type(self).__name__}] doesn't "
                 f"need to format the input. Please try to use the "
                 f"model wrapper directly.",
    -        )
    +        )
    +
    +
    -[文档] +[文档] class DashScopeChatWrapper(DashScopeWrapperBase): """The model wrapper for DashScope's chat API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/api-details @@ -311,7 +322,7 @@

    agentscope.models.dashscope_model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -420,7 +431,7 @@

    agentscope.models.dashscope_model 源代码

     
     
     
    -[文档] +[文档] class DashScopeImageSynthesisWrapper(DashScopeWrapperBase): """The model wrapper for DashScope Image Synthesis API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/quick-start-1 @@ -525,7 +536,7 @@

    agentscope.models.dashscope_model 源代码

     
     
     
    -[文档] +[文档] class DashScopeTextEmbeddingWrapper(DashScopeWrapperBase): """The model wrapper for DashScope Text Embedding API.""" @@ -629,7 +640,7 @@

    agentscope.models.dashscope_model 源代码

     
     
     
    -[文档] +[文档] class DashScopeMultiModalWrapper(DashScopeWrapperBase): """The model wrapper for DashScope Multimodal API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-api @@ -771,7 +782,7 @@

    agentscope.models.dashscope_model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], diff --git a/zh_CN/_modules/agentscope/models/gemini_model.html b/zh_CN/_modules/agentscope/models/gemini_model.html index 32763d8f1..dec6a0186 100644 --- a/zh_CN/_modules/agentscope/models/gemini_model.html +++ b/zh_CN/_modules/agentscope/models/gemini_model.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -114,6 +116,8 @@

    agentscope.models.gemini_model 源代码

         genai = None
     
     
    +
    +[文档] class GeminiWrapperBase(ModelWrapperBase, ABC): """The base class for Google Gemini model wrapper.""" @@ -121,6 +125,8 @@

    agentscope.models.gemini_model 源代码

         """The generation method used in `__call__` function, which is used to
         filter models in `list_models` function."""
     
    +
    +[文档] def __init__( self, config_name: str, @@ -152,7 +158,8 @@

    agentscope.models.gemini_model 源代码

     
             self.model_name = model_name
     
    -        self._register_default_metrics()
    +        self._register_default_metrics()
    + def _register_default_metrics(self) -> None: """Register the default metrics for the model.""" @@ -160,6 +167,8 @@

    agentscope.models.gemini_model 源代码

                 "The method `_register_default_metrics` must be implemented.",
             )
     
    +
    +[文档] def list_models(self) -> Sequence: """List all available models for this API calling.""" support_models = list(genai.list_models()) @@ -171,7 +180,8 @@

    agentscope.models.gemini_model 源代码

                     _
                     for _ in support_models
                     if self._generation_method in _.supported_generation_methods
    -            ]
    +            ]
    + def __call__(self, *args: Any, **kwargs: Any) -> ModelResponse: """Processing input with the model.""" @@ -179,11 +189,12 @@

    agentscope.models.gemini_model 源代码

                 f"Model Wrapper [{type(self).__name__}]"
                 f" is missing the  the required `__call__`"
                 f" method.",
    -        )
    +        )
    +
    -[文档] +[文档] class GeminiChatWrapper(GeminiWrapperBase): """The wrapper for Google Gemini chat model, e.g. gemini-pro""" @@ -193,6 +204,8 @@

    agentscope.models.gemini_model 源代码

         generation_method = "generateContent"
         """The generation method used in `__call__` function."""
     
    +
    +[文档] def __init__( self, config_name: str, @@ -208,7 +221,8 @@

    agentscope.models.gemini_model 源代码

             )
     
             # Create the generative model
    -        self.model = genai.GenerativeModel(model_name, **kwargs)
    +        self.model = genai.GenerativeModel(model_name, **kwargs)
    + def __call__( self, @@ -297,7 +311,7 @@

    agentscope.models.gemini_model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -397,7 +411,7 @@

    agentscope.models.gemini_model 源代码

     
     
     
    -[文档] +[文档] class GeminiEmbeddingWrapper(GeminiWrapperBase): """The wrapper for Google Gemini embedding model, e.g. models/embedding-001""" diff --git a/zh_CN/_modules/agentscope/models/model.html b/zh_CN/_modules/agentscope/models/model.html index 90ea435b6..5d5b83503 100644 --- a/zh_CN/_modules/agentscope/models/model.html +++ b/zh_CN/_modules/agentscope/models/model.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -269,7 +271,7 @@

    agentscope.models.model 源代码

     
     
     
    -[文档] +[文档] class ModelWrapperBase(metaclass=_ModelWrapperMeta): """The base class for model wrapper.""" @@ -283,6 +285,8 @@

    agentscope.models.model 源代码

         model_name: str
         """The name of the model, which is used in model api calling."""
     
    +
    +[文档] def __init__( self, # pylint: disable=W0613 config_name: str, @@ -301,10 +305,11 @@

    agentscope.models.model 源代码

             self.monitor = MonitorFactory.get_monitor()
     
             self.config_name = config_name
    -        logger.info(f"Initialize model [{config_name}]")
    +        logger.info(f"Initialize model [{config_name}]")
    +
    -[文档] +[文档] @classmethod def get_wrapper(cls, model_type: str) -> Type[ModelWrapperBase]: """Get the specific model wrapper""" @@ -332,7 +337,7 @@

    agentscope.models.model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -394,7 +399,7 @@

    agentscope.models.model 源代码

                 return get_full_name(name=metric_name)
     
     
    -[文档] +[文档] def update_monitor(self, **kwargs: Any) -> None: """Update the monitor with the given values. diff --git a/zh_CN/_modules/agentscope/models/ollama_model.html b/zh_CN/_modules/agentscope/models/ollama_model.html index 18331b67c..763798859 100644 --- a/zh_CN/_modules/agentscope/models/ollama_model.html +++ b/zh_CN/_modules/agentscope/models/ollama_model.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -112,6 +114,8 @@

    agentscope.models.ollama_model 源代码

         ollama = None
     
     
    +
    +[文档] class OllamaWrapperBase(ModelWrapperBase, ABC): """The base class for Ollama model wrappers. @@ -137,6 +141,8 @@

    agentscope.models.ollama_model 源代码

         """Controls how long the model will stay loaded into memory following
         the request."""
     
    +
    +[文档] def __init__( self, config_name: str, @@ -164,11 +170,13 @@

    agentscope.models.ollama_model 源代码

             self.options = options
             self.keep_alive = keep_alive
     
    -        self._register_default_metrics()
    +        self._register_default_metrics()
    +
    +
    -[文档] +[文档] class OllamaChatWrapper(OllamaWrapperBase): """The model wrapper for Ollama chat API.""" @@ -266,7 +274,7 @@

    agentscope.models.ollama_model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -324,7 +332,7 @@

    agentscope.models.ollama_model 源代码

     
     
     
    -[文档] +[文档] class OllamaEmbeddingWrapper(OllamaWrapperBase): """The model wrapper for Ollama embedding API.""" @@ -403,7 +411,7 @@

    agentscope.models.ollama_model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -418,7 +426,7 @@

    agentscope.models.ollama_model 源代码

     
     
     
    -[文档] +[文档] class OllamaGenerationWrapper(OllamaWrapperBase): """The model wrapper for Ollama generation API.""" @@ -515,7 +523,7 @@

    agentscope.models.ollama_model 源代码

             )
     
     
    -[文档] +[文档] def format(self, *args: Union[MessageBase, Sequence[MessageBase]]) -> str: """Forward the input to the model. diff --git a/zh_CN/_modules/agentscope/models/openai_model.html b/zh_CN/_modules/agentscope/models/openai_model.html index 972829a14..54f52afa8 100644 --- a/zh_CN/_modules/agentscope/models/openai_model.html +++ b/zh_CN/_modules/agentscope/models/openai_model.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -117,10 +119,12 @@

    agentscope.models.openai_model 源代码

     
     
     
    -[文档] +[文档] class OpenAIWrapperBase(ModelWrapperBase, ABC): """The model wrapper for OpenAI API.""" +
    +[文档] def __init__( self, config_name: str, @@ -186,10 +190,11 @@

    agentscope.models.openai_model 源代码

     
             # Set monitor accordingly
             self._register_budget(model_name, budget)
    -        self._register_default_metrics()
    +        self._register_default_metrics()
    +
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -204,7 +209,7 @@

    agentscope.models.openai_model 源代码

     
     
     
    -[文档] +[文档] class OpenAIChatWrapper(OpenAIWrapperBase): """The model wrapper for OpenAI's chat API.""" @@ -318,7 +323,7 @@

    agentscope.models.openai_model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -364,7 +369,7 @@

    agentscope.models.openai_model 源代码

     
     
     
    -[文档] +[文档] class OpenAIDALLEWrapper(OpenAIWrapperBase): """The model wrapper for OpenAI's DALL·E API.""" @@ -478,7 +483,7 @@

    agentscope.models.openai_model 源代码

     
     
     
    -[文档] +[文档] class OpenAIEmbeddingWrapper(OpenAIWrapperBase): """The model wrapper for OpenAI embedding API.""" diff --git a/zh_CN/_modules/agentscope/models/post_model.html b/zh_CN/_modules/agentscope/models/post_model.html index 5e78ad73c..bbed07ff3 100644 --- a/zh_CN/_modules/agentscope/models/post_model.html +++ b/zh_CN/_modules/agentscope/models/post_model.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -114,12 +116,14 @@

    agentscope.models.post_model 源代码

     
     
     
    -[文档] +[文档] class PostAPIModelWrapperBase(ModelWrapperBase, ABC): """The base model wrapper for the model deployed on the POST API.""" model_type: str = "post_api" +
    +[文档] def __init__( self, config_name: str, @@ -185,7 +189,8 @@

    agentscope.models.post_model 源代码

             self.post_args = post_args or {}
             self.max_retries = max_retries
             self.messages_key = messages_key
    -        self.retry_interval = retry_interval
    +        self.retry_interval = retry_interval
    + def _parse_response(self, response: dict) -> ModelResponse: """Parse the response json data into ModelResponse""" @@ -261,7 +266,7 @@

    agentscope.models.post_model 源代码

     
     
     
    -[文档] +[文档] class PostAPIChatWrapper(PostAPIModelWrapperBase): """A post api model wrapper compatilble with openai chat, e.g., vLLM, FastChat.""" @@ -276,7 +281,7 @@

    agentscope.models.post_model 源代码

             )
     
     
    -[文档] +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -319,6 +324,8 @@

    agentscope.models.post_model 源代码

     
     
     
    +
    +[文档] class PostAPIDALLEWrapper(PostAPIModelWrapperBase): """A post api model wrapper compatible with openai dall_e""" @@ -337,6 +344,8 @@

    agentscope.models.post_model 源代码

             urls = [img["url"] for img in response["data"]["response"]["data"]]
             return ModelResponse(image_urls=urls)
     
    +
    +[文档] def format( self, *args: Union[MessageBase, Sequence[MessageBase]], @@ -345,7 +354,9 @@

    agentscope.models.post_model 源代码

                 f"Model Wrapper [{type(self).__name__}] doesn't "
                 f"need to format the input. Please try to use the "
                 f"model wrapper directly.",
    -        )
    +        )
    +
    +
    diff --git a/zh_CN/_modules/agentscope/models/response.html b/zh_CN/_modules/agentscope/models/response.html index bf6eb0a5d..8173106ee 100644 --- a/zh_CN/_modules/agentscope/models/response.html +++ b/zh_CN/_modules/agentscope/models/response.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -107,7 +109,7 @@

    agentscope.models.response 源代码

     
     
     
    -[文档] +[文档] class ModelResponse: """Encapsulation of data returned by the model. @@ -121,6 +123,8 @@

    agentscope.models.response 源代码

         image_urls: Optional[Sequence[str]] = None
         json: Optional[Any] = None
     
    +
    +[文档] def __init__( self, text: str = None, @@ -143,7 +147,8 @@

    agentscope.models.response 源代码

             self.text = text
             self.embedding = embedding
             self.image_urls = image_urls
    -        self.raw = raw
    +        self.raw = raw
    + def __str__(self) -> str: if _is_json_serializable(self.raw): @@ -163,12 +168,12 @@

    agentscope.models.response 源代码

     
     
     
    -[文档] +[文档] class ResponseParser: """A class that contains several static methods to parse the response."""
    -[文档] +[文档] @classmethod def to_dict(cls, response: ModelResponse) -> ModelResponse: """Parse the response text to a dict, and feed it into the `json` @@ -194,7 +199,7 @@

    agentscope.models.response 源代码

     
     
     
    -[文档] +[文档] @classmethod def to_list(cls, response: ModelResponse) -> ModelResponse: """Parse the response text to a list, and feed it into the `json` @@ -222,7 +227,7 @@

    agentscope.models.response 源代码

     
     
     
    -[文档] +[文档] class ResponseParsingError(Exception): """Exception raised when parsing the response fails.""" @@ -235,6 +240,8 @@

    agentscope.models.response 源代码

         response: ModelResponse
         """The response that fails to be parsed."""
     
    +
    +[文档] def __init__( self, *args: Any, @@ -257,7 +264,8 @@

    agentscope.models.response 源代码

     
             self.parse_func_code = inspect.getsource(parse_func)
             self.error_info = error_info
    -        self.response = response
    +        self.response = response
    + def __str__(self) -> str: return ( diff --git a/zh_CN/_modules/agentscope/msghub.html b/zh_CN/_modules/agentscope/msghub.html index a8cb645ce..16349bbbc 100644 --- a/zh_CN/_modules/agentscope/msghub.html +++ b/zh_CN/_modules/agentscope/msghub.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -105,9 +107,13 @@

    agentscope.msghub 源代码

     from agentscope.agents import AgentBase
     
     
    +
    +[文档] class MsgHubManager: """MsgHub manager class for sharing dialog among a group of agents.""" +
    +[文档] def __init__( self, participants: Sequence[AgentBase], @@ -118,13 +124,14 @@

    agentscope.msghub 源代码

             Args:
                 participants (`Sequence[AgentBase]`):
                     The Sequence of participants in the msghub.
    -            announcement (`Optional[Union[list[dict], dict]]`, defaults to
    -            `None`):
    +            announcement
    +                (`Optional[Union[list[dict], dict]]`, defaults to `None`):
                     The message that will be broadcast to all participants at
                     the first without requiring response.
             """
             self.participants = participants
    -        self.announcement = announcement
    +        self.announcement = announcement
    + def __enter__(self) -> MsgHubManager: """Will be called when entering the msghub.""" @@ -155,6 +162,8 @@

    agentscope.msghub 源代码

             for agent in self.participants:
                 agent.reset_audience(self.participants)
     
    +
    +[文档] def add( self, new_participant: Union[Sequence[AgentBase], AgentBase], @@ -172,8 +181,11 @@

    agentscope.msghub 源代码

                         "already joined in.",
                     )
     
    -        self._reset_audience()
    +        self._reset_audience()
    + +
    +[文档] def delete( self, participant: Union[Sequence[AgentBase], AgentBase], @@ -196,8 +208,11 @@

    agentscope.msghub 源代码

                     )
     
             # Remove this agent from the audience of other agents
    -        self._reset_audience()
    +        self._reset_audience()
    + +
    +[文档] def broadcast(self, msg: Union[dict, list[dict]]) -> None: """Broadcast the message to all participants. @@ -207,11 +222,13 @@

    agentscope.msghub 源代码

                     participants.
             """
             for agent in self.participants:
    -            agent.observe(msg)
    +            agent.observe(msg)
    +
    +
    -[文档] +[文档] def msghub( participants: Sequence[AgentBase], announcement: Optional[Union[Sequence[dict], dict]] = None, diff --git a/zh_CN/_modules/agentscope/pipelines/functional.html b/zh_CN/_modules/agentscope/pipelines/functional.html index e4da7581e..3b69e3901 100644 --- a/zh_CN/_modules/agentscope/pipelines/functional.html +++ b/zh_CN/_modules/agentscope/pipelines/functional.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -110,17 +112,20 @@

    agentscope.pipelines.functional 源代码

     Operators = Union[Operator, Sequence[Operator]]
     
     
    +
    +[文档] def placeholder(x: dict = None) -> dict: r"""A placeholder that do nothing. Acts as a placeholder in branches that do not require any operations in flow control like if-else/switch """ - return x + return x
    +
    -[文档] +[文档] def sequentialpipeline( operators: Sequence[Operator], x: Optional[dict] = None, @@ -156,7 +161,7 @@

    agentscope.pipelines.functional 源代码

     
     
     
    -[文档] +[文档] def ifelsepipeline( condition_func: Callable, if_body_operators: Operators, @@ -188,7 +193,7 @@

    agentscope.pipelines.functional 源代码

     
     
     
    -[文档] +[文档] def switchpipeline( condition_func: Callable[[Any], Any], case_operators: Mapping[Any, Operators], @@ -224,7 +229,7 @@

    agentscope.pipelines.functional 源代码

     
     
     
    -[文档] +[文档] def forlooppipeline( loop_body_operators: Operators, max_loop: int, @@ -259,7 +264,7 @@

    agentscope.pipelines.functional 源代码

     
     
     
    -[文档] +[文档] def whilelooppipeline( loop_body_operators: Operators, condition_func: Callable[[int, Any], bool] = lambda _, __: False, diff --git a/zh_CN/_modules/agentscope/pipelines/pipeline.html b/zh_CN/_modules/agentscope/pipelines/pipeline.html index 72f8f50fc..2eda524fe 100644 --- a/zh_CN/_modules/agentscope/pipelines/pipeline.html +++ b/zh_CN/_modules/agentscope/pipelines/pipeline.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -117,7 +119,7 @@

    agentscope.pipelines.pipeline 源代码

     
     
     
    -[文档] +[文档] class PipelineBase(Operator): r"""Base interface of all pipelines. @@ -125,8 +127,11 @@

    agentscope.pipelines.pipeline 源代码

         multiple operators and the interaction logic among them.
         """
     
    +
    +[文档] def __init__(self) -> None: - self.participants: List[Any] = [] + self.participants: List[Any] = []
    + @abstractmethod def __call__(self, x: Optional[dict] = None) -> dict: @@ -143,7 +148,7 @@

    agentscope.pipelines.pipeline 源代码

     
     
     
    -[文档] +[文档] class IfElsePipeline(PipelineBase): r"""A template pipeline for implementing control flow like if-else. @@ -156,6 +161,8 @@

    agentscope.pipelines.pipeline 源代码

                 else_body_operators(x)
         """
     
    +
    +[文档] def __init__( self, condition_func: Callable[[dict], bool], @@ -177,7 +184,8 @@

    agentscope.pipelines.pipeline 源代码

             self.condition_func = condition_func
             self.if_body_operator = if_body_operators
             self.else_body_operator = else_body_operators
    -        self.participants = [self.if_body_operator] + [self.else_body_operator]
    +        self.participants = [self.if_body_operator] + [self.else_body_operator]
    + def __call__(self, x: Optional[dict] = None) -> dict: return ifelsepipeline( @@ -190,7 +198,7 @@

    agentscope.pipelines.pipeline 源代码

     
     
     
    -[文档] +[文档] class SwitchPipeline(PipelineBase): r"""A template pipeline for implementing control flow like switch-case. @@ -204,6 +212,8 @@

    agentscope.pipelines.pipeline 源代码

                 default: return default_operators(x)
         """
     
    +
    +[文档] def __init__( self, condition_func: Callable[[dict], Any], @@ -229,7 +239,8 @@

    agentscope.pipelines.pipeline 源代码

             self.default_operators = default_operators
             self.participants = list(self.case_operators.values()) + [
                 self.default_operators,
    -        ]
    +        ]
    + def __call__(self, x: Optional[dict] = None) -> dict: return switchpipeline( @@ -242,7 +253,7 @@

    agentscope.pipelines.pipeline 源代码

     
     
     
    -[文档] +[文档] class ForLoopPipeline(PipelineBase): r"""A template pipeline for implementing control flow like for-loop @@ -261,6 +272,8 @@

    agentscope.pipelines.pipeline 源代码

                     break
         """
     
    +
    +[文档] def __init__( self, loop_body_operators: Operators, @@ -282,7 +295,8 @@

    agentscope.pipelines.pipeline 源代码

             self.loop_body_operators = loop_body_operators
             self.max_loop = max_loop
             self.break_func = break_func
    -        self.participants = [self.loop_body_operators]
    +        self.participants = [self.loop_body_operators]
    + def __call__(self, x: Optional[dict] = None) -> dict: return forlooppipeline( @@ -295,7 +309,7 @@

    agentscope.pipelines.pipeline 源代码

     
     
     
    -[文档] +[文档] class WhileLoopPipeline(PipelineBase): r"""A template pipeline for implementing control flow like while-loop @@ -308,6 +322,8 @@

    agentscope.pipelines.pipeline 源代码

                 i += 1
         """
     
    +
    +[文档] def __init__( self, loop_body_operators: Operators, @@ -326,7 +342,8 @@

    agentscope.pipelines.pipeline 源代码

             """
             self.condition_func = condition_func
             self.loop_body_operators = loop_body_operators
    -        self.participants = [self.loop_body_operators]
    +        self.participants = [self.loop_body_operators]
    + def __call__(self, x: Optional[dict] = None) -> dict: return whilelooppipeline( @@ -338,7 +355,7 @@

    agentscope.pipelines.pipeline 源代码

     
     
     
    -[文档] +[文档] class SequentialPipeline(PipelineBase): r"""A template pipeline for implementing sequential logic. @@ -350,6 +367,8 @@

    agentscope.pipelines.pipeline 源代码

             x = operators[n](x)
         """
     
    +
    +[文档] def __init__(self, operators: Sequence[Operator]) -> None: r"""Initialize a Sequential pipeline. @@ -358,7 +377,8 @@

    agentscope.pipelines.pipeline 源代码

                     A Sequence of operators to be executed sequentially.
             """
             self.operators = operators
    -        self.participants = list(self.operators)
    +        self.participants = list(self.operators)
    + def __call__(self, x: Optional[dict] = None) -> dict: return sequentialpipeline(operators=self.operators, x=x)
    diff --git a/zh_CN/_modules/agentscope/prompt.html b/zh_CN/_modules/agentscope/prompt.html new file mode 100644 index 000000000..3936c2ea5 --- /dev/null +++ b/zh_CN/_modules/agentscope/prompt.html @@ -0,0 +1,325 @@ + + + + + + + agentscope.prompt — AgentScope 文档 + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    agentscope.prompt 源代码

    +# -*- coding: utf-8 -*-
    +"""Prompt engineering module."""
    +from typing import Any, Optional, Union
    +from enum import IntEnum
    +
    +from loguru import logger
    +
    +from agentscope.models import OpenAIWrapperBase, ModelWrapperBase
    +from agentscope.constants import ShrinkPolicy
    +from agentscope.utils.tools import to_openai_dict, to_dialog_str
    +
    +
    +
    +[文档] +class PromptType(IntEnum): + """Enum for prompt types.""" + + STRING = 0 + LIST = 1
    + + + +
    +[文档] +class PromptEngine: + """Prompt engineering module for both list and string prompt""" + +
    +[文档] + def __init__( + self, + model: ModelWrapperBase, + shrink_policy: ShrinkPolicy = ShrinkPolicy.TRUNCATE, + max_length: Optional[int] = None, + prompt_type: Optional[PromptType] = None, + max_summary_length: int = 200, + summarize_model: Optional[ModelWrapperBase] = None, + ) -> None: + """Init PromptEngine. + + Args: + model (`ModelWrapperBase`): + The target model for prompt engineering. + shrink_policy (`ShrinkPolicy`, defaults to + `ShrinkPolicy.TRUNCATE`): + The shrink policy for prompt engineering, defaults to + `ShrinkPolicy.TRUNCATE`. + max_length (`Optional[int]`, defaults to `None`): + The max length of context, if it is None, it will be set to the + max length of the model. + prompt_type (`Optional[MsgType]`, defaults to `None`): + The type of prompt, if it is None, it will be set according to + the model. + max_summary_length (`int`, defaults to `200`): + The max length of summary, if it is None, it will be set to the + max length of the model. + summarize_model (`Optional[ModelWrapperBase]`, defaults to `None`): + The model used for summarization, if it is None, it will be + set to `model`. + + Note: + + 1. TODO: Shrink function is still under development. + + 2. If the argument `max_length` and `prompt_type` are not given, + they will be set according to the given model. + + 3. `shrink_policy` is used when the prompt is too long, it can + be set to `ShrinkPolicy.TRUNCATE` or `ShrinkPolicy.SUMMARIZE`. + + a. `ShrinkPolicy.TRUNCATE` will truncate the prompt to the + desired length. + + b. `ShrinkPolicy.SUMMARIZE` will summarize partial of the + dialog history to save space. The summarization model + defaults to `model` if not given. + + Example: + + With prompt engine, we encapsulate different operations for + string- and list-style prompt, and block the prompt engineering + process from the user. + As a user, you can just combine you prompt as follows. + + .. code-block:: python + + # prepare the component + system_prompt = "You're a helpful assistant ..." + hint_prompt = "You should response in Json format." + prefix = "assistant: " + + # initialize the prompt engine and join the prompt + engine = PromptEngine(model) + prompt = engine.join(system_prompt, memory.get_memory(), + hint_prompt, prefix) + """ + self.model = model + self.shrink_policy = shrink_policy + self.max_length = max_length + + if prompt_type is None: + if isinstance(model, OpenAIWrapperBase): + self.prompt_type = PromptType.LIST + else: + self.prompt_type = PromptType.STRING + else: + self.prompt_type = prompt_type + + self.max_summary_length = max_summary_length + + if summarize_model is None: + self.summarize_model = model + + logger.warning( + "The prompt engine will be deprecated in the future. " + "Please use the `format` function in model wrapper object " + "instead. More details refer to ", + "https://modelscope.github.io/agentscope/en/tutorial/206-prompt" + ".html", + )
    + + +
    +[文档] + def join( + self, + *args: Any, + format_map: Optional[dict] = None, + ) -> Union[str, list[dict]]: + """Join prompt components according to its type. The join function can + accept any number and type of arguments. If prompt type is + `PromptType.STRING`, the arguments will be joined by `"\\\\n"`. If + prompt type is `PromptType.LIST`, the string arguments will be + converted to `Msg` from `system`. + """ + # TODO: achieve the summarize function + + # Filter `None` + args = [_ for _ in args if _ is not None] + + if self.prompt_type == PromptType.STRING: + return self.join_to_str(*args, format_map=format_map) + elif self.prompt_type == PromptType.LIST: + return self.join_to_list(*args, format_map=format_map) + else: + raise RuntimeError("Invalid prompt type.")
    + + +
    +[文档] + def join_to_str(self, *args: Any, format_map: Union[dict, None]) -> str: + """Join prompt components to a string.""" + prompt = [] + for item in args: + if isinstance(item, list): + items_str = self.join_to_str(*item, format_map=None) + prompt += [items_str] + elif isinstance(item, dict): + prompt.append(to_dialog_str(item)) + else: + prompt.append(str(item)) + prompt_str = "\n".join(prompt) + + if format_map is not None: + prompt_str = prompt_str.format_map(format_map) + + return prompt_str
    + + +
    +[文档] + def join_to_list(self, *args: Any, format_map: Union[dict, None]) -> list: + """Join prompt components to a list of `Msg` objects.""" + prompt = [] + for item in args: + if isinstance(item, list): + # nested processing + prompt.extend(self.join_to_list(*item, format_map=None)) + elif isinstance(item, dict): + prompt.append(to_openai_dict(item)) + else: + prompt.append(to_openai_dict({"content": str(item)})) + + if format_map is not None: + format_prompt = [] + for msg in prompt: + format_prompt.append( + { + k.format_map(format_map): v.format_map(format_map) + for k, v in msg.items() + }, + ) + prompt = format_prompt + + return prompt
    +
    + +
    + +
    +
    +
    + +
    + +
    +

    © 版权所有 2024, Alibaba Tongyi Lab。

    +
    + + 利用 Sphinx 构建,使用的 + 主题 + 由 Read the Docs 开发. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/zh_CN/_modules/agentscope/rpc/rpc_agent_client.html b/zh_CN/_modules/agentscope/rpc/rpc_agent_client.html index b718fcbe9..31084b2f4 100644 --- a/zh_CN/_modules/agentscope/rpc/rpc_agent_client.html +++ b/zh_CN/_modules/agentscope/rpc/rpc_agent_client.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -116,10 +118,12 @@

    agentscope.rpc.rpc_agent_client 源代码

     
     
     
    -[文档] +[文档] class RpcAgentClient: """A client of Rpc agent server""" +
    +[文档] def __init__(self, host: str, port: int, agent_id: str = "") -> None: """Init a rpc agent client @@ -132,10 +136,11 @@

    agentscope.rpc.rpc_agent_client 源代码

             """
             self.host = host
             self.port = port
    -        self.agent_id = agent_id
    +        self.agent_id = agent_id
    +
    -[文档] +[文档] def call_func( self, func_name: str, @@ -165,7 +170,7 @@

    agentscope.rpc.rpc_agent_client 源代码

     
     
     
    -[文档] +[文档] def create_agent(self, agent_configs: Optional[dict]) -> None: """Create a new agent for this client.""" try: @@ -186,7 +191,7 @@

    agentscope.rpc.rpc_agent_client 源代码

     
     
     
    -[文档] +[文档] def delete_agent(self) -> None: """ Delete the agent created by this client. @@ -203,16 +208,19 @@

    agentscope.rpc.rpc_agent_client 源代码

     
     
     
    -[文档] +[文档] class ResponseStub: """A stub used to save the response of an rpc call in a sub-thread.""" +
    +[文档] def __init__(self) -> None: self.response = None - self.condition = threading.Condition() + self.condition = threading.Condition()
    +
    -[文档] +[文档] def set_response(self, response: str) -> None: """Set the message.""" with self.condition: @@ -221,7 +229,7 @@

    agentscope.rpc.rpc_agent_client 源代码

     
     
     
    -[文档] +[文档] def get_response(self) -> str: """Get the message.""" with self.condition: @@ -233,7 +241,7 @@

    agentscope.rpc.rpc_agent_client 源代码

     
     
     
    -[文档] +[文档] def call_in_thread( client: RpcAgentClient, x: dict, diff --git a/zh_CN/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html b/zh_CN/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html index a6e1a2cd3..52e9ebfa4 100644 --- a/zh_CN/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html +++ b/zh_CN/_modules/agentscope/rpc/rpc_agent_pb2_grpc.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -106,10 +108,12 @@

    agentscope.rpc.rpc_agent_pb2_grpc 源代码

     
     
     
    -[文档] +[文档] class RpcAgentStub(object): """Servicer for rpc agent server""" +
    +[文档] def __init__(self, channel): """Constructor. @@ -121,16 +125,17 @@

    agentscope.rpc.rpc_agent_pb2_grpc 源代码

                 request_serializer=rpc__agent__pb2.RpcMsg.SerializeToString,
                 response_deserializer=rpc__agent__pb2.RpcMsg.FromString,
             )
    +
    -[文档] +[文档] class RpcAgentServicer(object): """Servicer for rpc agent server"""
    -[文档] +[文档] def call_func(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -141,7 +146,7 @@

    agentscope.rpc.rpc_agent_pb2_grpc 源代码

     
     
     
    -[文档] +[文档] def add_RpcAgentServicer_to_server(servicer, server): rpc_method_handlers = { "call_func": grpc.unary_unary_rpc_method_handler( @@ -159,9 +164,13 @@

    agentscope.rpc.rpc_agent_pb2_grpc 源代码

     
     
     # This class is part of an EXPERIMENTAL API.
    +
    +[文档] class RpcAgent(object): """Servicer for rpc agent server""" +
    +[文档] @staticmethod def call_func( request, @@ -189,7 +198,9 @@

    agentscope.rpc.rpc_agent_pb2_grpc 源代码

                 wait_for_ready,
                 timeout,
                 metadata,
    -        )
    +        )
    +
    +
    diff --git a/zh_CN/_modules/agentscope/service.html b/zh_CN/_modules/agentscope/service.html index 53eda8bd7..d3f19a0ee 100644 --- a/zh_CN/_modules/agentscope/service.html +++ b/zh_CN/_modules/agentscope/service.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    diff --git a/zh_CN/_modules/agentscope/service/execute_code/exec_python.html b/zh_CN/_modules/agentscope/service/execute_code/exec_python.html index f545ee4e6..f11e3dbc4 100644 --- a/zh_CN/_modules/agentscope/service/execute_code/exec_python.html +++ b/zh_CN/_modules/agentscope/service/execute_code/exec_python.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -134,7 +136,7 @@

    agentscope.service.execute_code.exec_python 源代码

    -[文档] +[文档] def execute_python_code( code: str, timeout: Optional[Union[int, float]] = 300, @@ -459,6 +461,8 @@

    agentscope.service.execute_code.exec_python 源代码

    ) +
    +[文档] def sys_python_guard(maximum_memory_bytes: Optional[int] = None) -> None: """ This disables various destructive functions and prevents the generated code @@ -544,7 +548,8 @@

    agentscope.service.execute_code.exec_python 源代码

    "tkinter", ] for module_name in sys_modules_to_disable: - sys.modules[module_name] = None + sys.modules[module_name] = None
    +
    diff --git a/zh_CN/_modules/agentscope/service/execute_code/exec_shell.html b/zh_CN/_modules/agentscope/service/execute_code/exec_shell.html index 0a9e79874..5752936c7 100644 --- a/zh_CN/_modules/agentscope/service/execute_code/exec_shell.html +++ b/zh_CN/_modules/agentscope/service/execute_code/exec_shell.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -103,7 +105,7 @@

    agentscope.service.execute_code.exec_shell 源代码

    -[文档] +[文档] def execute_shell_command(command: str) -> ServiceResponse: """ Executes a given shell command. diff --git a/zh_CN/_modules/agentscope/service/file/common.html b/zh_CN/_modules/agentscope/service/file/common.html index ae5684dea..500f2b269 100644 --- a/zh_CN/_modules/agentscope/service/file/common.html +++ b/zh_CN/_modules/agentscope/service/file/common.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -107,7 +109,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def create_file(file_path: str, content: str = "") -> ServiceResponse: """ Create a file and write content to it. @@ -133,7 +135,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def delete_file(file_path: str) -> ServiceResponse: """Delete a file specified by the file path. @@ -162,7 +164,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def move_file(source_path: str, destination_path: str) -> ServiceResponse: """ Move a file from a source path to a destination path. @@ -204,7 +206,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def create_directory(directory_path: str) -> ServiceResponse: """ Create a directory at the specified path. @@ -239,7 +241,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def delete_directory(directory_path: str) -> ServiceResponse: """ Delete a directory and all of its contents. @@ -274,7 +276,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def move_directory( source_path: str, destination_path: str, @@ -320,7 +322,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def list_directory_content(directory_path: str) -> ServiceResponse: """ List the contents of a directory. i.e. ls -a @@ -359,7 +361,7 @@

    agentscope.service.file.common 源代码

     
     
     
    -[文档] +[文档] def get_current_directory() -> ServiceResponse: """ Get the current working directory path. diff --git a/zh_CN/_modules/agentscope/service/file/json.html b/zh_CN/_modules/agentscope/service/file/json.html index bf2d67348..b6e42cd7c 100644 --- a/zh_CN/_modules/agentscope/service/file/json.html +++ b/zh_CN/_modules/agentscope/service/file/json.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -106,7 +108,7 @@

    agentscope.service.file.json 源代码

     
     
     
    -[文档] +[文档] def read_json_file(file_path: str) -> ServiceResponse: """ Read and parse a JSON file. @@ -136,7 +138,7 @@

    agentscope.service.file.json 源代码

     
     
     
    -[文档] +[文档] def write_json_file( file_path: str, data: Any, diff --git a/zh_CN/_modules/agentscope/service/file/text.html b/zh_CN/_modules/agentscope/service/file/text.html index 0735660ba..0b57acbf6 100644 --- a/zh_CN/_modules/agentscope/service/file/text.html +++ b/zh_CN/_modules/agentscope/service/file/text.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -105,7 +107,7 @@

    agentscope.service.file.text 源代码

     
     
     
    -[文档] +[文档] def read_text_file(file_path: str) -> ServiceResponse: """ Read the content of the text file. @@ -135,7 +137,7 @@

    agentscope.service.file.text 源代码

     
     
     
    -[文档] +[文档] def write_text_file( file_path: str, content: str, diff --git a/zh_CN/_modules/agentscope/service/retrieval/retrieval_from_list.html b/zh_CN/_modules/agentscope/service/retrieval/retrieval_from_list.html index 428d0c2fe..4edb3c44e 100644 --- a/zh_CN/_modules/agentscope/service/retrieval/retrieval_from_list.html +++ b/zh_CN/_modules/agentscope/service/retrieval/retrieval_from_list.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -106,7 +108,7 @@

    agentscope.service.retrieval.retrieval_from_list 源代码

    -[文档] +[文档] def retrieve_from_list( query: Any, knowledge: Sequence, # TODO: rename diff --git a/zh_CN/_modules/agentscope/service/retrieval/similarity.html b/zh_CN/_modules/agentscope/service/retrieval/similarity.html index 43819a052..e44c7c366 100644 --- a/zh_CN/_modules/agentscope/service/retrieval/similarity.html +++ b/zh_CN/_modules/agentscope/service/retrieval/similarity.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -110,7 +112,7 @@

    agentscope.service.retrieval.similarity 源代码

    -[文档] +[文档] def cos_sim( a: Embedding, b: Embedding, diff --git a/zh_CN/_modules/agentscope/service/service_factory.html b/zh_CN/_modules/agentscope/service/service_factory.html index 557512ab2..3fbc31ca7 100644 --- a/zh_CN/_modules/agentscope/service/service_factory.html +++ b/zh_CN/_modules/agentscope/service/service_factory.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -148,13 +150,13 @@

    agentscope.service.service_factory 源代码

    -[文档]
    +[文档]
     class ServiceFactory:
         """A service factory class that turns service function into string
         prompt format."""
     
     
    -[文档] +[文档] @classmethod def get( cls, diff --git a/zh_CN/_modules/agentscope/service/service_response.html b/zh_CN/_modules/agentscope/service/service_response.html index ee667a326..757db3124 100644 --- a/zh_CN/_modules/agentscope/service/service_response.html +++ b/zh_CN/_modules/agentscope/service/service_response.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -103,13 +105,15 @@

    agentscope.service.service_response 源代码

    -[文档] +[文档] class ServiceResponse(dict): """Used to wrap the execution results of the services""" __setattr__ = dict.__setitem__ __getattr__ = dict.__getitem__ +
    +[文档] def __init__( self, status: ServiceExecStatus, @@ -128,6 +132,7 @@

    agentscope.service.service_response 源代码

    """ self.status = status self.content = content
    +
    diff --git a/zh_CN/_modules/agentscope/service/service_status.html b/zh_CN/_modules/agentscope/service/service_status.html index 44892a6c9..442d11384 100644 --- a/zh_CN/_modules/agentscope/service/service_status.html +++ b/zh_CN/_modules/agentscope/service/service_status.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -101,7 +103,7 @@

    agentscope.service.service_status 源代码

     
     
     
    -[文档] +[文档] class ServiceExecStatus(IntEnum): """Enum for service execution status.""" diff --git a/zh_CN/_modules/agentscope/service/sql_query/mongodb.html b/zh_CN/_modules/agentscope/service/sql_query/mongodb.html index 52a82eef7..13069f814 100644 --- a/zh_CN/_modules/agentscope/service/sql_query/mongodb.html +++ b/zh_CN/_modules/agentscope/service/sql_query/mongodb.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -109,7 +111,7 @@

    agentscope.service.sql_query.mongodb 源代码

    -[文档] +[文档] def query_mongodb( database: str, collection: str, diff --git a/zh_CN/_modules/agentscope/service/sql_query/mysql.html b/zh_CN/_modules/agentscope/service/sql_query/mysql.html index ae9a48019..cb852114b 100644 --- a/zh_CN/_modules/agentscope/service/sql_query/mysql.html +++ b/zh_CN/_modules/agentscope/service/sql_query/mysql.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -111,7 +113,7 @@

    agentscope.service.sql_query.mysql 源代码

    -[文档]
    +[文档]
     def query_mysql(
         database: str,
         query: str,
    diff --git a/zh_CN/_modules/agentscope/service/sql_query/sqlite.html b/zh_CN/_modules/agentscope/service/sql_query/sqlite.html
    index fc9a74eb3..b81a3f09e 100644
    --- a/zh_CN/_modules/agentscope/service/sql_query/sqlite.html
    +++ b/zh_CN/_modules/agentscope/service/sql_query/sqlite.html
    @@ -58,15 +58,17 @@
     
     

    AgentScope API 文档

    @@ -111,7 +113,7 @@

    agentscope.service.sql_query.sqlite 源代码

    -[文档] +[文档] def query_sqlite( database: str, query: str, diff --git a/zh_CN/_modules/agentscope/service/text_processing/summarization.html b/zh_CN/_modules/agentscope/service/text_processing/summarization.html index 1d26b036c..e9a3a2d27 100644 --- a/zh_CN/_modules/agentscope/service/text_processing/summarization.html +++ b/zh_CN/_modules/agentscope/service/text_processing/summarization.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -110,7 +112,7 @@

    agentscope.service.text_processing.summarization 源代码

    -[文档] +[文档] def summarization( model: ModelWrapperBase, text: str, diff --git a/zh_CN/_modules/agentscope/service/web/arxiv.html b/zh_CN/_modules/agentscope/service/web/arxiv.html index 7b8b3d851..ba2d58b7e 100644 --- a/zh_CN/_modules/agentscope/service/web/arxiv.html +++ b/zh_CN/_modules/agentscope/service/web/arxiv.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -310,7 +312,7 @@

    agentscope.service.web.arxiv 源代码

     
     
     
    @@ -106,7 +108,7 @@ 

    agentscope.service.web.download 源代码

     
     
     
    -[文档] +[文档] def download_from_url( url: str, filepath: str, diff --git a/zh_CN/_modules/agentscope/service/web/search.html b/zh_CN/_modules/agentscope/service/web/search.html index d26d128df..e7d47c9c2 100644 --- a/zh_CN/_modules/agentscope/service/web/search.html +++ b/zh_CN/_modules/agentscope/service/web/search.html @@ -58,15 +58,17 @@

    AgentScope API 文档

    @@ -105,7 +107,7 @@

    agentscope.service.web.search 源代码