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

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

セッションデータを追加するように設定された 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 プロンプトで指示を提供することをお勧めします。