Stub out support for Azure OpenAI (#8624)
This PR stubs out support for [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview) within the `OpenAiCompletionProvider`. It still requires some additional wiring so that it is accessible, but the necessary hooks should be in place now. Release Notes: - N/A
This commit is contained in:
parent
cbcd011a36
commit
dab886f479
3 changed files with 59 additions and 7 deletions
|
@ -7,11 +7,13 @@ use crate::{
|
|||
SavedMessage, Split, ToggleFocus, ToggleIncludeConversation, ToggleRetrieveContext,
|
||||
};
|
||||
use ai::prompts::repository_context::PromptCodeSnippet;
|
||||
use ai::providers::open_ai::OPEN_AI_API_URL;
|
||||
use ai::{
|
||||
auth::ProviderCredential,
|
||||
completion::{CompletionProvider, CompletionRequest},
|
||||
providers::open_ai::{OpenAiCompletionProvider, OpenAiRequest, RequestMessage},
|
||||
providers::open_ai::{
|
||||
OpenAiCompletionProvider, OpenAiCompletionProviderKind, OpenAiRequest, RequestMessage,
|
||||
OPEN_AI_API_URL,
|
||||
},
|
||||
};
|
||||
use anyhow::{anyhow, Result};
|
||||
use chrono::{DateTime, Local};
|
||||
|
@ -131,6 +133,7 @@ impl AssistantPanel {
|
|||
})?;
|
||||
let completion_provider = OpenAiCompletionProvider::new(
|
||||
api_url,
|
||||
OpenAiCompletionProviderKind::OpenAi,
|
||||
model_name,
|
||||
cx.background_executor().clone(),
|
||||
)
|
||||
|
@ -1533,6 +1536,7 @@ impl Conversation {
|
|||
api_url
|
||||
.clone()
|
||||
.unwrap_or_else(|| OPEN_AI_API_URL.to_string()),
|
||||
OpenAiCompletionProviderKind::OpenAi,
|
||||
model.full_name().into(),
|
||||
cx.background_executor().clone(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue