Skip to content

Commit

Permalink
Let's go union type, not upgrading to 3.10 yet (gusye1234#60)
Browse files Browse the repository at this point in the history
Co-authored-by: terence-gpt <numberchiffre@users.noreply.github.com>
  • Loading branch information
NumberChiffre and NumberChiffre authored Sep 24, 2024
1 parent 5adf21f commit f7d63d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nano_graphrag/entity_extraction/module.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Union
import dspy
from pydantic import BaseModel, Field
from nano_graphrag._utils import clean_str
Expand Down Expand Up @@ -70,7 +71,7 @@ class CombinedExtraction(dspy.Signature):

input_text: str = dspy.InputField(desc="The text to extract entities and relationships from.")
entity_types: list[str] = dspy.InputField(desc="List of entity types used for extraction.")
entities_relationships: list[Entity | Relationship] = dspy.OutputField(desc="List of entities and relationships extracted from the text.")
entities_relationships: list[Union[Entity, Relationship]] = dspy.OutputField(desc="List of entities and relationships extracted from the text.")


class TypedEntityRelationshipExtractorException(dspy.Module):
Expand Down

0 comments on commit f7d63d3

Please sign in to comment.