Create Levels

POST

Create levels for given attribute(s) of an why_prompt.

Parameters:

  • req: LevelsRequest object containing:
    • why_prompt: The main concept or input question
    • country: Target country
    • attributes: List of attributes to generate levels for
    • level_count: Number of levels per attribute (optional)
    • llm_model: Language model to use (optional)

Returns:

  • List of attributes with their levels.

Example Response:

1[
2 {
3 "attribute": "Price",
4 "levels": [
5 "The car costs $30,000",
6 "The car costs $40,000",
7 "The car costs $50,000",
8 "The car costs $60,000",
9 "The car costs $70,000"
10 ]
11 },
12 {
13 "attribute": "Range",
14 "levels": [
15 "The car has a range of 200 miles",
16 "The car has a range of 300 miles",
17 "The car has a range of 400 miles",
18 "The car has a range of 500 miles"
19 ]
20 }
21]

Raises:

  • HTTPException 404: If an error occurs during creation

Request

This endpoint expects an object.
why_promptstringRequired
countrystringRequired
attributeslist of stringsRequired
level_countintegerOptional>=2<=10Defaults to 4
llm_modelenumOptionalDefaults to gpt4

Enum representing the llm model types used in the experiments.

Response

Successful Response

attributestring
levelslist of strings