生成式知識輔助

生成式知識輔助功能會根據您提供的文件資訊,回答服務專員的問題。你可以指定網域名稱,或上傳文件供資料儲存庫代理程式建立索引。生成式知識輔助功能會整合這些資訊、進行中的對話和可用的顧客中繼資料,為服務專員提供更相關且及時的答案。

主動式生成知識輔助功能會追蹤服務專員與顧客之間的對話,系統會根據目前的對話內容和答案,主動提供搜尋查詢建議。

建立資料儲存庫代理程式

  1. 除非您是專案擁有者,否則必須具備下列角色才能建立資料儲存庫代理程式:

    • Dialogflow API 管理員
    • Discovery Engine 管理員
  2. 在 Vertex AI 控制台中啟用 AI Applications API。

  3. 如要建立代理程式,請按照「資料儲存庫代理程式」一文中的步驟操作。

回答真人服務專員的問題

資料儲存庫服務專員可以根據您提供的文件,回答真人服務專員的問題。

步驟 1:建立對話設定檔

使用 Agent Assist 控制台或 API 建立對話設定檔

透過控制台建立

  1. 您必須啟用生成式知識輔助建議類型,並連結上一個步驟中的資料儲存庫代理程式。
  2. 選用:勾選「停用代理商搜尋查詢記錄」核取方塊,指出是否要讓 Google 收集及儲存經過編輯的搜尋查詢,以利改善品質。
  3. 您可以勾選「啟用對話擴增查詢」核取方塊,指出在產生搜尋查詢的答案時,是否要將真人服務專員與使用者之間的對話內容納入考量。

透過 API 建立

下列步驟說明如何使用 HumanAgentAssistantConfig 物件建立 ConversationProfile。您也可以使用 Agent Assist 控制台執行這些動作。

如要建立對話設定檔,請在 ConversationProfile 資源上呼叫 create 方法。

使用任何要求資料之前,請先替換以下項目:
  • PROJECT_ID:您的專案 ID
  • LOCATION_ID:地點的 ID
  • AGENT_ID:上一步的資料儲存庫代理程式 ID
以下是 JSON 範例:
  {
    "displayName": "my-conversation-profile-display-name",
    "humanAgentAssistantConfig": {
      "humanAgentSuggestionConfig": {
        "featureConfigs": [
          {
            "suggestionFeature": {
              "type": "KNOWLEDGE_SEARCH"
            },
            "queryConfig": {
              "dialogflowQuerySource": {
                "humanAgentSideConfig": {
                  "agent": "projects/PROJECT_ID/locations/LOCATION_ID/agents/AGENT_ID"
                }
              }
            },
            "disableAgentQueryLogging": false,
            "enableConversationAugmentedQuery": false,
          }
        ]
      }
    }
  }
      

在 Agent Assist 控制台中建立對話設定檔時,Agent Assist 會自動啟用生成式知識輔助和主動式生成式知識輔助。如要停用主動式生成知識輔助功能,請使用 API 建立對話設定檔。

步驟 2:使用資料儲存區代理程式

您也可以使用 SearchKnowledge API,從資料存放區代理程式取得答案。您也可以在 SearchKnowledge 要求中加入下列設定:

  • querySource:設定這個欄位,指出查詢是由服務專員輸入,還是由主動式生成知識輔助功能自動建議。
  • exactSearch:設定這個欄位,指出是否要搜尋確切的輸入查詢,而不進行查詢重寫。
  • endUserMetadata:設定這個欄位,加入有關終端使用者的其他資訊,以改善生成的答案。詳情請參閱資料商店代理程式效能個人化頁面
  • searchConfig:設定這個欄位,進一步控制知識文件,以利提升和篩選。詳情請參閱「資料儲存空間代理程式效能搜尋設定頁面」。

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您的專案 ID
  • LOCATION_ID:地點的 ID
  • CONVERSATION_PROFILE_ID:上一個步驟中的對話設定檔 ID
  • SESSION_ID:您的搜尋工作階段 ID
  • 同一工作階段的搜尋記錄可能會影響搜尋結果。您可以將下列對話 ID 用於工作階段 ID。
  • CONVERSATION_ID:觸發搜尋要求的對話 (人類服務專員與使用者之間的對話)
  • MESSAGE_ID:觸發搜尋要求時的最新對話訊息

以下是 JSON 要求範例:

