mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-07 07:12:40 +08:00
feat(db): 添加 Ollama本地离线模型支持
- 在 builtin_providers.json 中添加 Ollama 提供商配置 - 修改 OpenAI_compatible_provider.py,优化与 Ollama 的兼容性
This commit is contained in:
@@ -46,5 +46,13 @@
|
||||
"logo": "Groq",
|
||||
"api_key": "",
|
||||
"base_url": "https://api.groq.com/openai/v1"
|
||||
},
|
||||
{
|
||||
"id": "ollama",
|
||||
"name": "ollama",
|
||||
"type": "built-in",
|
||||
"logo": "Ollama",
|
||||
"api_key": "",
|
||||
"base_url": "http://127.0.0.1:11434/v1"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -16,7 +16,6 @@ class OpenAICompatibleProvider:
|
||||
print(api_key)
|
||||
try:
|
||||
client = OpenAI(api_key=api_key, base_url=base_url)
|
||||
|
||||
client.models.list()
|
||||
return True
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user