-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Post release automated changes for ai releases #36784
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,13 +13,16 @@ const { DefaultAzureCredential } = require("@azure/identity"); | |
| const { AIProjectClient } = require("@azure/ai-projects"); | ||
| const fs = require("fs"); | ||
| const path = require("path"); | ||
| const { fileURLToPath } = require("url"); | ||
| require("dotenv/config"); | ||
|
|
||
| const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint>"; | ||
| const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "<model deployment name>"; | ||
|
|
||
| async function main() { | ||
| // Load the file to be indexed for search | ||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = path.dirname(__filename); | ||
|
Comment on lines
+16
to
+25
|
||
| const assetFilePath = path.join(__dirname, "../assets/product_info.md"); | ||
|
|
||
| // Create AI Project client | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); | |
| const { AIProjectClient } = require("@azure/ai-projects"); | ||
| const fs = require("fs"); | ||
| const path = require("path"); | ||
| const { fileURLToPath } = require("url"); | ||
| require("dotenv/config"); | ||
|
|
||
| const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint>"; | ||
|
|
@@ -62,6 +63,8 @@ async function main() { | |
| if (imageData && imageData.length > 0 && imageData[0].result) { | ||
| console.log("Downloading generated image..."); | ||
|
|
||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = path.dirname(__filename); | ||
|
Comment on lines
+66
to
+67
|
||
| const filename = "microsoft.png"; | ||
| const filePath = path.join(__dirname, filename); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,10 @@ | |||||||||
|
|
||||||||||
| const fs = require("fs"); | ||||||||||
| const path = require("path"); | ||||||||||
| const { fileURLToPath } = require("url"); | ||||||||||
|
|
||||||||||
| const __filename = fileURLToPath(import.meta.url); | ||||||||||
| const __dirname = path.dirname(__filename); | ||||||||||
|
Comment on lines
+11
to
+14
|
||||||||||
| const { fileURLToPath } = require("url"); | |
| const __filename = fileURLToPath(import.meta.url); | |
| const __dirname = path.dirname(__filename); |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,8 +11,12 @@ | |||||||||||||
| const { AIProjectClient } = require("@azure/ai-projects"); | ||||||||||||||
| const { DefaultAzureCredential } = require("@azure/identity"); | ||||||||||||||
| const path = require("path"); | ||||||||||||||
| const { fileURLToPath } = require("url"); | ||||||||||||||
| require("dotenv/config"); | ||||||||||||||
|
|
||||||||||||||
| const __filename = fileURLToPath(import.meta.url); | ||||||||||||||
| const __dirname = path.dirname(__filename); | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+14
to
+19
|
||||||||||||||
| const { fileURLToPath } = require("url"); | |
| require("dotenv/config"); | |
| const __filename = fileURLToPath(import.meta.url); | |
| const __dirname = path.dirname(__filename); | |
| require("dotenv/config"); |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,11 +10,13 @@ | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const { DefaultAzureCredential } = require("@azure/identity"); | ||||||||||||||||||||||||||
| const { AIProjectClient } = require("@azure/ai-projects"); | ||||||||||||||||||||||||||
| const { fileURLToPath } = require("url"); | ||||||||||||||||||||||||||
| const fs = require("fs"); | ||||||||||||||||||||||||||
| const path = require("path"); | ||||||||||||||||||||||||||
| require("dotenv/config"); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint string>"; | ||||||||||||||||||||||||||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||||||||||||||||||||||||||
|
Comment on lines
+13
to
+19
|
||||||||||||||||||||||||||
| const { fileURLToPath } = require("url"); | |
| const fs = require("fs"); | |
| const path = require("path"); | |
| require("dotenv/config"); | |
| const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint string>"; | |
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | |
| const fs = require("fs"); | |
| const path = require("path"); | |
| require("dotenv/config"); | |
| const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint string>"; |
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.
Using
import.meta.urlin CommonJS modules will cause a runtime error. Since this package uses CommonJS (no"type": "module"in package.json), use__dirnamedirectly instead, which is available natively in CommonJS.Remove these lines:
And use
__dirnamedirectly since it's already available in CommonJS.