Răsfoiți Sursa

Merge pull request #2215 from Kilo-Org/christiaan/data-collection

Always allow setting Data Provider Collection setting
Christiaan Arnoldus 5 luni în urmă
părinte
comite
d3db6a17d9

+ 5 - 0
.changeset/dirty-aliens-slide.md

@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+The Data Provider Collection setting in the Kilo Code and OpenRouter provider settings is now enabled even when a specific inference provider is selected.

+ 1 - 0
src/api/providers/openrouter.ts

@@ -114,6 +114,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
 					order: [this.options.openRouterSpecificProvider],
 					only: [this.options.openRouterSpecificProvider],
 					allow_fallbacks: false,
+					data_collection: this.options.openRouterProviderDataCollection,
 				},
 			}
 		}

+ 6 - 9
webview-ui/src/components/settings/providers/KiloProviderRouting.tsx

@@ -54,8 +54,10 @@ export const KiloProviderRouting = ({ apiConfiguration, setApiConfigurationField
 	}
 
 	const specficProvider = apiConfiguration.openRouterSpecificProvider
-	const specificProviderIsSet = !!specficProvider && specficProvider !== OPENROUTER_DEFAULT_PROVIDER_NAME
-	const specificProviderIsInvalid = specificProviderIsSet && !providers.find((p) => p.label === specficProvider)
+	const specificProviderIsInvalid =
+		!!specficProvider &&
+		specficProvider !== OPENROUTER_DEFAULT_PROVIDER_NAME &&
+		!providers.find((p) => p.label === specficProvider)
 
 	return (
 		<div className="flex flex-col gap-1">
@@ -95,19 +97,14 @@ export const KiloProviderRouting = ({ apiConfiguration, setApiConfigurationField
 				</SelectContent>
 			</Select>
 			<Select
-				value={
-					specificProviderIsSet ? "default" : (apiConfiguration.openRouterProviderDataCollection ?? "default")
-				}
+				value={apiConfiguration.openRouterProviderDataCollection ?? "default"}
 				onValueChange={(value) => {
-					if (specificProviderIsSet) {
-						return
-					}
 					setApiConfigurationField(
 						"openRouterProviderDataCollection",
 						openRouterProviderDataCollectionSchema.safeParse(value).data,
 					)
 				}}>
-				<SelectTrigger disabled={specificProviderIsSet} className="w-full">
+				<SelectTrigger className="w-full">
 					<SelectValue />
 				</SelectTrigger>
 				<SelectContent>