Class NativeAPI.Responses
public static class NativeAPI.Responses
- Inheritance
-
objectNativeAPI.Responses
Methods
litert_lm_responses_delete(nint)
Destroys a LiteRT LM Responses object.
public static extern void litert_lm_responses_delete(nint responses)
Parameters
responsesnintThe responses to destroy.
litert_lm_responses_get_num_candidates(nint)
Returns the number of response candidates.
public static extern int litert_lm_responses_get_num_candidates(nint responses)
Parameters
responsesnintThe responses object.
Returns
- int
The number of candidates.
litert_lm_responses_get_num_token_scores_at(nint, int)
Returns the number of tokens for which scores are present at a given index.
public static extern int litert_lm_responses_get_num_token_scores_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.
Returns
- int
The number of token scores. Returns 0 if index is out of bounds or no token scores are present.
litert_lm_responses_get_response_text_at(nint, int)
Returns the response text at a given index.
public static extern nint litert_lm_responses_get_response_text_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.
Returns
- nint
The response text. The returned string is owned by the Responses object and is valid only for its lifetime. Returns nint.Zero if index is out of bounds.
litert_lm_responses_get_score_at(nint, int)
Returns the score at a given index.
public static extern float litert_lm_responses_get_score_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.
Returns
- float
The score. Returns 0.0f if index is out of bounds or no score is present.
litert_lm_responses_get_token_length_at(nint, int)
Returns the token length at a given index.
public static extern int litert_lm_responses_get_token_length_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.
Returns
- int
The token length. Returns 0 if index is out of bounds or no token length is present.
litert_lm_responses_get_token_scores_at(nint, int)
Returns the token scores at a given index.
public static extern nint litert_lm_responses_get_token_scores_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.
Returns
- nint
A pointer to the internal array of token scores. Returns nint.Zero if index is out of bounds or no token scores are present.
litert_lm_responses_has_score_at(nint, int)
Returns whether the response contains a score at the given index.
public static extern bool litert_lm_responses_has_score_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.
Returns
litert_lm_responses_has_token_length_at(nint, int)
Returns whether the response contains a token length at the given index.
public static extern bool litert_lm_responses_has_token_length_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.
Returns
litert_lm_responses_has_token_scores_at(nint, int)
Returns whether the response contains token scores at the given index.
public static extern bool litert_lm_responses_has_token_scores_at(nint responses, int index)
Parameters
responsesnintThe responses object.
indexintThe index of the response.