使用旧式联合体写法以兼容python3.9
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import time
|
||||
from typing import List
|
||||
from typing import List, Union
|
||||
|
||||
from .global_logger import logger
|
||||
from . import prompt_template
|
||||
@@ -64,7 +64,7 @@ def _rdf_triple_extract(llm_client: LLMClient, paragraph: str, entities: list) -
|
||||
|
||||
def info_extract_from_str(
|
||||
llm_client_for_ner: LLMClient, llm_client_for_rdf: LLMClient, paragraph: str
|
||||
) -> tuple[None, None] | tuple[list[str], list[list[str]]]:
|
||||
) -> Union[tuple[None, None], tuple[list[str], list[list[str]]]]:
|
||||
try_count = 0
|
||||
while True:
|
||||
try:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import time
|
||||
from typing import Tuple, List, Dict
|
||||
from typing import Tuple, List, Dict, Optional
|
||||
|
||||
from .global_logger import logger
|
||||
|
||||
@@ -28,7 +28,7 @@ class QAManager:
|
||||
"qa": llm_client_qa,
|
||||
}
|
||||
|
||||
def process_query(self, question: str) -> Tuple[List[Tuple[str, float, float]], Dict[str, float] | None]:
|
||||
def process_query(self, question: str) -> Tuple[List[Tuple[str, float, float]], Optional[Dict[str, float]]]:
|
||||
"""处理查询"""
|
||||
|
||||
# 生成问题的Embedding
|
||||
|
||||
Reference in New Issue
Block a user