Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions templates/copilot-rag-m365/src/adapter.ts
Original file line number Diff line number Diff line change
@@ -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) => {
Expand All @@ -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;
Loading