Amazon Q in Connect セッションにカスタムデータを追加する - Amazon Connect

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

Amazon Q in Connect セッションにカスタムデータを追加する

Amazon Q in Connect は、カスタムデータを Amazon Q in Connect セッションに追加して、エージェントに提示される生成 AI 駆動型ソリューションを推進できるようにサポートしています。カスタムデータを使用するには、まず UpdateSessionData API を使用してセッションに追加し、次に AI プロンプトをカスタマイズするために追加されたデータを使用します。

セッションのデータの追加と更新

UpdateSessionData API を使用して、セッションにデータを追加します。次のサンプル AWS CLI コマンドを使用します。

aws qconnect update-session-data \ --assistant-id <YOUR_Q_IN_CONNECT_ASSISTANT_ID> \ --session-id <YOUR_Q_IN_CONNECT_SESSION_ID> \ --data '[ { "key": "productId", "value": { "stringValue": "ABC-123" }}, ]'

セッションは、カスタマーサービスエージェントが Amazon Connect と Amazon Q in Connect を使用している間にコンタクト用に作成されるため、セッションデータを追加する便利な方法はフローを使用することです。AWS Lambda 関数 ブロックを使用して UpdateSessionData API を呼び出します。API はセッションに情報を追加できます。

次に操作方法を示します。

  1. Amazon Q in Connect ブロックをフローに追加します。Amazon Q in Connect ドメインをコンタクトに関連付けて、Amazon Connect がナレッジベースでリアルタイムのレコメンデーションを検索できるようにします。

  2. Amazon Q in Connect ブロックの後に AWS Lambda 関数 ブロックを配置します。UpdateSessionData API には、Amazon Q in Connect の sessionId が必要です。sessionId を取得するには、DescribeContact API と Amazon Q in Connect ブロックに関連付けられている assistantId を使用します。

次の図は、最初に Amazon Q in Connect、次に AWS Lambda 関数 の 2 つのブロックを示しています。

セッションデータを追加するように設定された Amazon Q in Connect ブロックと AWS Lambda 関数ブロック。

AI プロンプトでカスタムデータを使用する

データがセッションに追加されると、生成 AI の結果のデータを使用するように AI プロンプトをカスタマイズできます。

次の形式を使用して、データのカスタム変数を指定します。

  • {{$.Custom.<KEY>}}

例えば、顧客が特定の製品に関する情報を必要としているとします。顧客がセッション中に提供した productId を使用するクエリの再構築 AI プロンプトを作成できます。

AI プロンプトからの次の抜粋は、{{$.Custom.productId}} が LLM に提供されていることを示しています。

anthropic_version: bedrock-2023-05-31 system: You are an intelligent assistant that assists with query construction. messages: - role: user content: | Here is a conversation between a customer support agent and a customer <conversation> {{$.transcript}} </conversation> And here is the productId the customer is contacting us about <productId> {{$.Custom.productId}} </productId> Please read through the full conversation carefully and use it to formulate a query to find a relevant article from the company's knowledge base to help solve the customer's issue. Think carefully about the key details and specifics of the customer's problem. In <query> tags, write out the search query you would use to try to find the most relevant article, making sure to include important keywords and details from the conversation. The more relevant and specific the search query is to the customer's actual issue, the better. If a productId is specified, incorporate it in the query constructed to help scope down search results. Use the following output format <query>search query</query> and don't output anything else.

カスタム変数の値がセッションで使用できない場合、Amazon Q in Connect はそれを空の文字列として補間します。システムがフォールバック動作の値の存在を考慮するように、AI プロンプトで指示を提供することをお勧めします。