goose-py 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
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.
goose/agent.py
CHANGED
@@ -2,7 +2,7 @@ import base64
|
|
2
2
|
import logging
|
3
3
|
from datetime import datetime
|
4
4
|
from enum import StrEnum
|
5
|
-
from typing import Any, Callable, ClassVar, Literal, NotRequired, TypedDict
|
5
|
+
from typing import Any, Awaitable, Callable, ClassVar, Literal, NotRequired, TypedDict
|
6
6
|
|
7
7
|
from litellm import acompletion
|
8
8
|
from pydantic import BaseModel, computed_field
|
@@ -141,11 +141,11 @@ class Agent:
|
|
141
141
|
*,
|
142
142
|
flow_name: str,
|
143
143
|
run_id: str,
|
144
|
-
logger: Callable[[AgentResponse[Any]], None] | None = None,
|
144
|
+
logger: Callable[[AgentResponse[Any]], Awaitable[None]] | None = None,
|
145
145
|
) -> None:
|
146
146
|
self.flow_name = flow_name
|
147
147
|
self.run_id = run_id
|
148
|
-
self.logger = logger
|
148
|
+
self.logger = logger
|
149
149
|
|
150
150
|
async def __call__[R: BaseModel](
|
151
151
|
self,
|
@@ -192,5 +192,9 @@ class Agent:
|
|
192
192
|
end_time=end_time,
|
193
193
|
)
|
194
194
|
|
195
|
-
self.logger
|
195
|
+
if self.logger is not None:
|
196
|
+
await self.logger(agent_response)
|
197
|
+
else:
|
198
|
+
logging.info(agent_response.model_dump())
|
199
|
+
|
196
200
|
return agent_response.response
|
@@ -1,8 +1,8 @@
|
|
1
1
|
goose/__init__.py,sha256=wUKxLPSbhPl5Vv4HRK3wuWwanUtpgbe8toT31cM0ZLU,144
|
2
|
-
goose/agent.py,sha256=
|
2
|
+
goose/agent.py,sha256=ck_3uRdyhmgaygowy436CQYZIEFa6sA-7y5bzRNAWd8,5454
|
3
3
|
goose/errors.py,sha256=-0OyZQJWYTRw5YgnCB2_uorVaUsL6Z0QYQO2FqzCiyg,32
|
4
4
|
goose/flow.py,sha256=K29ugPXLuGrsHBVry3WH94FE6_6Epg30-04V5Q69JPo,10482
|
5
5
|
goose/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
goose_py-0.2.
|
7
|
-
goose_py-0.2.
|
8
|
-
goose_py-0.2.
|
6
|
+
goose_py-0.2.1.dist-info/METADATA,sha256=_BuAp1wz1Gmm-BX87W15FjYATHI5_YJUm_Ts9ROp-jM,1106
|
7
|
+
goose_py-0.2.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
8
|
+
goose_py-0.2.1.dist-info/RECORD,,
|
File without changes
|