name: Generative Form (Slot Filling)
prompt: |
  You are an expert virtual agent developer. A basic CXAS app shell has been provided in the `generative_form/` folder.
  Your goal is to implement a generative form (slot filling) agent that collects user information before calling a CRM tool.

  1. The root agent `root_agent` must collect both an email and an order ID from the user.
  2. Use the `Toolset_CRM` toolset with operation `retrieve_account`.
  3. Bind `Toolset_CRM` to the playbook (ensure `Toolset_CRM` is listed in `root_agent.json` under `toolsets`).
  4. In `agents/root_agent/instruction.txt`, provide the instructions in the exact CXAS XML format required by the linter:
      <role>You are a customer service assistant.</role>
      <persona>Helpful and concise.</persona>
      <taskflow>
        <subtask name="Check_Order_Status">
          <step>Collect both the email and order ID from the user. Once both are captured, call retrieve_account from Toolset_CRM.</step>
        </subtask>
      </taskflow>
  5. Deploy your local changes to the CXAS platform using `cxas push --project-id {project_id} --location us`. (If prompted for confirmation or hanging, use `python3 -c "import subprocess; subprocess.run(['cxas', 'push', '--project-id', '{project_id}', '--location', 'us'], cwd='generative_form', input='y\n', text=True)"`).
  6. Verify the following interaction using a Python script with `cxas_scrapi` or `cxas run-session` to avoid TTY errors:
     - User: "I want to check my order status."
     - Agent asks for email.
     - User: "customer@google.com"
     - Agent asks for order ID.
     - User: "ID-999"
     - Expectations: A single tool call for `Toolset_CRM_retrieve_account` with `email="customer@google.com"` and `order_id="ID-999"`.
rubric:
- criteria: OpenAPI Toolset Setup
  perfect: |
    The `Toolset_CRM` is correctly configured with the `retrieve_account` operation in `open_api_schema.yaml`, including both `email` and `order_id` as required parameters.
  failed: |
    The toolset is missing or parameters are incorrectly defined.
- criteria: Instruction Compliance
  perfect: |
    The `root_agent` instructions explicitly state: "Collect both the email and order ID from the user. Once both are captured, call retrieve_account."
  failed: |
    The instructions are missing or do not specify the correct collection and tool calling logic.
- criteria: Interaction Assertions
  perfect: |
    The agent successfully performs the multi-turn interaction, collecting both parameters and executing the `Toolset_CRM_retrieve_account` tool with the correct values.
  failed: |
    The agent fails to collect parameters, calls the tool prematurely, or uses incorrect values.
assets:
- generative_form
