mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
feat: add Azure AI model configuration options to API and UI components
This commit is contained in:
@@ -63,6 +63,7 @@ export interface ApiHandlerOptions {
|
|||||||
unboundModelId?: string
|
unboundModelId?: string
|
||||||
azureAiEndpoint?: string
|
azureAiEndpoint?: string
|
||||||
azureAiKey?: string
|
azureAiKey?: string
|
||||||
|
azureAiModelConfig?: ModelInfo
|
||||||
azureAiDeployments?:
|
azureAiDeployments?:
|
||||||
| {
|
| {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
glamaDefaultModelInfo,
|
glamaDefaultModelInfo,
|
||||||
mistralDefaultModelId,
|
mistralDefaultModelId,
|
||||||
mistralModels,
|
mistralModels,
|
||||||
|
azureAiModelInfoSaneDefaults,
|
||||||
openAiModelInfoSaneDefaults,
|
openAiModelInfoSaneDefaults,
|
||||||
openAiNativeDefaultModelId,
|
openAiNativeDefaultModelId,
|
||||||
openAiNativeModels,
|
openAiNativeModels,
|
||||||
@@ -1564,7 +1565,7 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration) {
|
|||||||
return {
|
return {
|
||||||
selectedProvider: provider,
|
selectedProvider: provider,
|
||||||
selectedModelId: apiConfiguration?.apiModelId || "",
|
selectedModelId: apiConfiguration?.apiModelId || "",
|
||||||
selectedModelInfo: openAiModelInfoSaneDefaults,
|
selectedModelInfo: azureAiModelInfoSaneDefaults,
|
||||||
}
|
}
|
||||||
case "openai":
|
case "openai":
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const AzureAiModelPicker: React.FC = () => {
|
|||||||
{
|
{
|
||||||
iconName: "refresh",
|
iconName: "refresh",
|
||||||
onClick: () =>
|
onClick: () =>
|
||||||
handleInputChange("openAiCustomModelInfo")({
|
handleInputChange("azureAiModelConfig")({
|
||||||
target: { value: azureAiModelInfoSaneDefaults },
|
target: { value: azureAiModelInfoSaneDefaults },
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@@ -84,7 +84,7 @@ const AzureAiModelPicker: React.FC = () => {
|
|||||||
<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
|
<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
|
||||||
<VSCodeTextField
|
<VSCodeTextField
|
||||||
value={
|
value={
|
||||||
apiConfiguration?.openAiCustomModelInfo?.contextWindow?.toString() ||
|
apiConfiguration?.azureAiModelConfig?.contextWindow?.toString() ||
|
||||||
azureAiModelInfoSaneDefaults.contextWindow?.toString() ||
|
azureAiModelInfoSaneDefaults.contextWindow?.toString() ||
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
@@ -92,10 +92,10 @@ const AzureAiModelPicker: React.FC = () => {
|
|||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
onChange={(e: any) => {
|
onChange={(e: any) => {
|
||||||
const parsed = parseInt(e.target.value)
|
const parsed = parseInt(e.target.value)
|
||||||
handleInputChange("openAiCustomModelInfo")({
|
handleInputChange("azureAiModelConfig")({
|
||||||
target: {
|
target: {
|
||||||
value: {
|
value: {
|
||||||
...(apiConfiguration?.openAiCustomModelInfo ||
|
...(apiConfiguration?.azureAiModelConfig ||
|
||||||
azureAiModelInfoSaneDefaults),
|
azureAiModelInfoSaneDefaults),
|
||||||
contextWindow:
|
contextWindow:
|
||||||
e.target.value === ""
|
e.target.value === ""
|
||||||
|
|||||||
Reference in New Issue
Block a user