Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit ae555e3

Browse files
committed
fix: ci errors
1 parent 32b971f commit ae555e3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

literalai/api/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ class LiteralAPI(BaseLiteralAPI):
253253
R = TypeVar("R")
254254

255255
def make_gql_call(
256-
self, description: str, query: str, variables: Dict[str, Any], timeout: Optional[int] = 10
257-
) -> Dict:
256+
self, description: str, query: str, variables: dict[str, Any], timeout: Optional[int] = 10
257+
) -> dict:
258258
def raise_error(error):
259259
logger.error(f"Failed to {description}: {error}")
260260
raise Exception(error)
@@ -738,7 +738,7 @@ def upload_file(
738738
# Prepare form data
739739
form_data = (
740740
{}
741-
) # type: Dict[str, Union[Tuple[Union[str, None], Any], Tuple[Union[str, None], Any, Any]]]
741+
) # type: Dict[str, Union[tuple[Union[str, None], Any], tuple[Union[str, None], Any, Any]]]
742742
for field_name, field_value in fields.items():
743743
form_data[field_name] = (None, field_value)
744744

@@ -1527,7 +1527,7 @@ class AsyncLiteralAPI(BaseLiteralAPI):
15271527
R = TypeVar("R")
15281528

15291529
async def make_gql_call(
1530-
self, description: str, query: str, variables: Dict[str, Any]
1530+
self, description: str, query: str, variables: Dict[str, Any], timeout: Optional[int] = 10
15311531
) -> Dict:
15321532
def raise_error(error):
15331533
logger.error(f"Failed to {description}: {error}")
@@ -1540,7 +1540,7 @@ def raise_error(error):
15401540
self.graphql_endpoint,
15411541
json={"query": query, "variables": variables},
15421542
headers=self.headers,
1543-
timeout=10,
1543+
timeout=timeout,
15441544
)
15451545

15461546
try:
@@ -1604,8 +1604,9 @@ async def gql_helper(
16041604
description: str,
16051605
variables: Dict,
16061606
process_response: Callable[..., R],
1607+
timeout: Optional[int] = 10,
16071608
) -> R:
1608-
response = await self.make_gql_call(description, query, variables)
1609+
response = await self.make_gql_call(description, query, variables, timeout)
16091610
return process_response(response)
16101611

16111612
async def get_users(

0 commit comments

Comments
 (0)