Update basic NodeJS samples to Agents SDK #4056
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the bot samples to use the new
@microsoft/agents-hostingand@microsoft/agents-activitypackages, replacing the olderbotbuilderandbotbuilder-coredependencies. 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-hostingand@microsoft/agents-activity:botbuilderandbotbuilder-coreimports with@microsoft/agents-hostingand@microsoft/agents-activityacross all sample files (consoleAdapter.js,bot.js,adaptiveCardsBot.js,customPromptBot.js). [1] [2] [3] [4]package.jsonfiles to removebotbuilderandbotbuilder-coredependencies and add@microsoft/agents-hosting. [1] [2] [3] [4]Refactoring of conversation reference and activity handling:
botwithagentin the conversation reference structure inConsoleAdapter.Activity.fromObjectandapplyConversationReferencemethods. [1] [2]Modernization of code:
?.) to avoid errors when accessing nested properties likecontext.activity.recipient.id. [1] [2]Activity.fromObjectfor better structure and clarity.Simplification of authentication setup:
ConfigurationBotFrameworkAuthenticationwithloadAuthConfigFromEnvfor easier environment-based configuration in bot initialization. [1] [2] [3]Removal of unused or deprecated features:
index.jsfor 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.