文档重排序
curl --request POST \
--url https://api.geminix.cc/v1/rerank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "rerank-english-v2.0",
"query": "<string>",
"documents": [
"<string>"
]
}
'import requests
url = "https://api.geminix.cc/v1/rerank"
payload = {
"model": "rerank-english-v2.0",
"query": "<string>",
"documents": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'rerank-english-v2.0', query: '<string>', documents: ['<string>']})
};
fetch('https://api.geminix.cc/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.geminix.cc/v1/rerank"
payload := strings.NewReader("{\n \"model\": \"rerank-english-v2.0\",\n \"query\": \"<string>\",\n \"documents\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"results": [
{
"index": 123,
"relevance_score": 123,
"document": {}
}
],
"meta": {}
}Rerank
文档重排序
根据查询对文档列表进行相关性重排序
POST
/
v1
/
rerank
文档重排序
curl --request POST \
--url https://api.geminix.cc/v1/rerank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "rerank-english-v2.0",
"query": "<string>",
"documents": [
"<string>"
]
}
'import requests
url = "https://api.geminix.cc/v1/rerank"
payload = {
"model": "rerank-english-v2.0",
"query": "<string>",
"documents": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'rerank-english-v2.0', query: '<string>', documents: ['<string>']})
};
fetch('https://api.geminix.cc/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.geminix.cc/v1/rerank"
payload := strings.NewReader("{\n \"model\": \"rerank-english-v2.0\",\n \"query\": \"<string>\",\n \"documents\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"results": [
{
"index": 123,
"relevance_score": 123,
"document": {}
}
],
"meta": {}
}授权
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
请求体
application/json
⌘I