From efabcf5f677032e6529b9cafdc185bd25ad0b371 Mon Sep 17 00:00:00 2001 From: Ivan Leo Date: Thu, 14 Nov 2024 14:06:21 +0800 Subject: [PATCH] fix: removed use_async flag in cerebras client (#1179) --- instructor/client_cerebras.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/instructor/client_cerebras.py b/instructor/client_cerebras.py index 802a3f75b..0c5154a5f 100644 --- a/instructor/client_cerebras.py +++ b/instructor/client_cerebras.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Literal, overload +from typing import Any, overload import instructor from instructor.client import AsyncInstructor, Instructor @@ -13,7 +13,6 @@ def from_cerebras( client: Cerebras, mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS, - use_async: Literal[False] = False, **kwargs: Any, ) -> Instructor: ... @@ -22,7 +21,6 @@ def from_cerebras( def from_cerebras( client: AsyncCerebras, mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS, - use_async: Literal[True] = True, **kwargs: Any, ) -> AsyncInstructor: ... @@ -30,7 +28,6 @@ def from_cerebras( def from_cerebras( client: Cerebras | AsyncCerebras, mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS, - use_async: bool = False, **kwargs: Any, ) -> Instructor | AsyncInstructor: assert ( @@ -45,7 +42,7 @@ def from_cerebras( client, (Cerebras, AsyncCerebras) ), "Client must be an instance of Cerebras or AsyncCerebras" - if use_async: + if isinstance(client, AsyncCerebras): create = client.chat.completions.create return AsyncInstructor( client=client,