Skip to content

fix(samples): fix build errors and improve A365 sample documentation - #28

Merged
Hector Hernandez (hectorhdzg) merged 1 commit into
microsoft:mainfrom
hectorhdzg:fix/samples-build-and-docs
Apr 22, 2026
Merged

Hector Hernandez (hectorhdzg) merged 1 commit into
microsoft:mainfrom
hectorhdzg:fix/samples-build-and-docs

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member
  • Replace ChatOpenAI with AzureChatOpenAI in langchainInstrumentation.ts to match current @langchain/openai API
  • Prefix unused parameter in a365ManualScopes.ts
  • Add sample.env template with all required environment variables
  • Add !sample.env exception to .gitignore
  • Update README with environment variable reference table
  • Rewrite a365Export.ts and a365ManualScopes.ts with step-by-step walkthrough-style documentation (aligned with Agent365-Samples style)

- Point @microsoft/opentelemetry dependency to local package (file:..)
  since new A365 exports are not yet published to npm
- Add skipLibCheck to samples tsconfig to suppress third-party .d.ts errors
- Replace ChatOpenAI with AzureChatOpenAI in langchainInstrumentation.ts
  to match current @langchain/openai API
- Prefix unused parameter in a365ManualScopes.ts
- Add sample.env template with all required environment variables
- Add !sample.env exception to .gitignore
- Update README with environment variable reference table
- Rewrite a365Export.ts and a365ManualScopes.ts with step-by-step
  walkthrough-style documentation (aligned with Agent365-Samples style)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the TypeScript samples to align with current dependency APIs, improve Agent365 (A365) sample walkthrough documentation, and add an environment variable template for easier setup.

Changes:

  • Update LangChain sample to use AzureChatOpenAI and adjust model initialization options.
  • Expand A365 sample files with step-by-step, walkthrough-style documentation and minor lint/build fixes.
  • Add samples/sample.env, update sample README with an env-var reference table, and adjust samples dependencies/lockfile.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
samples/tsconfig.json Enables skipLibCheck to reduce type-check friction in sample builds.
samples/src/langchainInstrumentation.ts Switches to AzureChatOpenAI and updates constructor options for current @langchain/openai.
samples/src/a365ManualScopes.ts Adds detailed walkthrough documentation; prefixes an unused parameter for TS linting.
samples/src/a365Export.ts Rewrites sample header/docs into a step-by-step setup explanation.
samples/sample.env Adds a checked-in env template covering required variables across samples.
samples/package.json Changes @microsoft/opentelemetry dependency to file:.. to use the local repo package.
samples/package-lock.json Adds a lockfile for the samples package for reproducible installs.
samples/README.md Adds an env-var reference table and refreshes A365 sample descriptions.
.gitignore Attempts to un-ignore sample.env so the template can be committed.
Files not reviewed (1)
  • samples/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/package.json
Comment on lines 19 to 22
"dependencies": {
"@microsoft/opentelemetry": "latest",
"@microsoft/opentelemetry": "file:..",
"dotenv": "latest",
"@opentelemetry/api": "^1.9.0",

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@microsoft/opentelemetry is now a file:.. dependency. With the root package only publishing dist/ (and no prepare script), a fresh clone without a prior root npm run build will make this dependency missing its JS/typings and cause the samples' tsc build to fail. Consider either (a) updating the samples setup docs to instruct building the repo root before npm install here, or (b) adding an install/prepare step that builds the parent package when installing from file:...

Copilot uses AI. Check for mistakes.
Comment thread samples/README.md
Comment on lines 47 to 54
npm run build
```

3. Copy `sample.env` to `.env` and fill in your connection string:
3. Copy `sample.env` to `.env` and fill in the variables needed by the samples you want to run:

```bash
cp sample.env .env
```

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given samples/package.json now installs @microsoft/opentelemetry via file:.., the setup flow here also needs to mention that the repo root package must be built first (so dist/ exists) before building/running the samples. Otherwise npm run build in samples/ will fail on a fresh clone due to missing JS/typings in the linked parent package.

Copilot uses AI. Check for mistakes.
@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit 3166551 into microsoft:main Apr 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants