Skip to content

Commit 8fbab7a

Browse files
committed
fix(agent): remove wrongly initialized agent_id from agent's context
Signed-off-by: Valentin De Matos <[email protected]>
1 parent 3c9a483 commit 8fbab7a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

agentarium/Agent.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ def __init__(self, **kwargs):
102102
if not Agent._allow_init:
103103
raise RuntimeError("Agent instances should be created using Agent.create_agent()")
104104

105-
self.agent_id = kwargs.get("agent_id") if "agent_id" in kwargs and kwargs["agent_id"] != DefaultValue.NOT_PROVIDED else faker.uuid4()
105+
if "agent_id" in kwargs:
106+
self.agent_id = kwargs.pop("agent_id")
107+
108+
self.agent_id = self.agent_id if self.agent_id!= DefaultValue.NOT_PROVIDED else faker.uuid4()
106109
self.agent_informations: dict = kwargs or {}
107110

108111
if "gender" not in kwargs or kwargs["gender"] == DefaultValue.NOT_PROVIDED:

agentarium/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .AgentInteractionManager import AgentInteractionManager
44
from .Interaction import Interaction
55

6-
__version__ = "0.2.1"
6+
__version__ = "0.2.2"
77

88
__all__ = [
99
"Agent",

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "agentarium"
7-
version = "0.2.1"
7+
version = "0.2.2"
88
authors = [
99
{ name = "thytu" },
1010
]

0 commit comments

Comments
 (0)