econagents 0.0.9__tar.gz → 0.0.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {econagents-0.0.9 → econagents-0.0.10}/PKG-INFO +1 -1
- {econagents-0.0.9 → econagents-0.0.10}/econagents/__init__.py +1 -1
- {econagents-0.0.9 → econagents-0.0.10}/econagents/llm/base.py +0 -1
- {econagents-0.0.9 → econagents-0.0.10}/econagents/llm/ollama.py +9 -4
- {econagents-0.0.9 → econagents-0.0.10}/econagents/llm/openai.py +9 -4
- {econagents-0.0.9 → econagents-0.0.10}/pyproject.toml +4 -4
- {econagents-0.0.9 → econagents-0.0.10}/LICENSE +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/README.md +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/_c_extension.pyi +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/cli.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/config_parser/__init__.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/config_parser/base.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/config_parser/basic.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/__init__.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/agent_role.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/events.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/game_runner.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/logging_mixin.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/manager/__init__.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/manager/base.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/manager/phase.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/state/__init__.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/state/fields.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/state/game.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/core/transport.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/llm/__init__.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/llm/observability.py +0 -0
- {econagents-0.0.9 → econagents-0.0.10}/econagents/py.typed +0 -0
@@ -12,7 +12,7 @@ from econagents.core.state.game import GameState, MetaInformation, PrivateInform
|
|
12
12
|
from econagents.llm.openai import ChatOpenAI
|
13
13
|
|
14
14
|
# Don't manually change, let poetry-dynamic-versioning handle it.
|
15
|
-
__version__ = "0.0.
|
15
|
+
__version__ = "0.0.10"
|
16
16
|
|
17
17
|
__all__: list[str] = [
|
18
18
|
"AgentRole",
|
@@ -15,6 +15,7 @@ class ChatOllama(BaseLLM):
|
|
15
15
|
self,
|
16
16
|
model_name: str,
|
17
17
|
host: Optional[str] = None,
|
18
|
+
response_kwargs: Optional[dict[str, Any]] = None,
|
18
19
|
) -> None:
|
19
20
|
"""Initialize the Ollama LLM interface.
|
20
21
|
|
@@ -25,17 +26,19 @@ class ChatOllama(BaseLLM):
|
|
25
26
|
self._check_ollama_available()
|
26
27
|
self.model_name = model_name
|
27
28
|
self.host = host
|
29
|
+
self._response_kwargs = response_kwargs or {}
|
28
30
|
|
29
31
|
def _check_ollama_available(self) -> None:
|
30
32
|
"""Check if Ollama is available."""
|
31
33
|
if not importlib.util.find_spec("ollama"):
|
32
|
-
raise ImportError(
|
34
|
+
raise ImportError(
|
35
|
+
"Ollama is not installed. Install it with: pip install econagents[ollama]"
|
36
|
+
)
|
33
37
|
|
34
38
|
async def get_response(
|
35
39
|
self,
|
36
40
|
messages: List[Dict[str, Any]],
|
37
41
|
tracing_extra: Dict[str, Any],
|
38
|
-
**kwargs: Any,
|
39
42
|
) -> str:
|
40
43
|
"""Get a response from the LLM.
|
41
44
|
|
@@ -58,7 +61,7 @@ class ChatOllama(BaseLLM):
|
|
58
61
|
response = await client.chat(
|
59
62
|
model=self.model_name,
|
60
63
|
messages=messages,
|
61
|
-
**
|
64
|
+
**(self._response_kwargs),
|
62
65
|
)
|
63
66
|
|
64
67
|
# End the LLM run
|
@@ -74,4 +77,6 @@ class ChatOllama(BaseLLM):
|
|
74
77
|
|
75
78
|
except ImportError as e:
|
76
79
|
logger.error(f"Failed to import Ollama: {e}")
|
77
|
-
raise ImportError(
|
80
|
+
raise ImportError(
|
81
|
+
"Ollama is not installed. Install it with: pip install econagents[ollama]"
|
82
|
+
) from e
|
@@ -14,6 +14,7 @@ class ChatOpenAI(BaseLLM):
|
|
14
14
|
self,
|
15
15
|
model_name: str = "gpt-4o",
|
16
16
|
api_key: Optional[str] = None,
|
17
|
+
response_kwargs: Optional[dict[str, Any]] = None,
|
17
18
|
) -> None:
|
18
19
|
"""Initialize the OpenAI LLM interface.
|
19
20
|
|
@@ -24,17 +25,19 @@ class ChatOpenAI(BaseLLM):
|
|
24
25
|
self.model_name = model_name
|
25
26
|
self.api_key = api_key
|
26
27
|
self._check_openai_available()
|
28
|
+
self._response_kwargs = response_kwargs or {}
|
27
29
|
|
28
30
|
def _check_openai_available(self) -> None:
|
29
31
|
"""Check if OpenAI is available."""
|
30
32
|
if not importlib.util.find_spec("openai"):
|
31
|
-
raise ImportError(
|
33
|
+
raise ImportError(
|
34
|
+
"OpenAI is not installed. Install it with: pip install econagents[openai]"
|
35
|
+
)
|
32
36
|
|
33
37
|
async def get_response(
|
34
38
|
self,
|
35
39
|
messages: list[dict[str, Any]],
|
36
40
|
tracing_extra: dict[str, Any],
|
37
|
-
**kwargs: Any,
|
38
41
|
) -> str:
|
39
42
|
"""Get a response from the LLM.
|
40
43
|
|
@@ -59,7 +62,7 @@ class ChatOpenAI(BaseLLM):
|
|
59
62
|
model=self.model_name,
|
60
63
|
messages=messages, # type: ignore
|
61
64
|
response_format={"type": "json_object"},
|
62
|
-
**
|
65
|
+
**(self._response_kwargs),
|
63
66
|
)
|
64
67
|
|
65
68
|
# Track the LLM call using the observability provider
|
@@ -74,4 +77,6 @@ class ChatOpenAI(BaseLLM):
|
|
74
77
|
return response.choices[0].message.content
|
75
78
|
except ImportError as e:
|
76
79
|
logger.error(f"Failed to import OpenAI: {e}")
|
77
|
-
raise ImportError(
|
80
|
+
raise ImportError(
|
81
|
+
"OpenAI is not installed. Install it with: pip install econagents[openai]"
|
82
|
+
) from e
|
@@ -27,7 +27,7 @@ dependencies = [
|
|
27
27
|
|
28
28
|
[tool.poetry]
|
29
29
|
name = "econagents"
|
30
|
-
version = "0.0.
|
30
|
+
version = "0.0.10" # Do not change, let poetry-dynamic-versioning handle it.
|
31
31
|
packages = [{include = "econagents"}]
|
32
32
|
include = ["econagents/*.so", "econagents/*.pyd"] # Compiled extensions
|
33
33
|
license = "MIT"
|
@@ -65,10 +65,10 @@ pytest-mock = ">=3.7.0"
|
|
65
65
|
python-dotenv = "^1.1.1"
|
66
66
|
jupyter = "^1.1.1"
|
67
67
|
nest-asyncio = "^1.6.0"
|
68
|
-
ruff = "^0.12.
|
69
|
-
types-requests = "^2.32.4.
|
68
|
+
ruff = "^0.12.12"
|
69
|
+
types-requests = "^2.32.4.20250809"
|
70
70
|
pytest-asyncio = "^1.1.0"
|
71
|
-
types-pyyaml = "^6.0.12.
|
71
|
+
types-pyyaml = "^6.0.12.20250822"
|
72
72
|
|
73
73
|
[tool.poetry.group.debug]
|
74
74
|
optional = true
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|