Cascade Bot commited on
Commit
3feffc7
·
1 Parent(s): e2e5ce2

fix: add AsyncGenerator and Generator typing imports

Browse files

- Added AsyncGenerator and Generator to typing imports in all strategy files
- Fixed NameError: name 'AsyncGenerator' is not defined
- Updated imports in base.py, neurosymbolic.py, tree_of_thoughts.py, and local_llm.py

reasoning/base.py CHANGED
@@ -1,7 +1,7 @@
1
  """Base classes and types for reasoning strategies."""
2
 
3
  from abc import ABC, abstractmethod
4
- from typing import Dict, Any, List, Optional
5
  from dataclasses import dataclass, field
6
  from datetime import datetime
7
 
 
1
  """Base classes and types for reasoning strategies."""
2
 
3
  from abc import ABC, abstractmethod
4
+ from typing import Dict, Any, List, Optional, AsyncGenerator, Generator
5
  from dataclasses import dataclass, field
6
  from datetime import datetime
7
 
reasoning/local_llm.py CHANGED
@@ -1,7 +1,7 @@
1
  """Local LLM integration for the reasoning system."""
2
 
3
  import os
4
- from typing import Dict, Any, Optional
5
  from datetime import datetime
6
  import logging
7
  from llama_cpp import Llama
 
1
  """Local LLM integration for the reasoning system."""
2
 
3
  import os
4
+ from typing import Dict, Any, Optional, AsyncGenerator, Generator
5
  from datetime import datetime
6
  import logging
7
  from llama_cpp import Llama
reasoning/neurosymbolic.py CHANGED
@@ -1,7 +1,7 @@
1
  """Advanced neurosymbolic reasoning combining neural and symbolic approaches."""
2
 
3
  import logging
4
- from typing import Dict, Any, List, Optional, Set, Union, Type, Tuple
5
  import json
6
  from dataclasses import dataclass, field
7
  from enum import Enum
 
1
  """Advanced neurosymbolic reasoning combining neural and symbolic approaches."""
2
 
3
  import logging
4
+ from typing import Dict, Any, List, Optional, Set, Union, Type, Tuple, AsyncGenerator, Generator
5
  import json
6
  from dataclasses import dataclass, field
7
  from enum import Enum
reasoning/tree_of_thoughts.py CHANGED
@@ -1,7 +1,7 @@
1
  """Tree of Thoughts reasoning implementation with advanced tree exploration."""
2
 
3
  import logging
4
- from typing import Dict, Any, List, Optional, Set, Tuple
5
  import json
6
  from dataclasses import dataclass
7
  from enum import Enum
 
1
  """Tree of Thoughts reasoning implementation with advanced tree exploration."""
2
 
3
  import logging
4
+ from typing import Dict, Any, List, Optional, Set, Tuple, AsyncGenerator, Generator
5
  import json
6
  from dataclasses import dataclass
7
  from enum import Enum
reasoning/unified_engine.py CHANGED
@@ -1,7 +1,10 @@
1
  """Unified reasoning engine that combines multiple reasoning strategies."""
2
 
3
  import logging
4
- from typing import Dict, Any, List, Optional, Set, Union, Type
 
 
 
5
  import json
6
  from dataclasses import dataclass, field
7
  from enum import Enum
 
1
  """Unified reasoning engine that combines multiple reasoning strategies."""
2
 
3
  import logging
4
+ from typing import (
5
+ Dict, Any, List, Optional, Set, Union, Type,
6
+ AsyncGenerator, Callable, Tuple, Generator
7
+ )
8
  import json
9
  from dataclasses import dataclass, field
10
  from enum import Enum