Skip to main content

🔘 Select

Use the Select endpoint to select candidates with respect to a reference according to text likelihood.

Available at

💸️ Pricing

Pricing for the Understand endpoints is not final, values returned by cost and total_cost are placeholders.


curl -X 'POST' \  '' \  -H 'Content-Type: application/json' \  -H 'Accept: application/json' \  -H 'X-API-KEY: YOUR_API_KEY' \  -H 'X-Model: orion-fr' \  -d '{"reference": "Je suis content", "candidates": ["je suis heureux", "je suis triste"]}'
Response (JSON)
{   "request_id":"1412bac9-2caf-4165-9d6c-db09101a3f60",   "outputs":[      [         {            "reference": "Je suis content"            "rankings":[               {                  "text": "je suis heureux",                  "score":-7.755064308643341,                  "normalized_score":-2.585021436214447,                  "token_scores": [{"Ġje": -4.135122776031494},                                   {"Ġsuis": -0.8857746720314026},                                                                     {"Ġheureux":-2.7341668605804443}]}                  },               {                  "text": "je suis triste",                  "score":-11.674759447574615,                  "normalized_score":-3.891586482524872,                  "token_scores": [{"Ġje": -4.135122776031494},                                   {"Ġsuis": -0.8857746720314026},                                                                     {"Ġtriste":-6.653861999511719}]}                  }             ]                               "execution_metadata":{                     "cost":2                  }               }            ]      ],   "total_cost":2}


reference string ⚠️ required#

The reference input to compute likelihood against.

candidates array[string] ⚠️ required#

The input(s) that are compared to the reference and ranked based on likelihood.

conjunction string ""#

Expression used to link reference and candidates to create the prompt used to compute the likelihood. The prompt will have the structure reference+conjunction+candidate. Finding a good conjunction can greatly increase the performance of select.

concat_best boolean false#

If true the response will contain a "best" field with the selected choice.

Response (outputs)#

An array of outputs shaped like your batch.

reference string#

The reference sentence used to compute similarities.

Rankings (rankings)#

One entry for each member of candidates.

text string#

A single entry from the candidates sent in the request.

score float#

Log-likelihood score computed on the concatenation of reference, conjunction and candidate. Closer to zero means more likely.

normalized_score float#

Score normalized by the length in tokens. Closer to zero means more likely.

token_scores array[string:float]#

List of tokens of the candidate with associated likelihood scores.

best string#

Best choice selected among the candidates in terms of likelihood.