isProperlyConfigured false if continue-proxy apiKeyLocation is NotFound
This commit is contained in:
parent
cfcbee33a4
commit
dfe852f274
1 changed files with 17 additions and 1 deletions
|
|
@ -1,4 +1,8 @@
|
|||
import { ContinueProperties } from "@continuedev/config-yaml";
|
||||
import {
|
||||
ContinueProperties,
|
||||
decodeSecretLocation,
|
||||
SecretType,
|
||||
} from "@continuedev/config-yaml";
|
||||
|
||||
import { ControlPlaneProxyInfo } from "../../../control-plane/analytics/IAnalyticsProvider.js";
|
||||
import { Telemetry } from "../../../util/posthog.js";
|
||||
|
|
@ -49,6 +53,18 @@ class ContinueProxy extends OpenAI {
|
|||
};
|
||||
}
|
||||
|
||||
isProperlyConfigured(): boolean {
|
||||
if (!this.apiKeyLocation) {
|
||||
return true;
|
||||
}
|
||||
const secretLocation = decodeSecretLocation(this.apiKeyLocation);
|
||||
if (secretLocation.secretType === SecretType.NotFound) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected _getHeaders() {
|
||||
const headers: any = super._getHeaders();
|
||||
headers["x-continue-unique-id"] = Telemetry.uniqueId;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue