-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removing vscode -based auth for azure #693
Conversation
…arious Vue dependencies to 3.5.2
…s across packages
const { DefaultAzureCredential } = await import("@azure/identity") | ||
const azureToken = await new DefaultAzureCredential().getToken( | ||
AZURE_OPENAI_TOKEN_SCOPES.slice(), | ||
{ abortSignal: signal } | ||
) | ||
const res = { | ||
token: azureToken.token, | ||
provider: MODEL_PROVIDER_AZURE, | ||
token: "Bearer " + azureToken.token, | ||
expiresOnTimestamp: azureToken.expiresOnTimestamp | ||
? azureToken.expiresOnTimestamp | ||
: Date.now() + AZURE_OPENAI_TOKEN_EXPIRATION, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MODEL_PROVIDER_AZURE
constant is used but not imported in this file.
generated by pr-review-commit
missing_import
private readonly _languageModelAuthenticationTokens: Record< | ||
string, | ||
LanguageModelAuthenticationToken | ||
> = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of _languageModelAuthenticationTokens
is not defined. It should be Record<string, LanguageModelAuthenticationToken>
.
generated by pr-review-commit
missing_type
token?.expiresOnTimestamp < | ||
Date.now() - LANGUAGE_MODEL_TOKEN_EXPIRATION_OFFSET | ||
) // avoid data races | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LANGUAGE_MODEL_TOKEN_EXPIRATION_OFFSET
constant is used but not imported in this file.
generated by pr-review-commit
missing_import
The changes in the GIT_DIFF:
Concerns:
LGTM overall 🚀, but the concern above should be addressed to prevent potential issues.
|
Refactored the Azure token handling, including:
LanguageModelAuthenticationToken
interface for language model authentications.Bearer
.setLanguageModelConnectionToken
is added to RuntimeHost, and is implemented inNodeHost
to store the token based on the provider.isLanguageModelAuthenticationTokenExpired
is introduced to check token expiration.NodeHost
, the previously usedAuthenticationToken
is replaced withLanguageModelAuthenticationToken
, and storage of the token is changed to a Record based on provider.getLanguageModelConfiguration
based on the new changes.Updated the code to set the language model connection token in
runScript
if provided.The server now receives an additional
modelToken
with script start request and passes it to the client script run.The client now sends an additional
modelToken
with the script start request.Updated the VSCode extension to fetch Azure token on-demand and prefix it with
Bearer
.The Language Model Configuration now extends
LanguageModelAuthenticationToken
.The vscode engine is updated from "1.92.0" to "1.93.0".
Fixed a typo error in throwing an error message in
lmaccess.ts
andstate.ts
.💡 Major updates revolve around handling azure tokens used in Language Model authentications, providing a more structured approach to manage different providers and their tokens. User-facing APIs are unaffected by these changes.