Skip to content

Commit

Permalink
solve some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SonglinLyu committed Jan 20, 2025
1 parent 0e83a53 commit 28f8605
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Dcoument Based Graph Retriever."""

import logging
from typing import List, Union, Optional
from typing import List, Union, Optional, Tuple

from pydantic import Field

Expand All @@ -28,7 +28,7 @@ def __init__(

async def retrieve(
self, subs: Optional[Union[List[str], List[List[float]]]], triplet_graph: Optional[Graph]
) -> tuple[Graph, None]:
) -> Tuple[Graph, None]:
"""Retrieve from document graph."""

if triplet_graph:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import os
from abc import ABC, abstractmethod
from typing import List, Optional, Union
from typing import List, Optional, Union, Tuple

from pydantic import Field

Expand Down Expand Up @@ -113,7 +113,7 @@ def __init__(
similarity_search_score_threshold,
)

async def retrieve(self, text: str) -> tuple[Graph, Graph, str]:
async def retrieve(self, text: str) -> Tuple[Graph, Graph, str]:
"""Retrieve subgraph from triplet graph and document graph."""

subgraph = MemoryGraph()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
from abc import ABC, abstractmethod
from typing import List, Optional
from typing import List, Optional, Tuple

from pydantic import Field

Expand All @@ -29,7 +29,7 @@ def __init__(self, graph_store_apdater, triplet_topk):
self._graph_store_apdater = graph_store_apdater
self._triplet_topk = triplet_topk

async def retrieve(self, keywords: List[str]) -> tuple[Graph, str]:
async def retrieve(self, keywords: List[str]) -> Tuple[Graph, str]:
"""Retrieve from triplets graph with keywords."""

subgraph = self._graph_store_apdater.explore_trigraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import json
import logging
from typing import Dict, List, Union
from typing import Dict, List, Union, Tuple

from dbgpt.rag.transformer.intent_interpreter import IntentInterpreter
from dbgpt.rag.transformer.text2gql import Text2GQL
Expand All @@ -23,7 +23,7 @@ def __init__(self, graph_store_apdater, triplet_topk, llm_client, model_name):
self._intent_interpreter = IntentInterpreter(llm_client, model_name)
self._text2gql = Text2GQL(llm_client, model_name)

async def retrieve(self, text: str) -> tuple[Graph, str]:
async def retrieve(self, text: str) -> Tuple[Graph, str]:
"""Retrieve from triplets graph with text2gql."""

intention: Dict[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
from abc import ABC, abstractmethod
from typing import List, Optional
from typing import List, Optional, Tuple

from pydantic import Field

Expand Down Expand Up @@ -40,7 +40,7 @@ def __init__(

async def retrieve(
self, vectors: List[List[float]]
) -> tuple[Graph, None]:
) -> Tuple[Graph, None]:
"""Retrieve from triplet graph with vectors."""

subgraph = self._graph_store_apdater.explore_trigraph(
Expand Down

0 comments on commit 28f8605

Please sign in to comment.