REST Resource: projects.locations.collections.engines.assistants

資源:Assistant

Discovery Engine 助理資源。

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "generationConfig": {
    object (GenerationConfig)
  },
  "googleSearchGroundingEnabled": boolean,
  "webGroundingType": enum (WebGroundingType),
  "defaultWebGroundingToggleOff": boolean,
  "vertexAiAgentConfigs": [
    {
      object (VertexAiAgentConfig)
    }
  ],
  "enabledActions": {
    string: {
      object (ActionList)
    },
    ...
  },
  "enabledTools": {
    string: {
      object (ToolList)
    },
    ...
  },
  "customerPolicy": {
    object (CustomerPolicy)
  },
  "vertexAiSearchToolConfig": {
    object (VertexAiSearchToolConfig)
  },
  "styleAndFormattingInstructions": string,
  "agentConfigs": [
    {
      object (AgentConfig)
    }
  ],
  "enableEndUserAgentCreation": boolean,
  "disableLocationContext": boolean
}
欄位
name

string

不可變更。助理的資源名稱。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

必須是 UTF-8 編碼的字串,長度上限為 1024 個字元。

displayName

string

這是必要旗標,助理的顯示名稱。

必須是 UTF-8 編碼的字串,長度上限為 128 個字元。

description

string

選用。Description for additional information. 預計會顯示在設定使用者介面,而非助理使用者。

generationConfig

object (GenerationConfig)

選用。生成助理回覆的設定。

googleSearchGroundingEnabled
(deprecated)

boolean

選用。已淘汰:請改用 webGroundingType

webGroundingType

enum (WebGroundingType)

選用。要使用的網頁基準類型。

defaultWebGroundingToggleOff

boolean

選用。如果 webGroundingType 設為 WEB_GROUNDING_TYPE_GOOGLE_SEARCHWEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH,這個欄位會控管預設的網頁基礎切換選項。這個欄位預設為 false。如果 webGroundingTypeWEB_GROUNDING_TYPE_GOOGLE_SEARCHWEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH,使用者介面會預設啟用網頁基礎功能。如果設為 true,UI 上的基礎切換按鈕預設會停用。啟用網頁基準後,使用者仍可在使用者介面中啟用網頁基準。

vertexAiAgentConfigs[]
(deprecated)

object (VertexAiAgentConfig)

選用。已淘汰:將由 AgentService 中的 Dialogflow 代理程式取代。可透過助理存取的 Vertex AI Agents 清單。

enabledActions
(deprecated)

map (key: string, value: object (ActionList))

選用。已淘汰:將改為使用 enabledTools。這個助理已啟用的動作。索引鍵為連接器名稱,例如「projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector」。值包含管理員對連接器執行個體啟用的動作。管理員可以選擇在專案中建立的任何連接器執行個體上啟用多項動作。例如 {"jira1ConnectorName": [(actionId1, "createTicket"), (actionId2, "transferTicket")], "gmail1ConnectorName": [(actionId3, "sendEmail"),..] }

enabledTools

map (key: string, value: object (ToolList))

