Skip to content

Commit

Permalink
fix: removed use_async flag in cerebras client
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanleomk committed Nov 14, 2024
1 parent 78a1926 commit 1b747af
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions instructor/client_cerebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
def from_cerebras(
client: Cerebras,
mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS,
use_async: Literal[False] = False,
**kwargs: Any,
) -> Instructor: ...

Expand All @@ -22,15 +21,13 @@ def from_cerebras(
def from_cerebras(
client: AsyncCerebras,
mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS,
use_async: Literal[True] = True,
**kwargs: Any,
) -> AsyncInstructor: ...


def from_cerebras(
client: Cerebras | AsyncCerebras,
mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS,
use_async: bool = False,
**kwargs: Any,
) -> Instructor | AsyncInstructor:
assert (
Expand All @@ -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,
Expand Down

0 comments on commit 1b747af

Please sign in to comment.