diff --git a/templates/copilot-rag-m365/src/adapter.ts b/templates/copilot-rag-m365/src/adapter.ts index 7cc2bd483..23c3709da 100644 --- a/templates/copilot-rag-m365/src/adapter.ts +++ b/templates/copilot-rag-m365/src/adapter.ts @@ -1,22 +1,9 @@ -// Import required bot services. -// See https://aka.ms/bot-services to learn more about the different parts of a bot. -import { - CloudAdapter, - ConfigurationBotFrameworkAuthentication, - ConfigurationServiceClientCredentialFactory, -} from "botbuilder"; +const { TeamsAdapter } = require("@microsoft/teams-ai"); // This bot's main dialog. import config from "./config"; -const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication( - {}, - new ConfigurationServiceClientCredentialFactory(config) -); - -// Create adapter. -// See https://aka.ms/about-bot-adapter to learn more about how bots work. -const adapter = new CloudAdapter(botFrameworkAuthentication); +const adapter = new TeamsAdapter(config); // Catch-all for errors. const onTurnErrorHandler = async (context, error) => { @@ -41,7 +28,7 @@ const onTurnErrorHandler = async (context, error) => { } }; -// Set the onTurnError for the singleton CloudAdapter. +// Set the onTurnError for the singleton TeamsAdapter. adapter.onTurnError = onTurnErrorHandler; export default adapter;