Skip to main content

πŸ”˜ Select

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

Available at https://api.lighton.ai/muse/v1/select.

πŸ’ΈοΈ Pricing

You will be billed for the total number of tokens sent in your request.

Example​

curl -X 'POST' \
'https://api.lighton.ai/muse/v1/select' \
-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": "1f19c4d1-47f2-4c96-a8d2-314e6ed3a341",
"outputs": [
[
{
"reference": "Je suis content",
"rankings": [
{
"text": "je suis heureux",
"score": {
"logprob": -16.361328125,
"normalized_logprob": -5.453776041666667,
"token_logprobs": [
{ " je": -10.3984375 },
{ " suis": -1.638671875 },
{ " heureux": -4.32421875 }
]
}
},
{
"text": "je suis triste",
"score": {
"logprob": -20.466796875,
"normalized_logprob": -6.822265625,
"token_logprobs": [
{ " je": -10.3984375 },
{ " suis": -1.638671875 },
{ " triste": -8.4296875 }
]
}
}
],
"best": "je suis heureux",
"execution_metadata": {
"cost": {
"tokens_used": 10,
"tokens_input": 10,
"tokens_generated": 0,
"cost_type": "orion-fr@default",
"batch_size": 2
},
"finish_reason": "length"
}
}
]
],
"costs": {
"orion-fr@default": {
"total_tokens_used": 10,
"total_tokens_input": 10,
"total_tokens_generated": 0,
"batch_size": 2
}
}
}

Parameters​

  • 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 true

    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 array[object]

    One entry for each member of candidates.

    • text string

      A single entry from the candidates sent in the request.

    • score Score

      A Score structure

    • best string

      Best choice selected among the candidates in terms of likelihood.

  • best string

    The best match.

  • execution_metadata ExecutionMetadata

    An Execution metadata structure.

βš™οΈ Token representations

Tokens are currently returned as they are represented by the tokenizer, which includes special characters such as Δ  for spaces and possible encoding oddities (such as é for Γ©).