The Agent Graph saves all the social agents in the simulation. In this section, we will introduce how to create an AgentGraph
and some useful methods within it.
AgentGraph
:AgentGraph
from a csv
or json
file, which contains the agent profiles.AgentGraph
and add each customized agent.AgentGraph
from the agent profile filesParameter | Type | Required | Default | Description |
---|---|---|---|---|
profile_path | str | ✔ | - | Path to a CSV or JSON file storing agent profiles. For details on different profile formats, see Agent Profile section. |
model | BaseModelBackend or List[BaseModelBackend] or ModelManager | ✗ | gpt-4o-mini | The large language model(s) used by the all agents. |
available_actions | list[ActionType] | ✗ | None | List of allowed actions in the social platform for all agents. For more details, see Actions - OASIS. If set to None , all actions are enabled by default. |
AgentGraph
from a profile fileAgentGraph
and customize each agentAgentGraph
AgentGraph
AgentGraph
.
For more details on how to customize the SocialAgent
class, see Social Agent Module.
AgentGraph
agent_graph.get_agent(agent_id)
SocialAgent
by agent_id
.agent_id
: The agent_id
of the SocialAgent
to get.SocialAgent
: The SocialAgent
with the given agent_id
.agent_graph.get_all_agents()
SocialAgent
in the AgentGraph
.agent_id
and the corresponding SocialAgent
.agent_graph.get_num_nodes()
SocialAgent
in the AgentGraph
.SocialAgent
in the AgentGraph
.