修改Ollama接口调用方式

在调用本地Ollama接口时,将api_key默认值设置为“ollama”。
This commit is contained in:
Karasukaigan
2025-02-19 14:42:37 +08:00
parent 0a24217eb5
commit fd7f97b0e8
3 changed files with 3 additions and 18 deletions
+3
View File
@@ -172,6 +172,9 @@ class OllamaAdapter(BaseLLMAdapter):
self.temperature = temperature
self.timeout = timeout
if self.api_key == '':
self.api_key= 'ollama'
self._client = ChatOpenAI(
model=self.model_name,
api_key=self.api_key,