Vector Stores - Create Vector Store
创建矢量存储。
POST {endpoint}/vector_stores?api-version=v1
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string (uri) |
项目端点,其形式为: https://.services.ai.azure.com/api/projects/ |
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
chunking_strategy | VectorStoreChunkingStrategyRequest: |
用于对文件进行分块的分块策略。 如果未设置,将使用自动策略。 仅当file_ids为非空时适用。 |
configuration |
从 Azure 资产 URI 创建矢量存储时使用的矢量存储配置。 |
|
expires_after |
有关此向量存储何时过期的详细信息 |
|
file_ids |
string[] |
矢量存储应使用的文件 ID 列表。 适用于可以访问文件的 |
metadata |
object |
一组最多可以附加到对象的 16 个键/值对,用于以结构化格式存储有关该对象的其他信息。 键长度可能最多为 64 个字符,值长度可能最多为 512 个字符。 |
name |
string |
矢量存储的名称。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
请求已成功。 |
|
Other Status Codes |
意外的错误响应。 |
安全性
OAuth2Auth
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
作用域
名称 | 说明 |
---|---|
https://ai.azure.com/.default |
示例
Vector |
Vector |
VectorStores_CreateVectorStore_MaximumSet
示例请求
POST {endpoint}/vector_stores?api-version=v1
{
"file_ids": [
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs",
"ftbzgxmtythuxbhs"
],
"name": "vidfcwh",
"configuration": {
"data_sources": [
{
"uri": "jtookuzhwojyylbips",
"type": "uri_asset"
}
]
},
"expires_after": {
"anchor": "last_active_at",
"days": 102
},
"chunking_strategy": {
"type": "VectorStoreChunkingStrategyRequest"
},
"metadata": {
"key3221": "kpsoqourrnirxgzrl"
}
}
示例响应
{
"id": "bxcw",
"object": "vector_store",
"created_at": 6,
"name": "nhjsetafmqp",
"usage_bytes": 9,
"file_counts": {
"in_progress": 14,
"completed": 21,
"failed": 12,
"cancelled": 1,
"total": 25
},
"status": "expired",
"expires_after": {
"anchor": "last_active_at",
"days": 102
},
"expires_at": 22,
"last_active_at": 14,
"metadata": {
"key1986": "qlxm"
}
}
VectorStores_CreateVectorStore_MinimumSet
示例请求
POST {endpoint}/vector_stores?api-version=v1
{}
示例响应
{
"id": "bxcw",
"object": "vector_store",
"created_at": 6,
"name": "nhjsetafmqp",
"usage_bytes": 9,
"file_counts": {
"in_progress": 14,
"completed": 21,
"failed": 12,
"cancelled": 1,
"total": 25
},
"status": "expired",
"last_active_at": 14,
"metadata": {}
}
定义
名称 | 说明 |
---|---|
Agent |
描述代理 API 返回的错误信息。 |
AgentV1Error |
代理 API 返回的错误负载。 |
Vector |
矢量存储是 |
Vector |
默认策略。 此策略目前使用的max_chunk_size_tokens为 800,chunk_overlap_tokens为 400。 |
Vector |
分块策略的类型 |
Vector |
矢量存储配置是数据源列表,当多个文件可用于企业文件搜索时使用。 |
Vector |
结构,包含 Azure 资产 URI 路径和用作企业文件搜索数据源的文件的资产类型。 |
Vector |
矢量存储资产的类型。 资产类型可以是uri_asset,在这种情况下,它应包含资产 URI ID,在这种情况下,它应包含数据 ID id_asset。 |
Vector |
矢量存储过期策略。 |
Vector |
描述此向量存储的天数与过期时间之间的关系 |
Vector |
此矢量存储按状态分组处理或正在处理的文件计数。 |
Vector |
用于创建向量存储的请求对象。 |
Vector |
配置矢量存储静态分块策略的选项。 |
Vector |
静态配置的分块策略。 |
Vector |
向量存储可能的状态 |
AgentErrorDetail
描述代理 API 返回的错误信息。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
机器可读的错误代码。 |
message |
string |
错误的可读描述。 |
param |
string |
导致错误的参数的名称(如果适用)。 |
type |
string |
错误类型标识符(例如 |
AgentV1Error
代理 API 返回的错误负载。
名称 | 类型 | 说明 |
---|---|---|
error |
表示错误。 |
VectorStore
矢量存储是 file_search
工具可以使用已处理文件的集合。
名称 | 类型 | 说明 |
---|---|---|
created_at |
integer (unixtime) |
创建矢量存储时的 Unix 时间戳(以秒为单位)。 |
expires_after |
有关此向量存储何时过期的详细信息 |
|
expires_at |
integer (unixtime) |
矢量存储将过期时的 Unix 时间戳(以秒为单位)。 |
file_counts |
文件计数按此矢量存储区处理或正在处理的状态分组。 |
|
id |
string |
可以在 API 终结点中引用的标识符。 |
last_active_at |
integer (unixtime) |
矢量存储上次活动时的 Unix 时间戳(以秒为单位)。 |
metadata |
object |
一组最多可以附加到对象的 16 个键/值对,用于以结构化格式存储有关该对象的其他信息。 键长度可能最多为 64 个字符,值长度可能最多为 512 个字符。 |
name |
string |
矢量存储的名称。 |
object |
enum:
vector_store |
对象类型,始终为 |
status |
矢量存储的状态,可以是 |
|
usage_bytes |
integer (int32) |
矢量存储区中文件使用的总字节数。 |
VectorStoreAutoChunkingStrategyRequest
默认策略。 此策略目前使用的max_chunk_size_tokens为 800,chunk_overlap_tokens为 400。
名称 | 类型 | 说明 |
---|---|---|
type |
string:
auto |
对象类型。 |
VectorStoreChunkingStrategyRequestType
分块策略的类型
值 | 说明 |
---|---|
auto | |
static |
VectorStoreConfiguration
矢量存储配置是数据源列表,当多个文件可用于企业文件搜索时使用。
名称 | 类型 | 说明 |
---|---|---|
data_sources |
数据源 |
VectorStoreDataSource
结构,包含 Azure 资产 URI 路径和用作企业文件搜索数据源的文件的资产类型。
名称 | 类型 | 说明 |
---|---|---|
type |
资产类型 |
|
uri |
string |
资产 URI。 |
VectorStoreDataSourceAssetType
矢量存储资产的类型。 资产类型可以是uri_asset,在这种情况下,它应包含资产 URI ID,在这种情况下,它应包含数据 ID id_asset。
值 | 说明 |
---|---|
id_asset |
数据 ID |
uri_asset |
Azure URI |
VectorStoreExpirationPolicy
矢量存储过期策略。
名称 | 类型 | 说明 |
---|---|---|
anchor |
定位点时间戳,在此时间之后会应用过期策略。 支持的定位点: |
|
days |
integer (int32) minimum: 1maximum: 365 |
定位点时间戳,在此时间之后会应用过期策略。 |
VectorStoreExpirationPolicyAnchor
描述此向量存储的天数与过期时间之间的关系
值 | 说明 |
---|---|
last_active_at |
过期策略基于向量存储上次处于活动状态的时间。 |
VectorStoreFileCount
此矢量存储按状态分组处理或正在处理的文件计数。
名称 | 类型 | 说明 |
---|---|---|
cancelled |
integer (int32) |
已取消的文件数。 |
completed |
integer (int32) |
已成功处理的文件数。 |
failed |
integer (int32) |
未能处理的文件数。 |
in_progress |
integer (int32) |
当前正在处理的文件数。 |
total |
integer (int32) |
文件总数。 |
VectorStoreOptions
用于创建向量存储的请求对象。
名称 | 类型 | 说明 |
---|---|---|
chunking_strategy | VectorStoreChunkingStrategyRequest: |
用于对文件进行分块的分块策略。 如果未设置,将使用自动策略。 仅当file_ids为非空时适用。 |
configuration |
从 Azure 资产 URI 创建矢量存储时使用的矢量存储配置。 |
|
expires_after |
有关此向量存储何时过期的详细信息 |
|
file_ids |
string[] |
矢量存储应使用的文件 ID 列表。 适用于可以访问文件的 |
metadata |
object |
一组最多可以附加到对象的 16 个键/值对,用于以结构化格式存储有关该对象的其他信息。 键长度可能最多为 64 个字符,值长度可能最多为 512 个字符。 |
name |
string |
矢量存储的名称。 |
VectorStoreStaticChunkingStrategyOptions
配置矢量存储静态分块策略的选项。
名称 | 类型 | 说明 |
---|---|---|
chunk_overlap_tokens |
integer (int32) |
区块之间重叠的标记数。 默认值为 400。 请注意,重叠不得超过max_chunk_size_tokens的一半。 |
max_chunk_size_tokens |
integer (int32) minimum: 100maximum: 4096 |
每个区块中的最大标记数。 默认值为 800。 最小值为 100,最大值为 4096。 |
VectorStoreStaticChunkingStrategyRequest
静态配置的分块策略。
名称 | 类型 | 说明 |
---|---|---|
static |
静态分块策略的选项。 |
|
type |
string:
static |
对象类型。 |
VectorStoreStatus
向量存储可能的状态
值 | 说明 |
---|---|
completed |
completed 状态指示此向量存储已准备就绪,可供使用。 |
expired |
expired status 表示此向量存储已过期,不再可用。 |
in_progress |
in_progress状态指示此矢量存储仍在处理文件。 |