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

資源:Assistant

Discovery Engine Assistant 資源。

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "generationConfig": {
    object (GenerationConfig)
  },
  "googleSearchGroundingEnabled": boolean,
  "webGroundingType": enum (WebGroundingType),
  "enabledActions": {
    string: {
      object (ActionList)
    },
    ...
  },
  "enabledTools": {
    string: {
      object (ToolList)
    },
    ...
  },
  "customerPolicy": {
    object (CustomerPolicy)
  }
}
欄位
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)

(選用步驟) 要使用的網頁基準類型。

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)

(選用步驟) 助理的客戶政策。

GenerationConfig

生成助理回覆的設定。

JSON 表示法
{
  "systemInstruction": {
    object (SystemInstruction)
  },
  "defaultLanguage": 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 網路資料來源已停用。

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 處理失敗,要求就會遭拒。

方法

assist

協助使用者查詢。

create

建立 Assistant

delete

刪除 Assistant

get

取得 Assistant

list

列出 Engine 下的所有 Assistant

patch

更新 Assistant

streamAssist

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