feat: mypy for all type check (#10921)
This commit is contained in:
parent
c91e8b1737
commit
56e15d09a9
584 changed files with 3975 additions and 2826 deletions
|
|
@ -2,8 +2,8 @@ import json
|
|||
import logging
|
||||
from typing import Any, Union
|
||||
|
||||
import boto3
|
||||
from botocore.exceptions import BotoCoreError
|
||||
import boto3 # type: ignore
|
||||
from botocore.exceptions import BotoCoreError # type: ignore
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from core.tools.entities.tool_entities import ToolInvokeMessage
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import json
|
||||
from typing import Any, Union
|
||||
|
||||
import boto3
|
||||
import boto3 # type: ignore
|
||||
|
||||
from core.tools.entities.tool_entities import ToolInvokeMessage
|
||||
from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import json
|
|||
import logging
|
||||
from typing import Any, Union
|
||||
|
||||
import boto3
|
||||
import boto3 # type: ignore
|
||||
|
||||
from core.tools.entities.tool_entities import ToolInvokeMessage
|
||||
from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import json
|
|||
import operator
|
||||
from typing import Any, Union
|
||||
|
||||
import boto3
|
||||
import boto3 # type: ignore
|
||||
|
||||
from core.tools.entities.tool_entities import ToolInvokeMessage
|
||||
from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
|
@ -10,8 +10,8 @@ from core.tools.tool.builtin_tool import BuiltinTool
|
|||
|
||||
class SageMakerReRankTool(BuiltinTool):
|
||||
sagemaker_client: Any = None
|
||||
sagemaker_endpoint: str = None
|
||||
topk: int = None
|
||||
sagemaker_endpoint: str | None = None
|
||||
topk: int | None = None
|
||||
|
||||
def _sagemaker_rerank(self, query_input: str, docs: list[str], rerank_endpoint: str):
|
||||
inputs = [query_input] * len(docs)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import json
|
|||
from enum import Enum
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import boto3
|
||||
import boto3 # type: ignore
|
||||
|
||||
from core.tools.entities.tool_entities import ToolInvokeMessage
|
||||
from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
|
@ -17,7 +17,7 @@ class TTSModelType(Enum):
|
|||
|
||||
class SageMakerTTSTool(BuiltinTool):
|
||||
sagemaker_client: Any = None
|
||||
sagemaker_endpoint: str = None
|
||||
sagemaker_endpoint: str | None = None
|
||||
s3_client: Any = None
|
||||
comprehend_client: Any = None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue