Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/epstein_civil_violence/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
make_space_component,
)

from examples.epstein_civil_violence.agents import Citizen, CitizenState, Cop
from examples.epstein_civil_violence.model import EpsteinModel
from mesa_llm.parallel_stepping import enable_automatic_parallel_stepping
from mesa_llm.reasoning.react import ReActReasoning

from .agents import Citizen, CitizenState, Cop
from .model import EpsteinModel

# Suppress Pydantic serialization warnings
warnings.filterwarnings(
"ignore",
Expand Down
5 changes: 3 additions & 2 deletions examples/epstein_civil_violence/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from mesa.space import MultiGrid
from rich import print

from examples.epstein_civil_violence.agents import Citizen, CitizenState, Cop
from mesa_llm.reasoning.reasoning import Reasoning
from mesa_llm.recording.record_model import record_model

from .agents import Citizen, CitizenState, Cop


@record_model(output_dir="recordings")
class EpsteinModel(Model):
Expand Down Expand Up @@ -111,7 +112,7 @@ def step(self):
run the model without the solara integration with:
conda activate mesa-llm && python -m examples.epstein_civil_violence.model
"""
from examples.epstein_civil_violence.app import model
from .app import model

for _ in range(5):
model.step()
5 changes: 3 additions & 2 deletions examples/epstein_civil_violence/tools.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import random
from typing import TYPE_CHECKING

from examples.epstein_civil_violence.agents import (
from mesa_llm.tools.tool_decorator import tool

from .agents import (
CitizenState,
citizen_tool_manager,
cop_tool_manager,
)
from mesa_llm.tools.tool_decorator import tool

if TYPE_CHECKING:
from mesa_llm.llm_agent import LLMAgent
Expand Down
5 changes: 3 additions & 2 deletions examples/negotiation/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
make_space_component,
)

from examples.negotiation.agents import BuyerAgent, SellerAgent
from examples.negotiation.model import NegotiationModel
from mesa_llm.parallel_stepping import enable_automatic_parallel_stepping
from mesa_llm.reasoning.react import ReActReasoning

from .agents import BuyerAgent, SellerAgent
from .model import NegotiationModel

# Suppress Pydantic serialization warnings
warnings.filterwarnings(
"ignore",
Expand Down
5 changes: 3 additions & 2 deletions examples/negotiation/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from mesa.space import MultiGrid
from rich import print

from examples.negotiation.agents import BuyerAgent, SellerAgent
from mesa_llm.reasoning.reasoning import Reasoning

from .agents import BuyerAgent, SellerAgent


# @record_model
class NegotiationModel(Model):
Expand Down Expand Up @@ -133,7 +134,7 @@ def step(self):
conda activate mesa-llm && python -m examples.negotiation.model
"""

from examples.negotiation.app import model
from .app import model

# Run the model for 10 steps
for _ in range(10):
Expand Down
3 changes: 2 additions & 1 deletion examples/negotiation/tools.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from typing import TYPE_CHECKING

from examples.negotiation.agents import buyer_tool_manager
from mesa_llm.tools.tool_decorator import tool

from .agents import buyer_tool_manager

if TYPE_CHECKING:
from mesa_llm.llm_agent import LLMAgent

Expand Down
5 changes: 3 additions & 2 deletions examples/sugarscrap_g1mt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
make_space_component,
)

from examples.sugarscrap_g1mt.agents import Resource, Trader
from examples.sugarscrap_g1mt.model import SugarScapeModel
from mesa_llm.reasoning.react import ReActReasoning

from .agents import Resource, Trader
from .model import SugarScapeModel

# Suppress Pydantic serialization warnings
warnings.filterwarnings(
"ignore",
Expand Down
3 changes: 2 additions & 1 deletion examples/sugarscrap_g1mt/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
from mesa.space import MultiGrid
from rich import print

from examples.sugarscrap_g1mt.agents import Resource, Trader
from mesa_llm.reasoning.reasoning import Reasoning
from mesa_llm.recording.record_model import record_model

from .agents import Resource, Trader


# Helper Functions
def flatten(list_of_lists):
Expand Down
5 changes: 3 additions & 2 deletions examples/sugarscrap_g1mt/tools.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from typing import TYPE_CHECKING

from examples.sugarscrap_g1mt.agents import (
from mesa_llm.tools.tool_decorator import tool

from .agents import (
Resource,
Trader,
trader_tool_manager,
)
from mesa_llm.tools.tool_decorator import tool

if TYPE_CHECKING:
from mesa_llm.llm_agent import LLMAgent
Expand Down