Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Sep 20, 2024
1 parent 0df1d6f commit 6ff1468
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lumen/ai/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from functools import partial

import instructor
import panel as pn
import param

from instructor import from_anthropic, from_openai
from instructor.dsl.partial import Partial
from instructor.patch import Mode, patch
from pydantic import BaseModel
Expand Down Expand Up @@ -220,7 +220,7 @@ def get_client(self, model_key: str, response_model: BaseModel | None = None, **
model_kwargs["organization"] = self.organization
llm = openai.AsyncOpenAI(**model_kwargs)
if response_model:
client = from_openai(llm)
client = instructor.from_openai(llm)
client_callable = partial(client.chat.completions.create, model=model)
else:
client_callable = partial(llm.chat.completions.create, model=model)
Expand Down Expand Up @@ -260,7 +260,7 @@ def get_client(self, model_key: str, response_model: BaseModel | None = None, **
model_kwargs["azure_endpoint"] = self.azure_endpoint
llm = openai.AsyncAzureOpenAI(**model_kwargs)
if response_model:
client = from_openai(llm)
client = instructor.from_openai(llm)
client_callable = partial(client.chat.completions.create, model=model)
else:
client_callable = partial(llm.chat.completions.create, model=model)
Expand Down Expand Up @@ -418,7 +418,7 @@ def get_client(self, model_key: str, response_model: BaseModel | None = None, **
llm = AsyncAnthropic(api_key=self.api_key)

if response_model:
client = from_anthropic(llm)
client = instructor.from_anthropic(llm)
return partial(client.messages.create, model=model)
else:
return partial(llm.messages.create, model=model)
Expand Down

0 comments on commit 6ff1468

Please sign in to comment.