生成式知识辅助

生成式知识辅助功能会根据您提供的文档中的信息,为客服人员解答问题。您可以指定域名,也可以上传要供数据存储区代理编入索引的文档。生成式知识辅助会将这些信息与正在进行的对话和可用的客户元数据相结合,为客服人员提供更相关、更及时的回答。

主动生成式知识辅助会跟踪客服人员与客户之间的对话。它会根据当前对话上下文和回答,主动提供搜索查询建议。

创建数据存储区代理

  1. 除非您是项目所有者,否则您需要拥有以下角色才能创建数据存储区代理:

    • Dialogflow API Admin
    • Discovery Engine Admin
  2. 在 Vertex AI 控制台中激活 Vertex AI Agent Builder 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:设置此字段以包含有关最终用户的其他信息,以改进生成的回答。如需了解详情,请参阅“Data Store 代理性能个性化”页面
  • 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. 可选:使用异步加载主动回答复选框可仅获取查询建议。您可以手动将建议的查询提交到 SearchKnowledge API,也可以在 Agent Assist 控制台模拟器和界面模块中自动提交。

通过 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

如需了解详情,请参阅 Vertex AI Agent Builder Python API 参考文档

如需向 Vertex AI Agent Builder 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

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

如需了解详情,请参阅 Vertex AI Agent Builder Python API 参考文档

如需向 Vertex AI Agent Builder 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

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

如需了解详情,请参阅 Vertex AI Agent Builder Python API 参考文档

如需向 Vertex AI Agent Builder 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

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

如需了解详情,请参阅 Vertex AI Agent Builder Python API 参考文档

如需向 Vertex AI Agent Builder 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

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 响应包含建议的查询以及基于知识文档的生成式 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

如需了解详情,请参阅 Vertex AI Agent Builder Python API 参考文档

如需向 Vertex AI Agent Builder 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

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

如需了解详情,请参阅 Vertex AI Agent Builder Python API 参考文档

如需向 Vertex AI Agent Builder 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

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 控制台启用此配置。

通过对话数据分析访问数据

或者,系统会自动将生成式知识辅助功能主动生成的查询和回答填充到对话分析中。如需在该位置访问这些数据,请按照启用 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",
        ]
      }
    }
  }
}

元数据

如果您为知识文档配置了metadata,生成式知识辅助和主动生成式知识辅助都会随响应一起返回文档的元数据。

例如,您可以使用元数据标记知识文档是内部私享文章还是外部公开文章。在客服助手模拟器界面模块中,生成式知识辅助和主动生成式知识辅助都会自动显示特定键的文档元数据值。

  • 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" } }

语言支持

请参阅支持的语言的完整列表