{
  "parent": "projects/PROJECT_ID/locations/LOCATION_ID"
  "query": {
    "text": "What is the return policy?"
  }
  "conversationProfile": "projects/PROJECT_ID/locations/LOCATION_ID/conversationProfiles/CONVERSATION_PROFILE_ID"
  "sessionId": "SESSION_ID
  "conversation": "projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID"
  "latestMessage": "projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID/messages/MESSAGE_ID
  "querySource": AGENT_QUERY
  "exactSearch": false
  "searchConfig": {
    "filterSpecs": {
      "filter": "category: ANY(\"persona_B\")"
    }
  }
  "endUserMetadata": {
    "deviceOwned": "Google Pixel 7"
  }
}

如果代理程式是在與使用者對話期間進行搜尋,請視需要提供 conversationlatest_message 資源名稱。如果您啟用 enable_conversation_augmented_query 選項,並希望透過代理程式與使用者之間的對話情境,提升查詢回覆體驗,則必須填寫這兩個欄位。

模擬工具

Agent Assist 模擬工具中測試資料儲存庫代理程式。

在上述範例中,資料儲存庫代理程式會使用下列資訊回答使用者查詢 What is the refund processing time?

  • 生成式 AI 生成的答案退貨包裹送達賣家的退貨中心後,最多可能需要 7 個工作天才能處理完畢。使用訂單頁面上的退貨追蹤號碼,查看退款狀態。
  • 相關知識文件的標題:「退貨和退款」。

主動為服務專員建議問答內容

主動式生成知識輔助功能會追蹤進行中的對話,並主動提供搜尋查詢建議和答案。

步驟 1:建立對話設定檔

使用 Agent Assist 控制台或 API 建立對話設定檔。建議您使用 Agent Assist 控制台建立對話設定檔。

透過控制台建立

  1. 啟用「生成知識輔助」建議類型,並連結至上一步的資料儲存庫代理程式。這可讓資料儲存庫服務專員主動提供查詢和回答建議,並回答真人服務專員的手動搜尋查詢。
  2. 選用:勾選「顯示對話的所有建議查詢」核取方塊,讓資料存放區代理程式顯示所有查詢,即使知識文件找不到答案也一樣。這項功能用於測試可從進行中的對話擷取哪些查詢。
  3. 選用:勾選「Load proactive answers asynchronously」(非同步載入主動式答案) 核取方塊,即可只取得查詢建議。您可以手動將建議的查詢提交至 SearchKnowledge API,並在 Agent Assist 控制台模擬器和 UI 模組中自動提交。

透過 API 建立

下列步驟會建立含有 HumanAgentAssistantConfig 物件的 ConversationProfile。您也可以使用 Agent Assist 控制台執行這些動作。

如要建立對話設定檔,請在 ConversationProfile 資源上呼叫 create 方法。

使用任何要求資料之前,請先替換以下項目:
  • PROJECT_ID:您的專案 ID
  • LOCATION_ID:地點的 ID
  • AGENT_ID:上一步的資料儲存庫代理程式 ID
以下是 JSON 範例:
  {
    "displayName": "my-conversation-profile-display-name",
    "humanAgentAssistantConfig": {
      "humanAgentSuggestionConfig": {
        "featureConfigs": [
          {
            "suggestionFeature": {
              "type": "KNOWLEDGE_ASSIST"
            },
            "queryConfig": {
              "dialogflowQuerySource": {
                "agent": "projects/PROJECT_ID/locations/LOCATION_ID/agents/AGENT_ID"
              }
            },
            "enableQuerySuggestionWhenNoAnswer": false,
          }
        ]
      }
    }
  }
      

步驟 2:在執行階段處理對話

主動生成知識輔助功能會在執行階段處理對話,根據目前的對話內容和答案,主動提供搜尋查詢建議。

建立對話

首先,您必須建立對話

REST

如要建立對話,請在 Conversation 資源上呼叫 create 方法。

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您的 Cloud 專案 ID
  • LOCATION_ID:您的位置 ID
  • CONVERSATION_PROFILE_ID:建立對話設定檔時收到的 ID

HTTP 方法和網址:

POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION_ID/conversations

JSON 要求主體:

{
  "conversationProfile": "projects/PROJECT_ID/locations/LOCATION_ID/conversationProfiles/CONVERSATION_PROFILE_ID",
}

