from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.classify.classify(model="meetkai:functionary-urdu-mini-pak", text="I absolutely love this product! Best purchase ever.", labels=[
"positive",
"negative",
"neutral",
])
# Handle response
print(res){
"success": true,
"data": {
"label": "positive",
"confidence": 0.92,
"reasoning": "The text expresses strong enthusiasm with phrases like 'absolutely love' and 'best purchase ever'."
},
"metadata": {
"model": "meetkai:functionary-urdu-mini-pak",
"labels": [
"positive",
"negative",
"neutral"
],
"classifiedAt": "2024-01-15T10:30:00Z"
}
}Classifies text content into one of the provided predefined labels.
from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.classify.classify(model="meetkai:functionary-urdu-mini-pak", text="I absolutely love this product! Best purchase ever.", labels=[
"positive",
"negative",
"neutral",
])
# Handle response
print(res){
"success": true,
"data": {
"label": "positive",
"confidence": 0.92,
"reasoning": "The text expresses strong enthusiasm with phrases like 'absolutely love' and 'best purchase ever'."
},
"metadata": {
"model": "meetkai:functionary-urdu-mini-pak",
"labels": [
"positive",
"negative",
"neutral"
],
"classifiedAt": "2024-01-15T10:30:00Z"
}
}Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Request parameters for text classification. The model will analyze the text and assign it to one of the provided labels.
ID of the model to use for classification. You can use provider:model format or just the model name with a default provider.
1The text content to classify. Must not be empty.
1Array of possible classification labels. Must contain at least 2 labels. The model will choose one of these labels to assign to the text.
21Optional custom system prompt to guide the classification. Use this to provide additional context or instructions to the model about how to perform the classification.
OK
Response from the text classification endpoint containing the classification result, confidence, and metadata.
Was this page helpful?