add: 添加ollama调用AI chat逻辑

This commit is contained in:
taylor
2024-10-13 17:47:49 +08:00
parent 82a47c881f
commit fa826eadbe
3 changed files with 5 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ class Ollama(Platform):
full_context.extend(list(context))
endpoint = f"{self.url}/api/chat"
req_body = {'model': self.model, 'message': full_context, 'steam': False}
req_body = {'model': self.model, 'messages': full_context, 'steam': False}
headers = {}
if self.api_key is not None:
headers['Authorization'] = self.api_key