Skip to content

Commit

Permalink
fix: Added static type checker
Browse files Browse the repository at this point in the history
  • Loading branch information
asafgardin committed Dec 14, 2023
1 parent f00fd8c commit 3a48e8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ai21/clients/bedrock/ai21_bedrock_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
import re
from typing import Optional, Any, Dict

from typing import Optional, Any, Dict, TYPE_CHECKING

from ai21.ai21_env_config import AI21EnvConfig, _AI21EnvConfig
from ai21.clients.bedrock.resources.bedrock_completion import BedrockCompletion
Expand All @@ -14,6 +13,9 @@
r"Received client error \((.*?)\) from primary with message \"(.*?)\". "
r"See .* in account .* for more information."
)
if TYPE_CHECKING:
import boto3
from botocore.exceptions import ClientError


class AI21BedrockClient:
Expand Down
6 changes: 5 additions & 1 deletion ai21/clients/sagemaker/ai21_sagemaker_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import re
from typing import Optional
from typing import Optional, TYPE_CHECKING

from ai21.ai21_env_config import _AI21EnvConfig, AI21EnvConfig
from ai21.clients.sagemaker.resources.sagemaker_answer import SageMakerAnswer
Expand All @@ -19,6 +19,10 @@
)
_SAGEMAKER_RUNTIME_NAME = "sagemaker-runtime"

if TYPE_CHECKING:
import boto3
from botocore.exceptions import ClientError


class AI21SageMakerClient:
"""
Expand Down

0 comments on commit 3a48e8c

Please sign in to comment.