v2

latestOpenAPI 3.1.02026-08-05267431678.1 KB
generate

Label Existing Classification

Label existing texts for classification tasks.

Args: request: Classification labeling request with texts and labels. auth: Authenticated user context.

Returns: GenerateResponse with classified samples and optional dataset info.

Raises: HTTPException: 400 if no valid inputs or dataset validation fails. HTTPException: 500 on labeling failure.

post/generate/classification/label-existing

Request body

user_idstring nullable

User ID (optional, uses authenticated user if not provided)

labelsstring[] required

List of classification labels

inputsstring[] required

List of texts to label

domain_descriptionstring nullable

Domain description for generation context

seedinteger nullable

Random seed for reproducibility

class_balanceobject nullable

Optional class distribution (must sum to 1.0)

session_idstring nullable

Session ID for log streaming

config_num_examplesinteger

Number of examples to generate for config

temperaturenumber

Generation temperature

batch_sizeinteger

Number of samples to generate per API call

multi_labelboolean

Enable multi-label classification (samples can have multiple labels)

save_datasetboolean

Save generated dataset to S3 and database

dataset_namestring nullable

Name for the saved dataset (required if save_dataset=True)

project_idstring uuid nullable

Project ID to assign the dataset to

Response

Successful Response

successboolean required
dataobject[] required
countinteger required
task_typestring required
token_usageinteger nullable

Estimated tokens used for generation

datasetobject nullable

Dataset info if saved to S3/database