Skip to content

Building AI agents, atomically

fix: resolve pre-existing flake8 issues in examples

KennyVaneetvelde3adf203d7eff
diff --git a/atomic-examples/dspy-integration/dspy_integration/domain/datasets.py b/atomic-examples/dspy-integration/dspy_integration/domain/datasets.py
index 10ad99f..0992071 100644
--- a/atomic-examples/dspy-integration/dspy_integration/domain/datasets.py
+++ b/atomic-examples/dspy-integration/dspy_integration/domain/datasets.py
@@ -315,11 +315,17 @@ _SARCASM_TESTS: List[MovieExample] = [
"genre": "comedy",
},
{
- "review": "Wow, they really subverted my expectations by doing exactly what I expected. The jokes were so obvious they circled back to funny.",
+ "review": (
+ "Wow, they really subverted my expectations by doing exactly what I expected. "
+ "The jokes were so obvious they circled back to funny."
+ ),
"genre": "comedy",
},
{
- "review": "Another 'scary' movie where the characters make terrible decisions. At least the kills were creative. Actually terrifying creature design though.",
+ "review": (
+ "Another 'scary' movie where the characters make terrible decisions. "
+ "At least the kills were creative. Actually terrifying creature design though."
+ ),
"genre": "horror",
},
]
@@ -339,7 +345,10 @@ _MULTIGENRE_TESTS: List[MovieExample] = [
"genre": "romance",
},
{
- "review": "It's technically a war movie but really it's about two soldiers finding love in the trenches. The battle scenes support the love story.",
+ "review": (
+ "It's technically a war movie but really it's about two soldiers finding love "
+ "in the trenches. The battle scenes support the love story."
+ ),
"genre": "romance",
},
{
diff --git a/atomic-examples/progressive-disclosure/progressive_disclosure/main.py b/atomic-examples/progressive-disclosure/progressive_disclosure/main.py
index a5d969d..35036da 100644
--- a/atomic-examples/progressive-disclosure/progressive_disclosure/main.py
+++ b/atomic-examples/progressive-disclosure/progressive_disclosure/main.py
@@ -25,7 +25,7 @@ import os
import shlex
from contextlib import AsyncExitStack
from dataclasses import dataclass, field
-from typing import Optional, List, Type, Dict
+from typing import List, Type, Dict
import instructor
import openai
@@ -49,7 +49,6 @@ from progressive_disclosure.agents.tool_finder_agent import (
)
from progressive_disclosure.agents.orchestrator_agent import (
OrchestratorFactory,
- FinalResponseSchema,
execute_orchestrator_loop,
execute_orchestrator_loop_parallel,
)
@@ -337,9 +336,12 @@ def main():
)
if finder_result.selected_tools:
+ tools_count = len(finder_result.selected_tools)
+ tokens_saved = (len(all_tools) - tools_count) * 500
console.print(
- f"[green]Orchestrator context: {len(finder_result.selected_tools)} tools "
- f"(filtered {stats.tools_filtered_percentage:.0f}% = saved ~{(len(all_tools) - len(finder_result.selected_tools)) * 500} tokens)[/green]"
+ f"[green]Orchestrator context: {tools_count} tools "
+ f"(filtered {stats.tools_filtered_percentage:.0f}% = "
+ f"saved ~{tokens_saved} tokens)[/green]"
)
else:
console.print("[yellow]No tools needed - conversational response[/yellow]")