Skip to content

Commit 60828d2

Browse files
xiaojingmingxjm
andauthored
fix: Improve default values for zgsm configuration (#452)
Updates the webview message handler to use default values from the API configuration for `baseUrl` and `apiKey` if they are not provided in the message. This change enhances flexibility and ensures that the application can function correctly even when specific values are not supplied. Co-authored-by: xjm <[email protected]>
1 parent 3d7a2a5 commit 60828d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/webview/webviewMessageHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ export const webviewMessageHandler = async (
844844
key: "zgsm",
845845
options: {
846846
provider: "zgsm",
847-
baseUrl: message?.values?.baseUrl,
848-
apiKey: message?.values?.apiKey,
847+
baseUrl: message?.values?.baseUrl || apiConfiguration.zgsmBaseUrl,
848+
apiKey: message?.values?.apiKey || apiConfiguration.zgsmAccessToken,
849849
openAiHeaders: message?.values?.openAiHeaders || {},
850850
},
851851
},

0 commit comments

Comments
 (0)