如要傳送要求,請展開以下其中一個選項:

您應該會收到如下的 JSON 回應:

{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID",
  "lifecycleState": "IN_PROGRESS",
  "conversationProfile": "projects/PROJECT_ID/locations/LOCATION_ID/conversationProfiles/CONVERSATION_PROFILE_ID",
  "startTime": "2018-11-05T21:05:45.622Z"
}

conversations 後方的路徑區段包含新的對話 ID。

Python

詳情請參閱 AI Applications Python API 參考說明文件

如要向 AI Applications 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。

def create_conversation(project_id, conversation_profile_id):
    """Creates a conversation with given values

    Args:
        project_id:  The GCP project linked with the conversation.
        conversation_profile_id: The conversation profile id used to create
        conversation."""

    client = dialogflow.ConversationsClient()
    conversation_profile_client = dialogflow.ConversationProfilesClient()
    project_path = client.common_project_path(project_id)
    conversation_profile_path = conversation_profile_client.conversation_profile_path(
        project_id, conversation_profile_id
    )
    conversation = {"conversation_profile": conversation_profile_path}
    response = client.create_conversation(
        parent=project_path, conversation=conversation
    )

    print("Life Cycle State: {}".format(response.lifecycle_state))
    print("Conversation Profile Name: {}".format(response.conversation_profile))
    print("Name: {}".format(response.name))
    return response

建立使用者參與者

在對話中新增使用者和服務專員參與者,即可查看建議。首先,將使用者參與者新增至對話:

REST

如要建立使用者參與者,請在 Participant 資源上呼叫 create 方法。

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您的 Cloud 專案 ID
  • LOCATION_ID:您的位置 ID
  • CONVERSATION_ID:您的對話 ID

HTTP 方法和網址:

POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID/participants

JSON 要求主體:

{
  "role": "END_USER",
}

如要傳送要求,請展開以下其中一個選項:

您應該會收到如下的 JSON 回應:

{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID/participants/PARTICIPANT_ID",
  "role": "END_USER"
}

participants 後方的路徑區段包含了您的新使用者參與者 ID。

Python

詳情請參閱 AI Applications Python API 參考說明文件

如要向 AI Applications 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。

def create_participant(project_id: str, conversation_id: str, role: str):
    from google.cloud import dialogflow_v2beta1 as dialogflow

    """Creates a participant in a given conversation.

    Args:
        project_id: The GCP project linked with the conversation profile.
        conversation_id: Id of the conversation.
        participant: participant to be created."""

    client = dialogflow.ParticipantsClient()
    conversation_path = dialogflow.ConversationsClient.conversation_path(
        project_id, conversation_id
    )
    if role in ROLES:
        response = client.create_participant(
            parent=conversation_path, participant={"role": role}, timeout=600
        )
        print("Participant Created.")
        print(f"Role: {response.role}")
        print(f"Name: {response.name}")

        return response

建立代理程式參與者

將服務專員參與者新增至對話:

REST

如要建立代理程式參與者,請在 Participant 資源上呼叫 create 方法。

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您的 Cloud 專案 ID
  • LOCATION_ID:您的位置 ID
  • CONVERSATION_ID:您的對話 ID

HTTP 方法和網址:

POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID/participants

JSON 要求主體:

{
  "role": "HUMAN_AGENT",
}

如要傳送要求,請展開以下其中一個選項:

您應該會收到如下的 JSON 回應:

{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID/participants/PARTICIPANT_ID",
  "role": "HUMAN_AGENT"
}

participants 後方的路徑區段包含了您新的人工服務專員參與者 ID。

Python

詳情請參閱 AI Applications Python API 參考說明文件

如要向 AI Applications 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。

def create_participant(project_id: str, conversation_id: str, role: str):
    from google.cloud import dialogflow_v2beta1 as dialogflow

    """Creates a participant in a given conversation.

    Args:
        project_id: The GCP project linked with the conversation profile.
        conversation_id: Id of the conversation.
        participant: participant to be created."""

    client = dialogflow.ParticipantsClient()
    conversation_path = dialogflow.ConversationsClient.conversation_path(
        project_id, conversation_id
    )
    if role in ROLES:
        response = client.create_participant(
            parent=conversation_path, participant={"role": role}, timeout=600
        )
        print("Participant Created.")
        print(f"Role: {response.role}")
        print(f"Name: {response.name}")

        return response

