Zum Hauptinhalt springen
POST
/
openai
/
v1
/
rerank
Reranking erstellen
curl --request POST \
  --url https://api.highwayapi.ai/openai/v1/rerank \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "model": "<string>",
  "query": "<string>",
  "documents": [
    "<string>"
  ],
  "top_n": 123
}
'
{
  "id": "<string>",
  "results": [
    {
      "document": {
        "text": "<string>"
      },
      "index": 123,
      "relevance_score": 123
    }
  ],
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}
Reranking erstellen

Anfrageheader

Content-Type
string
erforderlich
Enumerationswert: application/json
Authorization
string
erforderlich
Bearer-Authentifizierungsformat: Bearer {{API Key}}.

Anfragetext

model
string
erforderlich
Name des zu verwendenden Modells.
query
string
erforderlich
Suchanfrage.
documents
string[]
erforderlich
Dokumentliste.
top_n
integer
Anzahl der relevantesten Dokumente oder Indizes, die zurückgegeben werden.

Antwortinformationen

id
string
erforderlich
ID
results
object[]
erforderlich
usage
object
Nutzungsstatistik der Token.