feat: Add OpenAI Provider Selection

Add a provider selection dropdown to the OpenAI settings, enabling users to choose from pre-configured options like "Azure" or "Custom." This streamlines setup and allows for more flexibility in configuring OpenAI API endpoints. The dropdown pre-populates base URLs and names based on the selected provider.

The dropdown also automatically populates base URLs and names based on the selected provider, further simplifying the configuration process.
This commit is contained in:
n4ze3m
2024-10-12 16:53:42 +05:30
parent 3d8c8671e1
commit ff371d6eef
11 changed files with 86 additions and 59 deletions

View File

@@ -532,24 +532,14 @@ export const useMessage = () => {
if (prompt && !selectedPrompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: prompt,
type: "text"
}
]
content: prompt
})
)
}
if (selectedPrompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: selectedPrompt.content,
type: "text"
}
]
content: selectedPrompt.content
})
)
}
@@ -794,12 +784,7 @@ export const useMessage = () => {
if (prompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: prompt,
type: "text"
}
]
content: prompt
})
)
}

View File

@@ -238,12 +238,7 @@ export const useMessageOption = () => {
if (prompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: prompt,
type: "text"
}
]
content: prompt
})
)
}
@@ -445,12 +440,7 @@ export const useMessageOption = () => {
if (prompt && !selectedPrompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: prompt,
type: "text"
}
]
content: prompt
})
)
}
@@ -462,12 +452,7 @@ export const useMessageOption = () => {
if (!isTempSystemprompt && selectedPrompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: selectedPrompt.content,
type: "text"
}
]
content: selectedPrompt.content
})
)
}
@@ -475,12 +460,7 @@ export const useMessageOption = () => {
if (isTempSystemprompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: currentChatModelSettings.systemPrompt,
type: "text"
}
]
content: currentChatModelSettings.systemPrompt
})
)
}