新增及分析代理程式的訊息

每次對話參與者在對話中輸入訊息時,您都需要將該訊息傳送至 API 進行處理。資料儲存庫代理程式會根據對真人服務專員和使用者訊息的分析結果,提供建議。在下列範例中,真人服務專員會先詢問「需要協助嗎?」

目前回覆中沒有任何建議。

REST

如要在對話中加入及分析真人服務專員的訊息,請呼叫 Participant 資源的 analyzeContent 方法。

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您的專案 ID
  • CONVERSATION_ID:您的對話 ID
  • PARTICIPANT_ID:真人服務專員參與者 ID

HTTP 方法和網址:

POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/conversations/CONVERSATION_ID/participants/PARTICIPANT_ID:analyzeContent

JSON 要求主體:

{
  "textInput": {
    "text": "How may I help you?",
    "languageCode": "en-US"
  }
}

如要傳送要求,請展開以下其中一個選項:

您應該會收到如下的 JSON 回應:

{
  "message": {
    "name": "projects/PROJECT_ID/conversations/CONVERSATION_ID/messages/MESSAGE_ID",
    "content": "How may I help you?",
    "languageCode": "en-US",
    "participant": "PARTICIPANT_ID",
    "participantRole": "HUMAN_AGENT",
    "createTime": "2020-02-13T00:01:30.683Z"
  }
}

Python

詳情請參閱 AI Applications Python API 參考說明文件

如要向 AI Applications 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。

