Skip to content
Snippets Groups Projects
Commit b0b58894 authored by tolgadevAI's avatar tolgadevAI
Browse files

async_client calls

parent 1901b1d1
No related branches found
No related tags found
No related merge requests found
...@@ -303,6 +303,7 @@ class RouteLayer: ...@@ -303,6 +303,7 @@ class RouteLayer:
) )
self.llm = OpenAILLM() self.llm = OpenAILLM()
route.llm = self.llm route.llm = self.llm
return await route.llm.acall(text) # type: ignore
else: else:
route.llm = self.llm route.llm = self.llm
return route(text) return route(text)
......
...@@ -32,7 +32,6 @@ class OpenAILLM(BaseLLM): ...@@ -32,7 +32,6 @@ class OpenAILLM(BaseLLM):
openai_api_key: Optional[str] = None, openai_api_key: Optional[str] = None,
temperature: float = 0.01, temperature: float = 0.01,
max_tokens: int = 200, max_tokens: int = 200,
use_async=False,
): ):
if name is None: if name is None:
name = EncoderDefault.OPENAI.value["language_model"] name = EncoderDefault.OPENAI.value["language_model"]
...@@ -123,7 +122,7 @@ class OpenAILLM(BaseLLM): ...@@ -123,7 +122,7 @@ class OpenAILLM(BaseLLM):
function_schemas if function_schemas is not None else NOT_GIVEN function_schemas if function_schemas is not None else NOT_GIVEN
) )
completion = await self.async_client.chat.completions.create( # type: ignore completion = await self.async_client.chat.completions.create(
model=self.name, model=self.name,
messages=[m.to_openai() for m in messages], messages=[m.to_openai() for m in messages],
temperature=self.temperature, temperature=self.temperature,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment