lionagi 0.0.206__py3-none-any.whl → 0.0.208__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,14 +17,14 @@ class OllamaService(BaseService):
17
17
  raise ImportError(f'Unable to import required module from ollama. Please make sure that ollama is installed.')
18
18
 
19
19
  self.model = model
20
- self.client = self.ollama.Client(**kwargs)
20
+ self.client = self.ollama.AsyncClient(**kwargs)
21
21
 
22
22
  async def serve_chat(self, messages, **kwargs):
23
23
  self.ollama.pull(self.model)
24
24
  payload = {'messages': messages}
25
25
 
26
26
  try:
27
- completion = self.client.chat(model=self.model, messages=messages, **kwargs)
27
+ completion = await self.client.chat(model=self.model, messages=messages, **kwargs)
28
28
  completion['choices'] = [{'message': completion.pop('message')}]
29
29
  return payload, completion
30
30
  except Exception as e: