diff --git a/demo/genaisrc/az-explain.genai.js b/demo/genaisrc/az-explain.genai.js index 368d22de59..40fc79799e 100644 --- a/demo/genaisrc/az-explain.genai.js +++ b/demo/genaisrc/az-explain.genai.js @@ -1,5 +1,5 @@ script({ - model: "gpt-3.5-turbo", + model: "azure:gpt2networkverification", temperature: 0, files: "web-app-basic-linux/main.bicep", system: [ diff --git a/demo/genaisrc/poem.genai.js b/demo/genaisrc/poem.genai.js new file mode 100644 index 0000000000..f31b1e53b5 --- /dev/null +++ b/demo/genaisrc/poem.genai.js @@ -0,0 +1,5 @@ +script({ + model: "azure:gpt2networkverification", +}) + +$`Write a short poem.` \ No newline at end of file diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index f5d7dfd4bb..295392ea0f 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -2,7 +2,8 @@ export const CHANGE = "change" export const MAX_CACHED_TEMPERATURE = 0.5 export const MAX_CACHED_TOP_P = 0.5 export const MAX_TOOL_CALLS = 100 -//https://learn.microsoft.com/en-us/azure/ai-services/openai/reference +// https://learn.microsoft.com/en-us/azure/ai-services/openai/reference +// https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01/inference.yaml export const AZURE_OPENAI_API_VERSION = "2024-02-01" export const AZURE_OPENAI_TOKEN_SCOPES = Object.freeze([ "https://cognitiveservices.azure.com/.default", diff --git a/packages/vscode/src/azuremanager.ts b/packages/vscode/src/azuremanager.ts index f5cd05f5ef..cf407f1d0a 100644 --- a/packages/vscode/src/azuremanager.ts +++ b/packages/vscode/src/azuremanager.ts @@ -26,6 +26,10 @@ export class AzureManager { return this._subscription } + get hasToken() { + return this._token?.token !== undefined + } + async signIn(): Promise { if (this._subscription) return this._subscription.credential diff --git a/packages/vscode/src/statusbar.ts b/packages/vscode/src/statusbar.ts index 7e9500033f..b75f22dbf3 100644 --- a/packages/vscode/src/statusbar.ts +++ b/packages/vscode/src/statusbar.ts @@ -13,9 +13,10 @@ export function activateStatusBar(state: ExtensionState) { ) statusBarItem.command = "genaiscript.request.status" const updateStatusBar = async () => { - const { parsing } = state - const { computing, progress, options, editsApplied } = - state.aiRequest || {} + const { parsing, host } = state + const { azure } = host + const { subscription } = azure + const { computing, progress, options } = state.aiRequest || {} const { template, fragment } = options || {} const { tokensSoFar } = progress || {} statusBarItem.text = toStringList( @@ -33,6 +34,9 @@ export function activateStatusBar(state: ExtensionState) { : undefined, template ? `- tool: ${template.title} (${template.id})` + : undefined, + subscription + ? `- Azure subscription: ${subscription.name} (${subscription.subscriptionId})` : undefined ), true