Skip to content

Commit 1e8b72d

Browse files
committed
fix: resolve pre-commit script issues and update mypy configuration
- Fix unused lambda arguments in observability example - Add mypy overrides for optional voice dependencies (deepgram, elevenlabs, cartesia) - Remove redundant type ignore comments from voice providers - Apply ruff formatting to examples and test files
1 parent 93b2858 commit 1e8b72d

36 files changed

+130
-612
lines changed

examples/01_minimal/agent_with_budget.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
print(f"Budget exceeded (expected): {e}")
4040
print()
4141

42+
4243
# --- Example 3: Class-level budget ---
4344
class CostAwareAgent(Agent):
4445
model = model

examples/01_minimal/quick_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
print(f"Preset: {response2.content}")
2828
print()
2929

30+
3031
# --- Way 3: Class-based (best for reuse) ---
3132
class MyAgent(Agent):
3233
model = model

examples/01_minimal/response_object.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
# --- Core fields ---
2222
print("=== Response Object ===")
23-
print(f"Content: {response.content}") # The answer text
24-
print(f"Cost: ${response.cost:.6f}") # USD spent
25-
print(f"Tokens: {response.tokens}") # Total tokens used
26-
print(f"Model: {response.model}") # Model that responded
27-
print(f"Duration: {response.duration:.2f}s") # Wall-clock time
28-
print(f"Success: {bool(response)}") # True if response has content
23+
print(f"Content: {response.content}") # The answer text
24+
print(f"Cost: ${response.cost:.6f}") # USD spent
25+
print(f"Tokens: {response.tokens}") # Total tokens used
26+
print(f"Model: {response.model}") # Model that responded
27+
print(f"Duration: {response.duration:.2f}s") # Wall-clock time
28+
print(f"Success: {bool(response)}") # True if response has content
2929
print()
3030

3131
# --- Budget info (only if budget is set) ---

examples/02_tasks/multiple_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
from syrin import Agent, Model, task
1414

15-
1615
# --- Define the agent with two tasks ---
1716

17+
1818
class Writer(Agent):
1919
"""Agent with research and write tasks."""
2020

examples/02_tasks/single_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
from syrin import Agent, Model, task
1414

15-
1615
# --- Define the agent with a single task ---
1716

17+
1818
class Researcher(Agent):
1919
"""Agent that researches topics. Uses @task for a named API."""
2020

examples/02_tasks/task_with_output_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
from syrin import Agent, Model, task
1414

15-
1615
# --- Define the triage agent ---
1716

17+
1818
class TriageAgent(Agent):
1919
"""Agent that triages items with structured output."""
2020

examples/03_budget/basic_budget.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def my_callback(ctx):
6363
print(f"Events captured: {len(exceeded_events)}")
6464
print()
6565

66+
6667
# ============================================================
6768
# 5. Class-level budget — reusable agent definition
6869
# ============================================================

examples/03_budget/rate_limits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def on_warning(ctx: ThresholdContext) -> None:
100100
)
101101
),
102102
)
103-
print(f" Agent configured with RPM=100, threshold at 80%")
103+
print(" Agent configured with RPM=100, threshold at 80%")
104104

105105
# ---------------------------------------------------------------------------
106106
# 6. Multiple thresholds (RPM + TPM)
@@ -135,7 +135,7 @@ def on_warning(ctx: ThresholdContext) -> None:
135135
),
136136
),
137137
)
138-
print(f" Agent configured with 3 thresholds on RPM/TPM")
138+
print(" Agent configured with 3 thresholds on RPM/TPM")
139139

140140
# ---------------------------------------------------------------------------
141141
# 7. Class-level rate limits (reusable agent definition)

examples/03_budget/token_limits.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@
1515

1616
from __future__ import annotations
1717

18-
from syrin import Agent, AgentConfig, Budget, Context, Model, TokenLimits, TokenRateLimit, warn_on_exceeded
18+
from syrin import (
19+
Agent,
20+
AgentConfig,
21+
Budget,
22+
Context,
23+
Model,
24+
TokenLimits,
25+
TokenRateLimit,
26+
warn_on_exceeded,
27+
)
1928

2029
# Create a mock model — no API key needed
2130
model = Model.Almock()

examples/04_memory/consolidate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from __future__ import annotations
1313

14-
from syrin import Memory, Model
14+
from syrin import Memory
1515
from syrin.enums import MemoryType
1616

1717

0 commit comments

Comments
 (0)