Repository navigation
fix(samples): fix build errors and improve A365 sample documentation - #28
Conversation
Hector Hernandez (hectorhdzg)
commented
Apr 21, 2026
- 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)
There was a problem hiding this comment.
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
AzureChatOpenAIand 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.
| "dependencies": { | ||
| "@microsoft/opentelemetry": "latest", | ||
| "@microsoft/opentelemetry": "file:..", | ||
| "dotenv": "latest", | ||
| "@opentelemetry/api": "^1.9.0", |
There was a problem hiding this comment.
@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:...
| 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 | ||
| ``` |
There was a problem hiding this comment.
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.
3166551
into
microsoft:main