Skip to main content
POST
/
api
/
parea
/
v1
/
testcases
p = Parea(api_key="PAREA_API_KEY")  # replace with your API key

data = [
    {"problem": "1+2", "target": 3, "tags": ["easy"]},
    {"problem": "Solve the differential equation dy/dx = 3y.", "target": "y = c * e^(3x)", "tags": ["hard"]}
]

# this will add the new test cases to the existing "Math problems" dataset.
# New test cases must have the same columns as the existing dataset.
p.add_test_cases(data, name="Math problems")
const p = new Parea("PAREA_API_KEY"); // replace with your API key

const data = [
    { problem: '1+2', target: 3, tags: ['easy'] },
    { problem: 'Solve the differential equation dy/dx = 3y.', target: 'y = c * e^(3x)', tags: ['hard'] },
];

// this will add the new test cases to the existing "Math problems" dataset.
// New test cases must have the same columns as the existing dataset.
p.addTestCases(data, 'Math problems');
curl --location 'https://parea-ai-backend-us-9ac16cdbc7a7b006.onporter.run/api/parea/v1/testcases' \
--header 'Content-Type: application/json' \
--header 'x-api-key: PAREA_API_KEY' \
--data '{
  "name": "Math problems",
  "test_cases": [
    {
      "inputs": {
        "problem": "1+2"
      },
      "tags": [
        "easy"
      ],
      "target": "3"
    }
  ]
}'
[
  123
]
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
p = Parea(api_key="PAREA_API_KEY")  # replace with your API key

data = [
    {"problem": "1+2", "target": 3, "tags": ["easy"]},
    {"problem": "Solve the differential equation dy/dx = 3y.", "target": "y = c * e^(3x)", "tags": ["hard"]}
]

# this will add the new test cases to the existing "Math problems" dataset.
# New test cases must have the same columns as the existing dataset.
p.add_test_cases(data, name="Math problems")
const p = new Parea("PAREA_API_KEY"); // replace with your API key

const data = [
    { problem: '1+2', target: 3, tags: ['easy'] },
    { problem: 'Solve the differential equation dy/dx = 3y.', target: 'y = c * e^(3x)', tags: ['hard'] },
];

// this will add the new test cases to the existing "Math problems" dataset.
// New test cases must have the same columns as the existing dataset.
p.addTestCases(data, 'Math problems');
curl --location 'https://parea-ai-backend-us-9ac16cdbc7a7b006.onporter.run/api/parea/v1/testcases' \
--header 'Content-Type: application/json' \
--header 'x-api-key: PAREA_API_KEY' \
--data '{
  "name": "Math problems",
  "test_cases": [
    {
      "inputs": {
        "problem": "1+2"
      },
      "tags": [
        "easy"
      ],
      "target": "3"
    }
  ]
}'

Authorizations

x-user-id
string
header
required

Body

application/json
test_cases
TestCaseSchema · object[]
required

List of items which should be added to dataset.

id
integer | null

ID for the dataset/test case collection. Either ID or name is required to identify the dataset.

name
string | null

Name for the dataset/test case collection. Either ID or name is required to identify the dataset.

Response

Successful Response