def analyze_content_text(
    project_id: str, conversation_id: str, participant_id: str, text: str
):
    from google.cloud import dialogflow_v2beta1 as dialogflow

    """Analyze text message content from a participant.

    Args:
        project_id: The GCP project linked with the conversation profile.
        conversation_id: Id of the conversation.
        participant_id: Id of the participant.
        text: the text message that participant typed."""

    client = dialogflow.ParticipantsClient()
    participant_path = client.participant_path(
        project_id, conversation_id, participant_id
    )
    text_input = {"text": text, "language_code": "en-US"}
    response = client.analyze_content(
        participant=participant_path, text_input=text_input
    )
    print("AnalyzeContent Response:")
    print(f"Reply Text: {response.reply_text}")

    for suggestion_result in response.human_agent_suggestion_results:
        if suggestion_result.error is not None:
            print(f"Error: {suggestion_result.error.message}")
        if suggestion_result.suggest_articles_response:
            for answer in suggestion_result.suggest_articles_response.article_answers:
                print(f"Article Suggestion Answer: {answer.title}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_faq_answers_response:
            for answer in suggestion_result.suggest_faq_answers_response.faq_answers:
                print(f"Faq Answer: {answer.answer}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_smart_replies_response:
            for (
                answer
            ) in suggestion_result.suggest_smart_replies_response.smart_reply_answers:
                print(f"Smart Reply: {answer.reply}")
                print(f"Answer Record: {answer.answer_record}")

    for suggestion_result in response.end_user_suggestion_results:
        if suggestion_result.error:
            print(f"Error: {suggestion_result.error.message}")
        if suggestion_result.suggest_articles_response:
            for answer in suggestion_result.suggest_articles_response.article_answers:
                print(f"Article Suggestion Answer: {answer.title}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_faq_answers_response:
            for answer in suggestion_result.suggest_faq_answers_response.faq_answers:
                print(f"Faq Answer: {answer.answer}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_smart_replies_response:
            for (
                answer
            ) in suggestion_result.suggest_smart_replies_response.smart_reply_answers:
                print(f"Smart Reply: {answer.reply}")
                print(f"Answer Record: {answer.answer_record}")

    return response

新增使用者提供的建議訊息

使用者向服務專員詢問「When can I get my return refund?」(我何時可以收到退貨退款?)。這次 API 回應會包含建議的查詢,以及根據知識文件生成的 AI 答案。

REST

如要為對話新增及分析使用者訊息,請呼叫 Participant 資源上的 analyzeContent 方法。

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您的專案 ID
  • CONVERSATION_ID:您的對話 ID
  • PARTICIPANT_ID:您的參與者 ID

HTTP 方法和網址:

POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/conversations/CONVERSATION_ID/participants/PARTICIPANT_ID:analyzeContent

JSON 要求主體:

{
  "textInput": {
    "text": "When can I get my return refund?",
    "languageCode": "en-US"
  }
}

如要傳送要求,請展開以下其中一個選項:

您應該會收到如下的 JSON 回應:

{
  "message": {
    "name": "projects/PROJECT_ID/conversations/CONVERSATION_ID/messages/MESSAGE_ID",
    "content": "When can I get my return refund?",
    "languageCode": "en-US",
    "participant": "PARTICIPANT_ID",
    "participantRole": "END_USER",
    "createTime": "2020-02-13T00:07:35.925Z"
  },
  "humanAgentSuggestionResults": [
    {
      "suggestKnowledgeAssistResponse": {
        "knowledgeAssistAnswer": {
          "suggestedQuery": {
            "queryText": "Refund processing time"
          },
          "suggestedQueryAnswer": {
            "answerText": "After your return is processed, you receive your refund in 7 days. The refund amount should be for the full value of the items returned, but doesn't include shipping & service fees.",
            "generativeSource": {
              "snippets": [
                {
                  "title": "Returns & refunds - Help",
                  "uri": "https://example.com/",
                  "text": "When the package with your return arrives at the seller's return center, it may take up to 7 additional business days to process. Check the status of your refund with the return tracking number found on your orders page."
                }
              ]
            },
          },
          "answerRecord": "projects/PROJECT_ID/answerRecords/ANSWER_RECORD_ID"
        },
      }
    }
  ]
}

Python

詳情請參閱 AI Applications Python API 參考說明文件

如要向 AI Applications 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。

def analyze_content_text(
    project_id: str, conversation_id: str, participant_id: str, text: str
):
    from google.cloud import dialogflow_v2beta1 as dialogflow

    """Analyze text message content from a participant.

    Args:
        project_id: The GCP project linked with the conversation profile.
        conversation_id: Id of the conversation.
        participant_id: Id of the participant.
        text: the text message that participant typed."""

    client = dialogflow.ParticipantsClient()
    participant_path = client.participant_path(
        project_id, conversation_id, participant_id
    )
    text_input = {"text": text, "language_code": "en-US"}
    response = client.analyze_content(
        participant=participant_path, text_input=text_input
    )
    print("AnalyzeContent Response:")
    print(f"Reply Text: {response.reply_text}")

    for suggestion_result in response.human_agent_suggestion_results:
        if suggestion_result.error is not None:
            print(f"Error: {suggestion_result.error.message}")
        if suggestion_result.suggest_articles_response:
            for answer in suggestion_result.suggest_articles_response.article_answers:
                print(f"Article Suggestion Answer: {answer.title}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_faq_answers_response:
            for answer in suggestion_result.suggest_faq_answers_response.faq_answers:
                print(f"Faq Answer: {answer.answer}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_smart_replies_response:
            for (
                answer
            ) in suggestion_result.suggest_smart_replies_response.smart_reply_answers:
                print(f"Smart Reply: {answer.reply}")
                print(f"Answer Record: {answer.answer_record}")

    for suggestion_result in response.end_user_suggestion_results:
        if suggestion_result.error:
            print(f"Error: {suggestion_result.error.message}")
        if suggestion_result.suggest_articles_response:
            for answer in suggestion_result.suggest_articles_response.article_answers:
                print(f"Article Suggestion Answer: {answer.title}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_faq_answers_response:
            for answer in suggestion_result.suggest_faq_answers_response.faq_answers:
                print(f"Faq Answer: {answer.answer}")
                print(f"Answer Record: {answer.answer_record}")
        if suggestion_result.suggest_smart_replies_response:
            for (
                answer
            ) in suggestion_result.suggest_smart_replies_response.smart_reply_answers:
                print(f"Smart Reply: {answer.reply}")
                print(f"Answer Record: {answer.answer_record}")

    return response

完成對話

對話結束後,請使用 API 完成對話。

REST

如要完成對話,請呼叫 conversations 資源上的 complete 方法。

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您的 GCP 專案 ID
  • CONVERSATION_ID:建立對話時收到的 ID

HTTP 方法和網址:

POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/conversations/CONVERSATION_ID:complete

如要傳送要求,請展開以下其中一個選項:

您應該會收到如下的 JSON 回應:

{
  "name": "projects/PROJECT_ID/conversations/CONVERSATION_ID",
  "lifecycleState": "COMPLETED",
  "conversationProfile": "projects/PROJECT_ID/conversationProfiles/CONVERSATION_PROFILE_ID",
  "startTime": "2018-11-05T21:05:45.622Z",
  "endTime": "2018-11-06T03:50:26.930Z"
}

Python

詳情請參閱 AI Applications Python API 參考說明文件

如要向 AI Applications 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。

def complete_conversation(project_id, conversation_id):
    """Completes the specified conversation. Finished conversations are purged from the database after 30 days.

    Args:
        project_id: The GCP project linked with the conversation.
        conversation_id: Id of the conversation."""

    client = dialogflow.ConversationsClient()
    conversation_path = client.conversation_path(project_id, conversation_id)
    conversation = client.complete_conversation(name=conversation_path)
    print("Completed Conversation.")
    print("Life Cycle State: {}".format(conversation.lifecycle_state))
    print("Conversation Profile Name: {}".format(conversation.conversation_profile))
    print("Name: {}".format(conversation.name))
    return conversation

模擬工具

您可以在 Agent Assist 模擬工具中測試資料儲存庫代理程式。

在上述範例中,資料儲存庫代理程式會提供下列建議:

  • 建議查詢退款處理時間
  • 生成式 AI 生成的答案退貨程序完成後,你將在 7 天內收到退款。退款金額應為退回商品的全額價值,但不包括運費和服務費。
  • 相關知識文件標題:「退貨與退款 - 說明」。

步驟 3:Pub/Sub 建議通知

建立對話設定檔時,您可以設定 notificationConfig 欄位,接收建議通知。這個選項會使用 Pub/Sub,在對話進行期間和有新建議時,將建議通知傳送至應用程式。

如果您是透過 AnalyzeContent API 整合,可以選擇在 ConversationProfile 中啟用 disable_high_latency_features_sync_delivery 設定,確保 AnalyzeContent API 會回應,不必等待主動式生成知識輔助建議,並透過 Pub/Sub 提供建議。

您也可以從 Agent Assist 控制台啟用這項設定。

透過 Conversational Insights 存取資料

或者,系統會將主動生成的查詢和答案自動填入對話洞察。如要存取這項資料,請按照「啟用 Dialogflow 執行階段整合功能」一文中的操作說明進行。

提供意見

如需傳送意見回饋的步驟,請參閱「傳送意見回饋給 Agent Assist」。

回答服務專員的問題

以下是傳送有關回答代理程式問題意見回饋的 JSON 要求範例。

{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/answerRecords/ANSWER_RECORD_ID",
  "answerFeedback": {
    "displayed": true
    "clicked": true
    "correctnessLevel": "FULLY_CORRECT"
    "agentAssistantDetailFeedback": {
      "knowledgeSearchFeedback": {
        "answerCopied": true
        "clickedUris": [
          "url_1",
          "url_2",
          "url_3",
        ]
      }
    }
  }
}

主動建議問與答

以下是傳送主動建議意見回饋的 JSON 要求範例。

{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/answerRecords/ANSWER_RECORD_ID",
  "answerFeedback": {
    "displayed": true
    "clicked": true
    "correctnessLevel": "FULLY_CORRECT"
    "agentAssistantDetailFeedback": {
      "knowledgeAssistFeedback": {
        "answerCopied": true
        "clickedUris": [
          "url_1",
          "url_2",
          "url_3",
        ]
      }
    }
  }
}

中繼資料

如果為知識文件設定中繼資料,生成式知識輔助和主動式生成式知識輔助都會在回覆中一併傳回文件的中繼資料。

舉例來說,您可以使用中繼資料標記知識文件是內部私人文章還是外部公開文章。在服務專員輔助模擬器UI 模組中,生成式知識輔助和主動式生成式知識輔助都會自動顯示特定鍵的文件中繼資料值。

  • gka_source_label:值會直接顯示在建議資訊卡中。
  • gka_source_tooltip:如果值為 struct 類型,將游標懸停在來源連結上會展開並在工具提示中顯示值。

如果知識文件有下列中繼資料,建議資訊卡會將來源列為 External Doc,工具提示則會新增 doc_visibility: public doc

中繼資料: None { "title": "Public Sample Doc", "gka_source_label": "External Doc", "gka_source_tooltip": { "doc_visibility": "public doc" } }

語言支援

查看支援語言的完整清單