add: 添加ollama调用AI chat逻辑
This commit is contained in:
@@ -23,7 +23,7 @@ class Ollama(Platform):
|
|||||||
full_context.extend(list(context))
|
full_context.extend(list(context))
|
||||||
|
|
||||||
endpoint = f"{self.url}/api/chat"
|
endpoint = f"{self.url}/api/chat"
|
||||||
req_body = {'model': self.model, 'messages': full_context, 'steam': False}
|
req_body = {'model': self.model, 'messages': full_context, 'stream': False}
|
||||||
headers = {'Content-Type': 'application/json'}
|
headers = {'Content-Type': 'application/json'}
|
||||||
if self.api_key is not None:
|
if self.api_key is not None:
|
||||||
headers['Authorization'] = self.api_key
|
headers['Authorization'] = self.api_key
|
||||||
|
|||||||
Reference in New Issue
Block a user