Skip to content

Conversation

@rido-min
Copy link
Member

This pull request updates the bot samples to use the new @microsoft/agents-hosting and @microsoft/agents-activity packages, replacing the older botbuilder and botbuilder-core dependencies. It also introduces changes to improve code clarity and modernize the implementation. Below is a breakdown of the most important changes:

Migration to @microsoft/agents-hosting and @microsoft/agents-activity:

  • Replaced botbuilder and botbuilder-core imports with @microsoft/agents-hosting and @microsoft/agents-activity across all sample files (consoleAdapter.js, bot.js, adaptiveCardsBot.js, customPromptBot.js). [1] [2] [3] [4]
  • Updated package.json files to remove botbuilder and botbuilder-core dependencies and add @microsoft/agents-hosting. [1] [2] [3] [4]

Refactoring of conversation reference and activity handling:

  • Replaced bot with agent in the conversation reference structure in ConsoleAdapter.
  • Simplified activity creation and conversation reference application using Activity.fromObject and applyConversationReference methods. [1] [2]

Modernization of code:

  • Used optional chaining (?.) to avoid errors when accessing nested properties like context.activity.recipient.id. [1] [2]
  • Updated adaptive card message sending to use Activity.fromObject for better structure and clarity.

Simplification of authentication setup:

  • Replaced ConfigurationBotFrameworkAuthentication with loadAuthConfigFromEnv for easier environment-based configuration in bot initialization. [1] [2] [3]

Removal of unused or deprecated features:

  • Commented out WebSocket streaming logic in index.js for the Echo Bot sample, indicating it is no longer required.

These changes collectively modernize the bot samples, align them with the latest Microsoft bot framework libraries, and simplify the codebase for better maintainability.

@rido-min rido-min marked this pull request as ready for review July 30, 2025 00:04
@rido-min rido-min requested a review from MattB-msft July 30, 2025 00:05

const botbuilderCore = require('botbuilder-core');
const { BotAdapter, TurnContext, ActivityTypes } = botbuilderCore;
// const botbuilderCore = require('botbuilder-core');
Copy link
Collaborator

Choose a reason for hiding this comment

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

A commented line seems to have been overlooked here.
Also, the remarks section in line 16 mentions botbuilder.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The README files are also mentioning BotFramework.

@rido-min rido-min closed this Jul 30, 2025
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.

2 participants