diff --git a/examples/city_simulator/demo.py b/examples/city_simulator/demo.py index 7dde70f..2671c73 100644 --- a/examples/city_simulator/demo.py +++ b/examples/city_simulator/demo.py @@ -6,7 +6,7 @@ from pycityagent.environment.simulator import Simulator from pycityagent.llm import LLM from pycityagent.memory.memory import Memory -from pycityagent.workflow.tool import ResetAgentPosition, UpdateWithSimulator +from pycityagent.tools import ResetAgentPosition, UpdateWithSimulator from pycityproto.city.person.v2 import person_pb2 as person_pb2 logging.basicConfig( diff --git a/examples/cityagent/blocks/cognition_block.py b/examples/cityagent/blocks/cognition_block.py index 254444c..2f10b4c 100644 --- a/examples/cityagent/blocks/cognition_block.py +++ b/examples/cityagent/blocks/cognition_block.py @@ -8,7 +8,7 @@ class CognitionBlock(Block): def __init__(self, llm: LLM, memory: Memory): super().__init__("CognitionBlock", llm) - self.memory = memory + self.set_memory(memory) async def forward(self): print(f"执行认知更新") diff --git a/examples/cityagent/blocks/mobility_block.py b/examples/cityagent/blocks/mobility_block.py index e53adc0..19cedf0 100644 --- a/examples/cityagent/blocks/mobility_block.py +++ b/examples/cityagent/blocks/mobility_block.py @@ -8,7 +8,7 @@ import numpy as np from pycityagent.workflow.prompt import FormatPrompt -from pycityagent.workflow.tool import GetMap +from pycityagent.tools import GetMap PLACE_TYPE_SELECTION_PROMPT = """ 作为一个智能决策系统,请从用户输入的需求中判断其需要前往的地点类型。 diff --git a/examples/cityagent/cityagent.py b/examples/cityagent/cityagent.py index 4a0b956..30ed7e9 100644 --- a/examples/cityagent/cityagent.py +++ b/examples/cityagent/cityagent.py @@ -10,7 +10,7 @@ from pycityagent import CitizenAgent, Simulator from pycityagent.llm.llm import LLM from pycityagent.memory import Memory -from pycityagent.workflow.tool import ResetAgentPosition, UpdateWithSimulator +from pycityagent.tools import ResetAgentPosition, UpdateWithSimulator class MyAgent(CitizenAgent): diff --git a/pycityagent/cityagent/nbsagent.py b/pycityagent/cityagent/nbsagent.py index c66f229..93470df 100644 --- a/pycityagent/cityagent/nbsagent.py +++ b/pycityagent/cityagent/nbsagent.py @@ -9,7 +9,7 @@ from pycityagent.llm.llm import LLM from pycityagent.memory import Memory from pycityagent.message import Messager -from pycityagent.workflow.tool import ExportMlflowMetrics +from pycityagent.tools import ExportMlflowMetrics logger = logging.getLogger("pycityagent") diff --git a/pycityagent/cityagent/societyagent.py b/pycityagent/cityagent/societyagent.py index 34d9d51..18caa87 100644 --- a/pycityagent/cityagent/societyagent.py +++ b/pycityagent/cityagent/societyagent.py @@ -10,7 +10,7 @@ from pycityagent.memory import Memory from pycityagent.message import Messager from pycityagent.workflow import Block -from pycityagent.workflow.tool import UpdateWithSimulator +from pycityagent.tools import UpdateWithSimulator from .blocks import (CognitionBlock, EconomyBlock, MobilityBlock, NeedsBlock, OtherBlock, PlanBlock, SocialBlock) diff --git a/pycityagent/tools/__init__.py b/pycityagent/tools/__init__.py index bb6001f..63d6fa0 100644 --- a/pycityagent/tools/__init__.py +++ b/pycityagent/tools/__init__.py @@ -1,4 +1,5 @@ -from .tool import ExportMlflowMetrics, GetMap, SencePOI, Tool, UpdateWithSimulator +from .tool import (ExportMlflowMetrics, GetMap, ResetAgentPosition, SencePOI, + Tool, UpdateWithSimulator) __all__ = [ "SencePOI", @@ -6,4 +7,5 @@ "ExportMlflowMetrics", "GetMap", "UpdateWithSimulator", + "ResetAgentPosition", ] diff --git a/pyproject.toml b/pyproject.toml index d52f85e..6d41065 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pycityagent" -version = "2.0.0a50" # change it for each release +version = "2.0.0a51" # change it for each release description = "LLM-based city environment agent building library" authors = [ { name = "Yuwei Yan", email = "pinkgranite86@gmail.com" },