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.
- lionagi/_services/ollama.py +2 -2
- lionagi/core/branch/branch.py +517 -265
- lionagi/core/branch/branch_manager.py +0 -1
- lionagi/core/branch/conversation.py +640 -337
- lionagi/core/core_util.py +0 -59
- lionagi/core/sessions/session.py +137 -64
- lionagi/tools/tool_manager.py +39 -62
- lionagi/utils/__init__.py +3 -2
- lionagi/utils/call_util.py +9 -7
- lionagi/utils/sys_util.py +287 -255
- lionagi/version.py +1 -1
- {lionagi-0.0.206.dist-info → lionagi-0.0.208.dist-info}/METADATA +1 -1
- {lionagi-0.0.206.dist-info → lionagi-0.0.208.dist-info}/RECORD +16 -17
- lionagi/utils/pd_util.py +0 -57
- {lionagi-0.0.206.dist-info → lionagi-0.0.208.dist-info}/LICENSE +0 -0
- {lionagi-0.0.206.dist-info → lionagi-0.0.208.dist-info}/WHEEL +0 -0
- {lionagi-0.0.206.dist-info → lionagi-0.0.208.dist-info}/top_level.txt +0 -0
lionagi/_services/ollama.py
CHANGED
@@ -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.
|
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:
|