Skip to content

Commit

Permalink
fix(agent): remove wrongly initialized agent_id from agent's context
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin De Matos <vltn.dematos@gmail.com>
  • Loading branch information
Thytu committed Dec 24, 2024
1 parent 3c9a483 commit 8fbab7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion agentarium/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def __init__(self, **kwargs):
if not Agent._allow_init:
raise RuntimeError("Agent instances should be created using Agent.create_agent()")

self.agent_id = kwargs.get("agent_id") if "agent_id" in kwargs and kwargs["agent_id"] != DefaultValue.NOT_PROVIDED else faker.uuid4()
if "agent_id" in kwargs:
self.agent_id = kwargs.pop("agent_id")

self.agent_id = self.agent_id if self.agent_id!= DefaultValue.NOT_PROVIDED else faker.uuid4()
self.agent_informations: dict = kwargs or {}

if "gender" not in kwargs or kwargs["gender"] == DefaultValue.NOT_PROVIDED:
Expand Down
2 changes: 1 addition & 1 deletion agentarium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .AgentInteractionManager import AgentInteractionManager
from .Interaction import Interaction

__version__ = "0.2.1"
__version__ = "0.2.2"

__all__ = [
"Agent",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "agentarium"
version = "0.2.1"
version = "0.2.2"
authors = [
{ name = "thytu" },
]
Expand Down

0 comments on commit 8fbab7a

Please sign in to comment.