mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-09-05 23:56:59 +08:00
Merge pull request #106 from JefferyHcool/feature/kuaishou
feat(db): 添加 Ollama本地离线模型支持
This commit is contained in:
@@ -46,5 +46,13 @@
|
|||||||
"logo": "Groq",
|
"logo": "Groq",
|
||||||
"api_key": "",
|
"api_key": "",
|
||||||
"base_url": "https://api.groq.com/openai/v1"
|
"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)
|
print(api_key)
|
||||||
try:
|
try:
|
||||||
client = OpenAI(api_key=api_key, base_url=base_url)
|
client = OpenAI(api_key=api_key, base_url=base_url)
|
||||||
|
|
||||||
client.models.list()
|
client.models.list()
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user