הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
הערה
הבוט Copilot Studio שונה שמו ל-Copilot agent (סוכן או סוכן בינה מלאכותית). שמו של סוכן אנושי השתנה כעת לנציג שירות לקוחות (נציג שירות או נציג). ייתכן שתיתקל בהתייחסויות למונחים הישנים והחדשים בזמן שאנו מעדכנים את ממשק המשתמש של המוצר, התיעוד ותוכן ההדרכה.
עבור סוכני Azure, עליך להתקין את ה- SDK של הסוכן ליצור מופעים של תוכנת הביניים Omnichannel לפני קביעת התצורה של הקשר הסוכן.
התקנת ה- SDK של הבוט בפרוייקט שלך
כדי לפתוח את מנהל החבילות של NuGet, לחץ באמצעות לחצן העכבר הימני על הפרוייקט שלך ולאחר מכן בחר ניהול חבילות NuGet.
ב- NuGet מנהל חבילות, בחר את מקור החבילה כ- nuget.org ועיין ב-"Microsoft.Dynamics.AgentsSDK.Middleware". בחר את החבילה ולאחר מכן בחר התקן. קבל מידע נוסף בדף Nuget.
לחלופין, באפשרותך להשתמש בפקודה הבאה ב- NuGet CLI.
Install-Package Microsoft.Dynamics.AgentsSDK.Middleware
כעת הותקן ה- SDK של הסוכן ותוכנת הביניים של ריבוי ערוצים זמינה בפרויקט שלכם.
השתמש בחומרת הביניים Omnichannel בקוד הסוכן שלך
פתח את AdapterWithErrorHandler.cs הקובץ.
הוסף את משפט הייבוא ובצע מופעים של תוכנת הביניים Omnichannel.
using Microsoft.Dynamics.AgentsSDK.Middleware.Core; Use(new OmnichannelMiddleware());using System.Globalization; using System.Text; using Microsoft.Agents.Connector; using Microsoft.Agents.Core; using Microsoft.Agents.Core.Errors; using Microsoft.Extensions.Logging; using Microsoft.Dynamics.AgentsSDK.Middleware.Core; namespace Microsoft.CCaaS.MessagingRuntime.TestAgent; public class AdapterWithErrorHandler : CloudAdapter { public AdapterWithErrorHandler( IChannelServiceClientFactory channelServiceClientFactory, IActivityTaskQueue activityTaskQueue, ILogger<CloudAdapter> logger) : base(channelServiceClientFactory, activityTaskQueue, logger) { // OmnichannelMiddleware has special handling for OC event messages Use(new OmnichannelMiddleware()); OnTurnError = async (turnContext, exception) => { var exceptionInfo = GetExceptionInfo(exception); logger.LogAppException(exceptionInfo, exception); // Send a message to the user await turnContext.SendActivityAsync($"The bot encountered an error or bug.{Environment.NewLine}{exceptionInfo}"); await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code."); // Send a trace activity, which will be displayed in the Bot Framework Emulator await turnContext.TraceActivityAsync("OnTurnError Trace", exception.Message, "https://www.botframework.com/schemas/error", "TurnError"); }; } private static string GetExceptionInfo(Exception exception) { var sb = new StringBuilder(); // Pull some well known info from ErrorResponse.Exception if available. if (exception is ErrorResponseException responseException) { sb.AppendLine(CultureInfo.InvariantCulture, $"Error code: {responseException.Body?.Error?.Code ?? "NA"}"); sb.AppendLine(CultureInfo.InvariantCulture, $"Error message: {responseException.Body?.Error?.Message ?? "NA"}"); } sb.AppendLine(CultureInfo.InvariantCulture, $"Exception message: {exception.Message}"); sb.AppendLine(); sb.AppendLine(exception.ToString()); var exceptionInfo = sb.ToString(); return exceptionInfo; } }
השלבים הבאים
ניתוח מבנה טקסט של פעילות JSON לקבלת הקשר סוכן
מידע קשור
שליחת הקשר מותאם אישית
setContextProvider
שילוב סוכן של Azure