Skip to content

Commit 1d86064

Browse files
tschellenbachdangusev
authored andcommitted
[AI-246] Agents cleanup - part one (#157)
* first bit of cleanup * audio queue cleanup * more cleanup * more event cleanup * cleanup * fixes * closer * fix audio * wip on video forwarder cleanup * clean tests for forwarder * cleanup integrations of forwarder * remove logging * typing cleanup
1 parent 54d5963 commit 1d86064

File tree

22 files changed

+1400
-1039
lines changed

22 files changed

+1400
-1039
lines changed

.cursor/rules/python.mdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ never mock.
88
tests use pytest.
99
never adjust sys.path.
1010

11+
never write: except Exception as e
12+
1113
docs should be short.
1214
docstrings should follow the google style guides for docstrings.
1315

agents-core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ include = ["vision_agents"]
9191
#]
9292
# getstream = { git = "https://github.com/GetStream/stream-py.git", branch = "audio-more" }
9393
# for local development
94-
#getstream = { path = "../../stream-py/", editable = true }
94+
getstream = { path = "../../stream-py/", editable = true }
9595
# aiortc = { path = "../stream-py/", editable = true }
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import tempfile
2+
from dataclasses import dataclass, asdict
3+
4+
5+
@dataclass
6+
class AgentOptions:
7+
model_dir: str
8+
9+
def update(self, other: "AgentOptions") -> "AgentOptions":
10+
merged_dict = asdict(self)
11+
12+
for key, value in asdict(other).items():
13+
if value is not None:
14+
merged_dict[key] = value
15+
16+
return AgentOptions(**merged_dict)
17+
18+
19+
# Cache tempdir at module load time to avoid blocking I/O during async operations
20+
_DEFAULT_MODEL_DIR = tempfile.gettempdir()
21+
22+
23+
def default_agent_options():
24+
return AgentOptions(model_dir=_DEFAULT_MODEL_DIR)

0 commit comments

Comments
 (0)