AI Tests

Generate evaluator scenarios

Changed on

Starts background generation of evaluator scenarios for a test agent. Returns a progress ID to poll with the generate-scenarios-progress endpoint.

post/ai/tests/test_framework/v1/scenarios/generate-bg

Request

  • Base URL: https://api.telnyx.com/v2
  • URL: https://api.telnyx.com/v2/ai/tests/test_framework/v1/scenarios/generate-bg
  • Auth: HTTP bearer

Request body

num_scenariosinteger required

How many scenarios to generate.

agent_idinteger
extra_instructionsstring

Optional guidance steering scenario generation.

tagsstring[]
generate_expected_outcomesboolean

Whether to generate expected-outcome prompts for the scenarios.

first_messagestring
personalitiesinteger[]
test_profileinteger
scenario_type'workflow' | 'red_teaming_voice' | 'red_teaming_text'

Type of scenario to generate.

inbound_phone_numberinteger nullable
tool_idsstring[]
folder_pathstring nullable

Example request

{
  "num_scenarios": 5,
  "agent_id": 1259,
  "extra_instructions": "Focus on angry customers asking about refunds.",
  "scenario_type": "workflow",
  "generate_expected_outcomes": true
}

Response

Scenario generation initiated.

progress_idstring required

Identifier to poll generation progress with.

Example response

{
  "progress_id": "b7e4c1a2-3d4f-5a6b-8c9d-0e1f2a3b4c5d"
}

Changes