VibecoderMcSwaggins commited on
Commit
586a3f1
·
1 Parent(s): e0c585c

fix: add future annotations to workflow.py for runtime type compatibility

Browse files

The string annotation "BaseCheckpointSaver[Any]" | None failed at runtime
because Python can't use | with string literals. Adding
`from __future__ import annotations` makes all annotations strings
evaluated lazily, fixing the TypeError.

Also removed now-unnecessary quotes per ruff UP037.

Files changed (1) hide show
  1. src/agents/graph/workflow.py +4 -2
src/agents/graph/workflow.py CHANGED
@@ -1,5 +1,7 @@
1
  """DeepBoner research workflow definition using LangGraph."""
2
 
 
 
3
  from functools import partial
4
  from typing import Any
5
 
@@ -21,9 +23,9 @@ from src.services.embeddings import EmbeddingService
21
 
22
  def create_research_graph(
23
  llm: BaseChatModel | None = None,
24
- checkpointer: "BaseCheckpointSaver[Any]" | None = None, # Generic type from langgraph
25
  embedding_service: EmbeddingService | None = None,
26
- ) -> "CompiledStateGraph[Any]": # type: ignore[type-arg]
27
  """Build the research state graph.
28
 
29
  Args:
 
1
  """DeepBoner research workflow definition using LangGraph."""
2
 
3
+ from __future__ import annotations
4
+
5
  from functools import partial
6
  from typing import Any
7
 
 
23
 
24
  def create_research_graph(
25
  llm: BaseChatModel | None = None,
26
+ checkpointer: BaseCheckpointSaver[Any] | None = None,
27
  embedding_service: EmbeddingService | None = None,
28
+ ) -> CompiledStateGraph[Any]:
29
  """Build the research state graph.
30
 
31
  Args: