Format
This commit is contained in:
parent
6a50f87abe
commit
076f676f4f
1 changed files with 20 additions and 9 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import asyncio
|
||||
from typing import Any, Mapping, Optional, TypeVar
|
||||
from typing import Any, Mapping, Optional, Type, TypeVar
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
|
@ -9,9 +9,14 @@ from .call_remote_great_ai_async import call_remote_great_ai_async
|
|||
|
||||
logger = get_logger("call_remote_great_ai")
|
||||
|
||||
T = TypeVar("T", BaseModel)
|
||||
T = TypeVar("T", bound=BaseModel)
|
||||
|
||||
|
||||
def call_remote_great_ai(
|
||||
base_uri: str, data: Mapping[str, Any], retry_count: int = 4, model_class:Optional[Type[T]]=None
|
||||
base_uri: str,
|
||||
data: Mapping[str, Any],
|
||||
retry_count: int = 4,
|
||||
model_class: Optional[Type[T]] = None,
|
||||
) -> Trace[T]:
|
||||
try:
|
||||
asyncio.get_running_loop()
|
||||
|
|
@ -22,7 +27,7 @@ def call_remote_great_ai(
|
|||
pass
|
||||
|
||||
future = call_remote_great_ai_async(
|
||||
base_uri=base_uri, data=data, retry_count=retry_count,model_class=model_class
|
||||
base_uri=base_uri, data=data, retry_count=retry_count, model_class=model_class
|
||||
)
|
||||
|
||||
return asyncio.run(future)
|
||||
|
|
|
|||
Loading…
Reference in a new issue