嵌入
开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v2/text/embeddings
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v2/text/embeddings' \
--header 'Authorization;' \
--header 'content-type: application/json' \
--data-raw '{
"response_as_dict": true,
"attributes_as_list": false,
"show_original_response": false
}'
响应示例响应示例
200 - 成功示例
{
"cohere": {
"items": [
{
"embedding": [
3.8632812,
0.50927734,
2.2109375,
-0.8208008,
-0.1071167,
-0.22253418,
-0.5698242,
-0.4506836,
0.43188477,
0.97216797
]
}
]
},
"mistral": {
"items": [
{
"embedding": [
-0.0220947265625,
0.040863037109375,
0.055389404296875,
0.03546142578125,
0.025726318359375,
0.0357666015625,
0.01177978515625,
0.0309600830078125,
-0.0310211181640625,
-0.0284881591796875
]
}
]
},
"jina": {
"items": [
{
"embedding": [
-0.0047852774,
0.0048640342,
-0.01645707,
-0.024395779,
-0.017263541,
0.012512918,
-0.019191515,
0.009053908,
-0.010213212,
-0.026890801
]
}
]
},
"openai": {
"items": [
{
"embedding": [
-0.0047852774,
0.0048640342,
-0.01645707,
-0.024395779,
-0.017263541,
0.012512918,
-0.019191515,
0.009053908,
-0.010213212,
-0.026890801
]
}
]
},
"google": {
"items": [
{
"embedding": [
0.027175916358828545,
0.010277487337589264,
0.003436307655647397,
0.02837119624018669,
0.044907715171575546,
-0.016265053302049637,
0.010080956853926182,
0.002023588167503476,
-0.020589638501405716,
0.012744131498038769
]
},
{
"embedding": [
0.0001314455730607733,
0.015687013044953346,
-0.002990683540701866,
0.02059912495315075,
0.028040403500199318,
-0.01405489444732666,
0.042016930878162384,
0.013006427325308323,
-0.022377343848347664,
0.0183300469070673
]
}
]
}
}
请求参数
Header 参数
content-type
string
必需
示例值:
application/json
Authorization
string
必需
默认值:
Bearer <your_key>
Body 参数application/json
返回响应
修改于 2024-04-11 06:55:45