Add the ability to customize available models for OpenAI-compatible services (#13276)

Closes #11984, closes #11075.

Release Notes:

- Added the ability to customize available models for OpenAI-compatible
services ([#11984](https://github.com/zed-industries/zed/issues/11984))
([#11075](https://github.com/zed-industries/zed/issues/11075)).


![image](https://github.com/zed-industries/zed/assets/32017007/01057e7b-1f21-49ad-a3ad-abc5282ffaf0)
This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ 2024-06-26 04:37:02 +08:00 committed by GitHub
parent 9f88460870
commit 922fcaf5a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 79 additions and 11 deletions

View file

@ -1298,7 +1298,8 @@ impl Render for PromptEditor {
PopoverMenu::new("model-switcher")
.menu(move |cx| {
ContextMenu::build(cx, |mut menu, cx| {
for model in CompletionProvider::global(cx).available_models() {
for model in CompletionProvider::global(cx).available_models(cx)
{
menu = menu.custom_entry(
{
let model = model.clone();