選用。注意:尚未實作。請改用 enabledActions。這個助理啟用的工具。索引鍵為連接器名稱,例如「projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector」。值為管理員對連接器執行個體啟用的工具。管理員可以在專案中建立的任何連接器執行個體上,選擇性啟用多項工具。例如:{"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }

customerPolicy

object (CustomerPolicy)

選用。助理的顧客政策。

vertexAiSearchToolConfig

object (VertexAiSearchToolConfig)

選用。Vertex AI Search 工具的設定選項。

styleAndFormattingInstructions
(deprecated)

string

選用。已淘汰:請改用 additionalSystemInstruction。設定對話風格、語氣和格式的常見系統指令片段。透過預留位置 [STYLE_AND_FORMATTING_INSTRUCTIONS] 新增至所有 LLM 提示。

agentConfigs[]
(deprecated)

object (AgentConfig)

選用。已淘汰:請改用 AgentService。可透過助理聯絡的服務專員清單。

enableEndUserAgentCreation

boolean

選用。指出使用者是否可在 Agentspace 中建立代理程式。

disableLocationContext

boolean

選用。指出是否要停用使用者位置資訊內容。根據預設,系統會啟用使用者位置資訊。

GenerationConfig

生成助理回覆的設定。

JSON 表示法
{
  "defaultModelId": string,
  "allowedModelIds": [
    string
  ],
  "systemInstruction": {
    object (SystemInstruction)
  },
  "defaultLanguage": string
}
欄位
defaultModelId

string

選用。助理預設使用的模型。

allowedModelIds[]

string

選用。允許用於助理的型號清單。

systemInstruction

object (SystemInstruction)

系統指令,也稱為 LLM 呼叫的提示前言。另請參閱 https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions

defaultLanguage

string

生成 Google 助理回覆時使用的預設語言。請使用 ISO 639-1 語言代碼,例如 en。如未指定,系統會自動偵測語言。

SystemInstruction

系統指令,也稱為 LLM 呼叫的提示前言。

JSON 表示法
{
  "additionalSystemInstruction": string
}
欄位
additionalSystemInstruction

string

選用。要新增至預設系統指令的其他系統指令。

WebGroundingType

要使用的網頁基準類型。

列舉
WEB_GROUNDING_TYPE_UNSPECIFIED 預設的未指定設定。這與停用相同。
WEB_GROUNDING_TYPE_DISABLED 網路資料來源已停用。

VertexAiAgentConfig

已淘汰:請改用 AgentService 中的 Dialogflow 代理程式。代表可透過助理存取的外部 Vertex AI 代理。

JSON 表示法
{
  "displayName": string,
  "name": string,
  "toolDescription": string
}
欄位
displayName

string

這是必要旗標,Vertex AI 代理程式的顯示名稱,用於助理參考。

name

string

這是必要旗標,Vertex AI Agent 的資源名稱。格式:projects/{project}/locations/{location}/agents/{agent}

toolDescription

string

這是必要旗標,Vertex AI 代理的工具說明。LLM 會依據這段說明判斷代理是否與使用者的問題有關,以及是否應將問題轉送給代理。

ActionList

已淘汰:將改用 ToolList。連接器上啟用的動作

JSON 表示法
{
  "actionInfo": [
    {
      object (ActionInfo)
    }
  ]
}
欄位
actionInfo[]

object (ActionInfo)

動作清單和對應的動作資訊。

ActionInfo

已淘汰:將改用 ToolInfo。用於識別動作的資訊。

JSON 表示法
{
  "actionName": string,
  "actionDisplayName": string
}
欄位
actionName

string

動作名稱,由 DataConnectorService.QueryAvailableActions 定義。

actionDisplayName

string

動作的顯示名稱。

ToolList

連接器上啟用的工具

JSON 表示法
{
  "toolInfo": [
    {
      object (ToolInfo)
    }
  ]
}
欄位
toolInfo[]

object (ToolInfo)

工具清單和對應的工具資訊。

ToolInfo

用來識別工具的資訊。

JSON 表示法
{
  "toolName": string,
  "toolDisplayName": string
}
欄位
toolName

string

工具名稱,由 DataConnectorService.QueryAvailableActions 定義。注意:DataConnectorService API 中使用 action,但與這裡的 tool 相同。

toolDisplayName

string

工具的顯示名稱。

CustomerPolicy

助理的客戶定義政策。

JSON 表示法
{
  "bannedPhrases": [
    {
      object (BannedPhrase)
    }
  ],
  "modelArmorConfig": {
    object (ModelArmorConfig)
  }
}
欄位
bannedPhrases[]

object (BannedPhrase)

選用。禁用詞組清單。

modelArmorConfig

object (ModelArmorConfig)

選用。用於清理使用者提示和助理回覆的 Model Armor 設定。

BannedPhrase

客戶定義的違規片語定義。使用者查詢或 LLM 回應中不得出現遭禁用的詞組,否則系統會拒絕提供答案。

JSON 表示法
{
  "phrase": string,
  "matchType": enum (BannedPhraseMatchType),
  "ignoreDiacritics": boolean
}
欄位
phrase

string

這是必要旗標,要禁止的原始字串內容。

matchType

enum (BannedPhraseMatchType)

選用。遭禁詞組的比對類型。

ignoreDiacritics

boolean

選用。如果設為 true,系統在比對違規詞組時會忽略變音符號 (例如重音符號、雙點)。舉例來說,「cafe」會與「café」相符。

BannedPhraseMatchType

禁用詞組的比對方法。

列舉
BANNED_PHRASE_MATCH_TYPE_UNSPECIFIED 預設為 SIMPLE_STRING_MATCH。
SIMPLE_STRING_MATCH 如果文字中任何位置出現完全相符的子字串,就會視為與禁止使用的詞組相符。
WORD_BOUNDARY_STRING_MATCH 只有在文字中的模式前後有字詞分隔符時,系統才會將其視為違規片語。但片語本身仍可能包含字詞分隔符。

ModelArmorConfig

客戶定義的 Model Armor 範本設定,用於清理使用者提示和助理回覆。

JSON 表示法
{
  "userPromptTemplate": string,
  "responseTemplate": string,
  "failureMode": enum (FailureMode)
}
欄位
userPromptTemplate

string

選用。用於清除使用者提示的 Model Armor 範本資源名稱。格式:projects/{project}/locations/{location}/templates/{templateId}

如未指定,系統不會對使用者提示進行清理。

responseTemplate

string

選用。用於清理助理回覆內容的 Model Armor 範本資源名稱。格式:projects/{project}/locations/{location}/templates/{templateId}

如未指定,系統就不會對 AI 助理回覆內容進行清理。

failureMode

enum (FailureMode)

選用。定義 Model Armor 淨化作業的失敗模式。

FailureMode

決定 Model Armor 無法處理要求時的行為。

列舉
FAILURE_MODE_UNSPECIFIED 未指定失敗模式,預設行為為 FAIL_CLOSED
FAIL_OPEN 即便 Model Armor 處理失敗,要求還是可以執行,不必進行任何變更。
FAIL_CLOSED 如果 Model Armor 處理失敗,要求就會遭拒。

VertexAiSearchToolConfig

助理處理查詢時可能會使用的 Vertex AI Search 工具設定選項。

JSON 表示法
{
  "llmSystemInstructions": string
}
欄位
llmSystemInstructions
(deprecated)

string

已淘汰:請勿使用這個欄位。系統指令:根據 Vertex AI Search 的搜尋結果回答問題。請注意,搜尋工具產生的答案可能與助理的最終答案不同。

一般來說,系統指令是一組自然語言指令,模型會先處理這組指令,再處理提示詞。這項指示會告知模型應如何回應提示,請參閱 https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions

例如:「請只使用來源中的資訊回答問題。此外,請務必以 Markdown 格式清楚呈現答案。」

如未指定,則會使用內部預設值。

AgentConfig

已淘汰:請改用 AgentService。助理在處理查詢時可能會呼叫的代理程式設定選項。

JSON 表示法
{
  "id": string,
  "displayName": string,
  "toolDescription": string,
  "icon": {
    object (Image)
  },
  "authorizations": [
    string
  ],

  // Union field connection_info can be only one of the following:
  "vertexAiSdkAgentConnectionInfo": {
    object (VertexAiSdkAgentConnectionInfo)
  },
  "httpAgentConnectionInfo": {
    object (HttpAgentConnectionInfo)
  }
  // End of list of possible types for union field connection_info.
}
欄位
id

string

這是必要旗標,人類可讀的不重複代理 ID,必須符合下列規則運算式:[a-z][a-zA-Z0-9_-]*

displayName

string

這是必要旗標,助理中用於參照的代理顯示名稱。

toolDescription

string

這是必要旗標,代理的工具說明。LLM 會依據這段說明判斷代理是否與使用者的問題有關,以及是否應將問題轉送給代理。

icon

object (Image)

這是必要旗標,使用者介面上代表代理程式的圖示。

authorizations[]

string

選用。必要授權的資源名稱。如果使用者未獲得授權,服務會傳回多個授權 URI,使用者必須在瀏覽器中開啟並授權。所有授權都授予後,使用者可以重試查詢,授權會轉送給代理程式。

格式:projects/{project}/locations/{location}/authorizations/{authorization}

聯集欄位 connection_info。代理程式的連線設定。connection_info 只能是下列其中一個設定:
vertexAiSdkAgentConnectionInfo

object (VertexAiSdkAgentConnectionInfo)

這是必要旗標,Vertex AI SDK 代理程式的連線資訊

httpAgentConnectionInfo

object (HttpAgentConnectionInfo)

這是必要旗標,HTTP 代理程式的連線資訊。

VertexAiSdkAgentConnectionInfo

Vertex AI SDK 代理的連線資訊,目前僅支援透過 Reasoning Engines 公開的代理。

JSON 表示法
{
  "reasoningEngine": string
}
欄位
reasoningEngine

string

公開代理的推理引擎資源名稱。格式:projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}

HttpAgentConnectionInfo

助理可透過 HTTP 連線的代理程式。

JSON 表示法
{
  "httpUri": string
}
欄位
httpUri

string

這是必要旗標,代理程式的 HTTP 位址,例如「https://example.com/agent1」。

圖片

代表圖片。

JSON 表示法
{

  // Union field storage_method can be only one of the following:
  "uri": string,
  "content": string
  // End of list of possible types for union field storage_method.
}
欄位
聯集欄位 storage_method。可以是 URI 或以 Base64 字串編碼的內容。storage_method 只能是下列其中一個設定:
uri

string

這是必要旗標,圖片 URI。

content

string

這是必要旗標,Base64 編碼的圖片檔案內容。

方法

assist

協助使用者查詢。

create

建立 Assistant

delete

刪除 Assistant

get

取得 Assistant

list

列出 Engine 下的所有 Assistant

patch

更新 Assistant

streamAssist

以串流方式協助使用者查詢。