共用方式為


Vector Store Files - Create Vector Store File

通過將檔案附加到向量存儲來創建向量存儲檔。

POST {endpoint}/vector_stores/{vectorStoreId}/files?api-version=v1

URI 參數

名稱 位於 必要 類型 Description
endpoint
path True

string (uri)

專案端點,其形式為: https://.services.ai.azure.com/api/projects/

vectorStoreId
path True

string

向量存儲的標識碼。

api-version
query True

string

minLength: 1

要用於這項作業的 API 版本。

要求本文

名稱 類型 Description
chunking_strategy

VectorStoreChunkingStrategyRequest

用於對文件進行分塊的分塊策略。 如果未設置,則使用 auto 策略。

data_source

VectorStoreDataSource

Azure 資產標識碼。

file_id

string

文件的識別碼。

回應

名稱 類型 Description
200 OK

VectorStoreFile

要求已成功。

Other Status Codes

AgentV1Error

未預期的錯誤回應。

安全性

OAuth2Auth

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

範圍

名稱 Description
https://ai.azure.com/.default

定義

名稱 Description
AgentErrorDetail

描述代理 API 傳回的錯誤資訊。

AgentV1Error

代理 API 傳回的錯誤負載。

VectorStoreAutoChunkingStrategyRequest

預設策略。 此策略目前使用 800 和 400 chunk_overlap_tokens的max_chunk_size_tokens。

VectorStoreAutoChunkingStrategyResponse

當區塊化策略未知時,就會傳回這個值。 一般而言,這是因為檔案是在 API 中引進chunking_strategy概念之前編製索引。

VectorStoreChunkingStrategyRequestType

分塊策略的類型

VectorStoreChunkingStrategyResponseType

分塊策略的類型

VectorStoreDataSource

結構,包含 Azure 資產 URI 路徑,以及做為企業檔案搜尋數據源的檔案資產類型。

VectorStoreDataSourceAssetType

向量存儲資產的類型。 資產類型可以是uri_asset,在這種情況下,它應包含資產 URI ID,在這種情況下,它應包含數據 ID id_asset。

VectorStoreFile

附加至向量存放區之檔案的描述。

VectorStoreFileError

處理此向量存放區檔案時可能發生之錯誤的詳細數據

VectorStoreFileErrorCode

向量存儲檔處理的錯誤代碼變體

VectorStoreFileStatus

向量存儲文件狀態

VectorStoreStaticChunkingStrategyOptions

設定向量存放區靜態區塊化策略的選項。

VectorStoreStaticChunkingStrategyRequest

靜態設定的區塊化策略。

VectorStoreStaticChunkingStrategyResponse

靜態設定的區塊化策略。

AgentErrorDetail

描述代理 API 傳回的錯誤資訊。

名稱 類型 Description
code

string

機器可讀的錯誤代碼。

message

string

錯誤的可讀描述。

param

string

導致錯誤的參數的名稱(如果適用)。

type

string

錯誤類型識別碼(例如 invalid_request_error)。

AgentV1Error

代理 API 傳回的錯誤負載。

名稱 類型 Description
error

AgentErrorDetail

表示錯誤。

VectorStoreAutoChunkingStrategyRequest

預設策略。 此策略目前使用 800 和 400 chunk_overlap_tokens的max_chunk_size_tokens。

名稱 類型 Description
type string:

auto

物件類型。

VectorStoreAutoChunkingStrategyResponse

當區塊化策略未知時,就會傳回這個值。 一般而言,這是因為檔案是在 API 中引進chunking_strategy概念之前編製索引。

名稱 類型 Description
type string:

other

物件類型。

VectorStoreChunkingStrategyRequestType

分塊策略的類型

Description
auto
static

VectorStoreChunkingStrategyResponseType

分塊策略的類型

Description
other
static

VectorStoreDataSource

結構,包含 Azure 資產 URI 路徑,以及做為企業檔案搜尋數據源的檔案資產類型。

名稱 類型 Description
type

VectorStoreDataSourceAssetType

資產類型

uri

string

資產 URI。

VectorStoreDataSourceAssetType

向量存儲資產的類型。 資產類型可以是uri_asset,在這種情況下,它應包含資產 URI ID,在這種情況下,它應包含數據 ID id_asset。

Description
id_asset

數據ID

uri_asset

Azure URI

VectorStoreFile

附加至向量存放區之檔案的描述。

名稱 類型 Description
chunking_strategy VectorStoreChunkingStrategyResponse:

用來區塊檔案的策略。

created_at

integer (unixtime)

向量存放區檔案建立時的 Unix 時間戳記 (以秒為單位)。

id

string

識別碼,可在 API 端點中參考。

last_error

VectorStoreFileError

與此向量存放區檔案相關聯的最後一個錯誤。 如果沒有任何錯誤,則為 null

object enum:

vector_store.file

物件類型,一律為 vector_store.file

status

VectorStoreFileStatus

向量存放區檔案的狀態,可以是 in_progresscompletedcancelledfailed。 狀態為 completed 表示向量存放區檔案已可供使用。

usage_bytes

integer (int32)

向量存放區總使用量 (以位元組為單位)。 請注意,這可能與源檔大小不同。

vector_store_id

string

要附加檔案之向量存放區的識別碼。

VectorStoreFileError

處理此向量存放區檔案時可能發生之錯誤的詳細數據

名稱 類型 Description
code

VectorStoreFileErrorCode

server_errorrate_limit_exceeded 的其中之一。

message

string

人類看得懂的錯誤描述。

VectorStoreFileErrorCode

向量存儲檔處理的錯誤代碼變體

Description
invalid_file

檔無效。

server_error

發生伺服器錯誤。

unsupported_file

檔類型不受支援。

VectorStoreFileStatus

向量存儲文件狀態

Description
cancelled

檔已取消。

completed

檔已成功處理。

failed

檔處理失敗。

in_progress

當前正在處理該檔。

VectorStoreStaticChunkingStrategyOptions

設定向量存放區靜態區塊化策略的選項。

名稱 類型 Description
chunk_overlap_tokens

integer (int32)

區塊之間重疊的權杖數目。 預設值為 400。 請注意,重迭不得超過max_chunk_size_tokens的一半。

max_chunk_size_tokens

integer (int32)

minimum: 100
maximum: 4096

每個區塊中的權杖數目上限。 預設值為800。 最小值為 100,最大值為 4096。

VectorStoreStaticChunkingStrategyRequest

靜態設定的區塊化策略。

名稱 類型 Description
static

VectorStoreStaticChunkingStrategyOptions

靜態區塊化策略的選項。

type string:

static

物件類型。

VectorStoreStaticChunkingStrategyResponse

靜態設定的區塊化策略。

名稱 類型 Description
static

VectorStoreStaticChunkingStrategyOptions

靜態區塊化策略的選項。

type string:

static

物件類型。