Use APIs to Evaluate a GPT Agent

This guide describes how to use APIs to evaluate a multi-turn GPT Agent. Follow the instructions below and check out our example GPT Agent configurations to understand how to use our APIs to evaluate your own GPT Agent.


 

Cookbook Scenario

You are an AI builder who wants to test out your GPT Agent before actual users (e.g., callers) interact with it.

 

Use Case

You've built a GPT Agent for a medical device company to confirm the user's intent. This is the first interaction and they might be experiencing a serious emergency that requires escalation, so it’s critical to ensure the agent functions as expected and directs calls when appropriate.

To make sure your agent works as intended, testing is critical. Using the evaluation APIs helps you quickly and effectively test your agent, obtain concrete metrics on your agent’s performance, and identify any potential gaps that should be addressed before real-life callers start interacting with the agent.

 

Before You Begin

Prior to using the evaluation APIs you need to have a few things in place:

  • Your agent should be created in the AI Studio and it must be in “published” status.

  • Under the customer account you want use the API endpoints with, you must have a user created with API access. Check out this page for more information about setting up a user with API access.

  • You must obtain a JWT Bearer token.

  • We recommend having a Postman account set up to execute the requests below.

 

Build Your Agent

We're going to be testing a simple GPT Agent for medical calls.

  1. From the Agents page of the AI Studio, click + New Agent above the table. The Create New Agent page appears.

  2. Fill in all of the details about your agent.

    • Agent Name: Give your agent a unique and descriptive name. For our agent we'll use "Medical Device Intent Agent".

    • Type: “GPT” is already selected by default.

    • Template: If you have previously created a template it will appear in the drop-down list, and you can select the appropriate one for your agent. Otherwise, you can leave this field with the default ("No Template").

    • Model: Select “GPT 4o-mini”.

    • Groups: If you previously defined AI Workflow Groups they will appear in the drop-down list, and you can select the group(s) you want to associate this agent with. For this example, we’ll leave the field blank.

    • Description: Provide a helpful, descriptive blurb about your agent. For this agent we'll use: "Intent (HMIHY?) agent for a medical device company. This agent determines why a user is calling and checks if experiencing an emergency. Depending on the user's answer, the call can be routed/escalated".

    • Click the Behavior & Settings section to view the subsections:

      • System Prompt: Instructions for your agent to guide responses. Include the context for what the agent is doing, instructions for the agent, style or personality for responses, etc.

        • For our agent, we'll use the prompt below.

      • User Prompt: The message the agent is responding to. We’ll leave this with the default text.

      • Special Instructions: Instructions that the agent should follow for every response. We’ll leave this section blank.

      • Tools: Include a function to enable your agent to perform a subsequent action based on a user’s response.

        • For our agent, we'll use the tools below.

      • Parameters: LLM and workflow settings. We will keep the default values in this section.

  3. Click Create Agent.

We recommend reviewing all of your settings to make sure everything is correctly saved and captured. Any formatting or spelling errors, especially in the Behavior & Settings section, should be updated before you continue. For example, an error in the Tools section could cause your agent not to function as expected.

Once you're happy with your agent configurations you can manually test your agent through some live tests.

 

Publish Your Agent

Note: Your agent must be published before you call the evaluation APIs.

If your draft agent is ready to publish:

  1. From the AI Studio Agents page, find your agent.

  2. Click the options icon on the far right of the agent tile.

  3. Click Publish from the drop-down menu.

  4. A confirmation pop-up appears. Click Publish Agent to confirm your update.

 

Example GPT Agent

Portal Environment: Production Customer Portal

Account: IntelePeer Cookbook Collection

Agent: "Medical Device Intent Agent"

 

Example System Prompt

# Personality and Introduction
You are {arg_agent_name}, {arg_business_name}’s Virtual Assistant. You have a friendly, helpful, and laid-back personality. Today’s date is {arg_day_of_week}, {arg_today_date} and the current time is {arg_current_time}. Try to always read days of the week as full words, not abbreviations. Your tone will be kind, helpful, and jovial.

# Defining primary objective, tasks and capabilities
Your primary objective is to determine the user’s intent based on the context of their input. It must align within the industry of medical and healthcare. You are not responsible for collecting any of the user's personal information.
Do not include markdown in your responses.
If the caller ever answers your question of "Is there anything else I can assist you with today?" with any form of no, immediately use "end_call".
### If during your interaction you have to ask a question more than once, use the 'transfer_to_agent' tool under 'Max Attempts' reasons to connect them to an agent who can help them further and include in 'transfer_reason' a short summary of the interaction.

# Instructions on Behavior
These are the steps you need to follow during this conversation. Ensure you are strictly following the required steps below.
## Step 1 (Required)
Greet the user, introduce yourself, inform them this call may be recorded to help keep us improving, and ask them how you can be of service.
## Step 2 (Required)
**IMMEDIATELY** select the intent of the call and call the appropriate tool.

# Intent-Prioritization Rules
When analyzing any user message, you may detect more than one valid 'intent'.
Always respond with **exactly one** tool call by following the priority ladder below as higher items outrank lower ones.
If two 'intents' fall in the same tier, pick the intent that is referenced *more explicitly* or *earlier* in the user’s text.
Never attempt to satisfy multiple intents in a single turn.

## Priority Ladder
1. **New Appointment** – User needs to schedule an appointment
2.  All Other Intents – Any other intents derived.

# Available Tools

## intent
When to Call:
- User mentions the need to schedule an appointment ("Scheduling").
- User needs to reschedule  or move/change an appointment ("Scheduling").
- User needs to cancel an appointment ("Scheduling").
- User needs anything related to billing and finance ("Billing").
- User needs anything related to medical records or patient records ("Records").
- User needs anything related to pharmacy or medication ("Prescriptions").
- User asks a general question, this is not related to injuries/trauma ("FAQ").
- Any intent not listed above ("Other").

## transfer_to_agent
When to Call:
- User explicitly wants a human (“Agent Requested”).
- After two failed attempts to gather information ("Max Attempts").

Parameters:
- transfer_reason: One of the above reasons.
- transfer_to: Where to route (e.g., “General”).
- max_attempt_reason: when a user needs to speak to an agent for 'Max Attempts', provide the reason for the max attempts.

Example Tools

[
	{
		"type": "function",
		"function": {
			"name": "intent",
			"description": "Triggers when you determine the user's intent based on their responses that fit into the specified categories. Use any available categories prior to selecting 'Other'.",
			"parameters": {
				"type": "object",
				"properties": {
					"intent": {
						"type": "string",
						"enum": [
							"Scheduling",
							"Billing",
							"FAQ",
							"Prescriptions",
							"Records",
							"Other"
						],
						"description": "The user's intent for interacting with the system."
					},
					"requested_appt": {
						"type": "string",
						"description": "Do not ask the user for an appointment date. Only store data if the user provides a date in the interaction or mentions they need an appointment as soon as possible. If date is derived, use this format YYYY-MM_DD. If they need it as soon as possible, store First Available as the value. If appointment date is not provided, do not return this field."
					},
					"intent_summary": {
						"type": "string",
						"description": "A summary of the user's interaction and key points discussed. Include any and all important information."
					}
				},
				"required": [
					"intent",
					"intent_summary"
				]
			}
		}
	},
	{
		"type": "function",
		"function": {
			"name": "end_call",
			"description": "This condition is achieved when the caller indicates they no longer need any help or assistance, says goodbye, indicates they are done with the conversation, or uses a phrase like: that's it, no that's it, that's it thank you, goodbye, bye",
			"parameters": {
				"type": "object",
				"properties": {
					"call_summary": {
						"type": "string",
						"description": "Summarize the caller's intent in a few words"
					},
					"bye_message": {
						"type": "string",
						"description": "This will be a simple good bye message thanking you the user for calling {arg_business_name}, and telling them to have a nice day"
					}
				},
				"required": [
					"call_summary",
					"bye_message"
				]
			}
		}
	},
	{
		"type": "function",
		"function": {
			"name": "transfer_to_agent",
			"description": "You MUST call this function every time you get one of the following: Select 'Agent Requested' when the user wants to speak to a human. Select 'Max Attempts' when you have made at leats two attempts for a given task",
			"parameters": {
				"type": "object",
				"properties": {
					"transfer_reason": {
						"type": "string",
						"enum": [
							"Agent Requested",
							"Max Attempts"
						],
						"description": "Select 'Agent Requested' when the user wants to speak to a human. Select 'Max Attempts' when you have made at least two attempts for a given task."
					},
					"transfer_to": {
						"type": "string",
						"enum": [
							"General"
						],
						"description": "For all reasons, select 'General'."
					},
					"transfer_number": {
						"type": "string",
						"enum": [
							"1234567890"
						],
						"description": "For all reasons, select '1234567890' for 'General'."
					},
					"transfer_message": {
						"type": "string",
						"description": "Advise the user one moment while you connect them with a team member who can help them with their 'transfer_reason'."
					}
				},
				"required": [
					"transfer_reason",
					"transfer_to",
					"transfer_number",
					"transfer_message"
				]
			}
		}
	}
] 

 

Evaluation APIs

Using the evaluation APIs allows you to measure your agent’s performance at a larger scale and faster pace than could be accomplished manually.

Evaluating your agent follows the general steps below:

  • Design an input file

    • The evaluation data set. Think of this as a collection of test cases.

  • Upload your file

    • Must be in JSON format.

  • Create a task

    • Your testing configuration. Once a task is initially created, you can come back to it again and again to test new iterations of your agent.

  • Run the task

    • Kicks off and executes the evaluation.

  • Capture test metrics

    • Return import evaluation metrics.

  • Download your output files

    • Generate output files of your test results, analysis, and debug details.

  • Review your agent's performance

    • Understand what the evaluation metrics mean and if they are acceptable, or if you have to update your agent configurations.

 

Create an Input File

An input file contains sample inputs and expected output required to test your agent’s performance. Within the input file you can include various test cases or iterations of anticipated inquiries, along with how you expect the agent to respond (via either a message or tool call).

You can create the input file manually or use a tool like Cursor to create one for you.

Your file must:

  • Be in JSON format.

  • Contain either:

    • The following three attributes:

      • input: A collection of messages.

      • expected_ai_response: The response we expect the agent to provide to the user.

      • expected_tool_call_output: The attributes(s), value(s), and function expected to be associated with the interaction and the function.

    • OR: you can provide a file with only the input.

      • The system then automatically fills in the other two required columns (expected_ai_response and expected_tool_call_output).

We recommend including as many possible scenarios in the input section as possible. This will ensure your test is exhaustive and the results are reliable. In general, at least 100 test cases is a good rule of thumb.

If your agent includes arguments, we recommend creating unique test cases for your flow arguments to test different conditions. For example, when the business is open vs. closed, appointments available vs. none listed, etc.

Try to imagine all the ways a user might interact with your agent. For example, someone might begin the interaction by just saying "hi" or any variation of a greeting, simply making a statement ("help, I've fallen and I can't get up!"), etc.

Note: Make sure your input file includes primer messages (e.g., “hi” or “hello”) to kick off the interaction in all of your test cases.

Sample Input File

For our GPT agent we want to review the performance of multi-turn interactions.

To use the following endpoints, make sure your file is in JSON format. You can use a tool like Cursor to create a file for you (or convert an existing file to JSON).

Our JSON input file looks like this:

Note: We've only included the first two use cases from our input file. Your file should include many more test cases and will likely be much longer.

{
	"test_cases": [
		{
			"test_case_id": "medical_scheduling_new_001",
			"description": "User wants to schedule a new appointment",
			"input": [
				{
					"role": "user",
					"content": "Hi"
				},
				{
					"role": "assistant",
					"content": "Hello, this is your virtual assistant. This call may be recorded to help us improve. How can I be of service today?"
				},
				{
					"role": "user",
					"content": "I need to schedule an appointment"
				}
			],
			"expected_ai_response": "",
			"expected_tool_calls": [
				{
					"function_name": "intent",
					"arguments": {
						"intent": "Scheduling",
						"intent_summary": "User needs to schedule a new appointment."
					}
				}
			],
			"flow_args": {}
		},
		{
			"test_case_id": "medical_scheduling_reschedule_001",
			"description": "User wants to reschedule an appointment",
			"input": [
				{
					"role": "user",
					"content": "Hello"
				},
				{
					"role": "assistant",
					"content": "Hello, this is your virtual assistant. This call may be recorded to help us improve. How can I be of service today?"
				},
				{
					"role": "user",
					"content": "I need to reschedule my appointment for next week"
				}
			],
			"expected_ai_response": "",
			"expected_tool_calls": [
				{
					"function_name": "intent",
					"arguments": {
						"intent": "Scheduling",
						"intent_summary": "User needs to reschedule their appointment for next week."
					}
				}
			],
			"flow_args": {}
		}
	]
}

Upload File

Add your JSON input file via the Upload File with Format Detection endpoint so the evaluation can be run against it.

 

Production Endpoint: POST https://aiservice.intelepeer.com/aitask/v3/files/upload/{file_type}

  • Remember to add the file_type and customer_id query parameters, and your file to the body.

    Note: Your file must be in JSON format and we recommend using "input" as your file_type.

 

Sample Request

POST https://aiservice.intelepeer.com/aitask/v3/files/upload/input?customer_id=1105739

Your file_type should be “input”.

To add your file in the body via Postman, we recommend clicking the form-data radio button (switching from the default option raw). You can then type “file” in the Key field, and select File from the drop-down list on the right. In the Value field, navigate to your JSON file to add it.

 

Sample Response

{
	"message": "Successfully uploaded!",
	"input_location": "2026/1/26/20_34_26_840233_multiturn-eval-input.json",
	"detected_format": "json",
	"original_filename": "multiturn-eval-input.json"
} 

Remember to make note of the input_location for future API calls.

 

Create a New Task

Create a new testing task via the Create New Agent Eval Task endpoint.

 

Production Endpoint: POST https://aiservice.intelepeer.com/aitask/v3/tasks

  • Remember to add the customer_id query parameter, and the name and description to the body.

  • We recommend including your settings parameters in the body now. You can always update the task and add the settings in later, but adding them now ensures the input file is associated with your task as expected.

 

Sample Request

POST https://aiservice.intelepeer.com/aitask/v3/tasks?customer_id=1105739

  • name: Give your task a unique and descriptive title.

  • description: Provide a helpful blurb about your task.

  • settings:

    • agent_id: This id can be found on the AI Studio Agents page under the Name of your agent.

    • target_customer_id: Your customer_id.

    • input_location: The location of your JSON input file from the previous endpoint response.

    • environment: The environment your agent is built in. You can use “staging”, “qa”, or “prod”.

    • sleep: How long you want to pause (in seconds) between sending each test case for evaluation.

    • iteration: How many times you want to run each of your test cases. For example, if set iteration to 10, each test case would be run ten times to see if the response is the same each time.

    • flow_args: if your agent doesn't have defined arguments you can leave this field empty. But if arguments are included in your agent configuration you must include them here. For example, in our agent we have the {arg_agent_name}, {arg_business_name}, {arg_day_of_week}, {arg_today_date}, and {arg_current_time}.

      Note: You can include your arguments in the settings section here, or within your input file.

 

{
	"name": "Intents Test Task",
	"description": "Test task created for intent detection in multiturn interactions",
	"settings": {
		"agent_id": "6977ac413f56ffcc3c457348",
		"target_customer_id": "1105739",
		"input_location": "2026/1/26/20_34_26_840233_multiturn-eval-input.json",
		"environment": "prod",
		"sleep": "1",
		"iteration": "1",
		"flow_args": {
			"arg_agent_name": "Grace",
			"arg_business_name": "Med Supply Co.",
			"arg_day_of_week": "Monday",
			"arg_today_date": "2026/1/26",
			"arg_current-time": "14:00"
		}
	}
}

 

Sample Response

{
	"task_id": "0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval",
	"name": "Intents Test Task",
	"description": "Test task created for intent detection in multiturn interactions",
	"type": "agent_eval",
	"settings": {
		"agent_id": "6977ac413f56ffcc3c457348",
		"target_customer_id": "1105739",
		"environment": "prod",
		"input_location": "2026/1/26/20_34_26_840233_multiturn-eval-input.json",
		"sleep": 1.0,
		"iteration": 1,
		"flow_args": {
			"arg_agent_name": "Grace",
			"arg_business_name": "Med Supply Co.",
			"arg_day_of_week": "Monday",
			"arg_today_date": "2026/1/26",
			"arg_current-time": "14:00"
		}
	},
	"customer_id": "1105739",
	"created_by": "system",
	"created_date": "2026-01-26T20:42:09.205253Z",
	"modified_by": null,
	"modified_date": "2026-01-26T20:42:09.205253Z"
}

Remember to make note of the task_id for the APIs calls below.

 

Run Your Task

Initiate your test task via the Execute Agent Eval Task endpoint.

 

Production Endpoint: POST https://aiservice.intelepeer.com/aitask/v3/tasks/{task_id}/runs

  • Capture the task_id from the previous API call.

  • Remember to add the customer_id query parameter and the settings to the body.

    • The agent_id can be found on the AI Studio Agents page under the Name of your agent.

    • The target_customer_id is the same as your customer id.

    • The environment must match the environment your agent was created in.

 

Sample Request

POST https://aiservice.intelepeer.com/aitask/v3/tasks/0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval/runs?customer_id=1105739

  • name: The same task name from the previous endpoint.

  • description: The same description from the previous endpoint.

  • settings:

    • agent_id: The id found on the AI Studio Agents page under the Name of your agent.

    • target_customer_id: Your customer_id.

    • input_location: The location of your JSON input file from the previous endpoint.

    • environment: The environment your agent is built in.

{
	"name": "Intents Test Task",
	"description": "Test task created for intent detection in multiturn interactions",
	"settings": {
		"agent_id": "6977ac413f56ffcc3c457348",
		"target_customer_id": "1105739",
		"input_location": "2026/1/26/20_34_26_840233_multiturn-eval-input.json",
		"environment": "prod"
	}
}

 

Sample Response

{
	"run_id": "1769460249",
	"task_id": "0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval",
	"description": "Test task created for intent detection in multiturn interactions",
	"settings": {
		"agent_id": "6977ac413f56ffcc3c457348",
		"target_customer_id": "1105739",
		"environment": "prod",
		"input_location": "2026/1/26/20_34_26_840233_multiturn-eval-input.json"
	},
	"status": "created",
	"output": {},
	"messages": [],
	"customer_id": "1105739",
	"created_by": "system",
	"created_date": "2026-01-26T20:44:09.524049Z",
	"metadata": {
		"api_version": "v3",
		"task_type": "AGENT_EVAL",
		"processing_method": "v3_json",
		"input_format": "json",
		"test_cases_count": 71
	}
}

Remember to make note of the run_id for the next API call.

 

Collect Your Metrics

Capture the test metrics with the Get Task Run Details endpoint.

 

Production Endpoint: GET https://aiservice.intelepeer.com/aitask/v3/runs/{run_id}

  • Capture the task_id and run_id from the previous API calls.

  • Remember to add the customer_id query parameter.

 

Sample Request

GET https://aiservice.intelepeer.com/aitask/v3/runs/1769460249?customer_id=1105739&task_id=0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval

 

Sample Response

{
	"run_id": "1769460249",
	"task_id": "0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval",
	"customer_id": "1105739",
	"status": "finished",
	"output": {
		"files": [
			"1105739/task_output/2026/1/26/0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval/1769460249/test_results.json",
			"1105739/task_output/2026/1/26/0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval/1769460249/iteration_analysis.json",
			"1105739/task_output/2026/1/26/0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval/1769460249/debug_details.json"
		],
		"summary": {
			"total_conversations": 71,
			"successful_conversations": 71,
			"total_turns": 213,
			"successful_turns": 213,
			"average_conversation_score": 0.9,
			"overall_response_accuracy": 0.9,
			"overall_tool_call_accuracy": 0.9,
			"overall_intent_accuracy": 1.0,
			"overall_entity_accuracy": 0.9,
			"execution_time_seconds": 79.879136,
			"success_rate": 1.0,
			"iteration_metrics": {
				"total_executions": 71,
				"successful_executions": 71,
				"failed_executions": 0,
				"success_rate": 1.0,
				"average_consistency_score": 1.0
			},
			"consistency_analysis": {
				"low_consistency_tests": [],
				"high_consistency_tests": 71,
				"threshold": 0.7
			},
			"per_test_case_consistency": {
				"test_confirmation_001": 1.0,
				"test_confirmation_002": 1.0,
				"test_confirmation_003": 1.0,
				"test_confirmation_004": 1.0,
				"test_confirmation_005": 1.0,
				"test_confirmation_006": 1.0,
				"test_confirmation_007": 1.0,
				"test_confirmation_008": 1.0,
				"test_confirmation_009": 1.0,
				"test_confirmation_010": 1.0,
				"test_confirmation_011": 1.0,
				"test_confirmation_012": 1.0,
				"test_confirmation_013": 1.0,
				"test_confirmation_014": 1.0,
				"test_confirmation_015": 1.0,
				"test_confirmation_016": 1.0,
				"test_confirmation_017": 1.0,
				"test_confirmation_018": 1.0,
				"test_confirmation_019": 1.0,
				"test_confirmation_020": 1.0,
				"test_confirmation_021": 1.0,
				"test_confirmation_022": 1.0,
				"test_confirmation_023": 1.0,
				"test_confirmation_024": 1.0,
				"test_confirmation_025": 1.0,
				"test_confirmation_026": 1.0,
				"test_confirmation_027": 1.0,
				"test_confirmation_028": 1.0,
				"test_confirmation_029": 1.0,
				"test_confirmation_030": 1.0,
				"test_confirmation_031": 1.0,
				"test_confirmation_032": 1.0,
				"test_confirmation_033": 1.0,
				"test_confirmation_034": 1.0,
				"test_confirmation_035": 1.0,
				"test_confirmation_036": 1.0,
				"test_confirmation_037": 1.0,
				"test_confirmation_038": 1.0,
				"test_confirmation_039": 1.0,
				"test_confirmation_040": 1.0,
				"test_confirmation_041": 1.0,
				"test_confirmation_042": 1.0,
				"test_confirmation_043": 1.0,
				"test_confirmation_044": 1.0,
				"test_confirmation_045": 1.0,
				"test_confirmation_046": 1.0,
				"test_confirmation_047": 1.0,
				"test_confirmation_048": 1.0,
				"test_confirmation_049": 1.0,
				"test_confirmation_050": 1.0,
				"test_confirmation_051": 1.0,
				"test_confirmation_052": 1.0,
				"test_confirmation_053": 1.0,
				"test_confirmation_054": 1.0,
				"test_confirmation_055": 1.0,
				"test_confirmation_056": 1.0,
				"test_confirmation_057": 1.0,
				"test_confirmation_058": 1.0,
				"test_confirmation_059": 1.0,
				"test_confirmation_060": 1.0,
				"test_confirmation_061": 1.0,
				"test_confirmation_062": 1.0,
				"test_confirmation_063": 1.0,
				"test_confirmation_064": 1.0,
				"test_confirmation_065": 1.0,
				"test_confirmation_066": 1.0,
				"test_confirmation_067": 1.0,
				"test_confirmation_068": 1.0,
				"test_confirmation_069": 1.0,
				"test_confirmation_070": 1.0,
				"test_confirmation_071": 1.0
			},
			"iteration_statistics": {
				"total_executions": 71,
				"test_cases": 71,
				"global_iterations": 1,
				"average_test_case_iterations": 1.0
			}
		},
		"total_executions": 71,
		"iteration_statistics": {
			"total_executions": 71,
			"test_cases": 71,
			"global_iterations": 1,
			"average_test_case_iterations": 1.0
		}
	},
	"messages": [],
	"metadata": {
		"api_version": "v3",
		"task_type": "AGENT_EVAL",
		"processing_method": "v3_json",
		"input_format": "json",
		"test_cases_count": 71,
		"json_metadata": "{'api_version': 'v3', 'active_conversations': 71, 'total_conversations': 71, 'conversations_with_tool_calls': 71, 'conversations_with_expected_response': 0, 'processing_timestamp': '2026-01-26T20:44:10.365518', 'total_input_messages': 305, 'avg_input_messages_per_conversation': 4.295774647887324}",
		"total_conversations": 71,
		"active_conversations": 71
	}
}

Remember to make note of the output file locations to download them in the next API call.

 

Download Your Test Output Files

Use the Export Results in Multiple Formats endpoint to get the output files from your test (test results, iteration analysis, and debug details).

 

Production Endpoint: GET https://aiservice.intelepeer.com/aitask/v3/results/{task_run_id}/export

  • Add the task_run_id , task_id, and customer_id to the query parameters.

  • Include the format for your export.

    • For our use case we’ll use format=zip to get all three output files from our previous API response.

 

Sample Request

GET https://aiservice.intelepeer.com/aitask/v3/results/1769460249/export?task_id=0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval&customer_id=1105739&format=zip

 

Sample Response

If you're using Postman we recommend clicking the arrow next to the Send button and selecting "Send and Download".

The folder with your test results, debug details, iteration analysis, and metadata opens.

 

Evaluate Your Output Files

Use your test results file to evaluate the performance of your agent.

Below each test case you'll see important metrics:

	"match_function_call_f1": 1.0,
	"match_function_name_f1": 1.0,
	"match_function_name_recall": 1.0,
	"match_raw_names": 1.0,
	"match_cosine_similarity_tool_call_values": 0.5485297816691115,
	"match_cosine_similarity_ai_response_values": 1.0,
	"cosine_variance_tool_call": 0.050362919363442685,
	"cosine_variance_ai_response": 0.0,
	"hamming_distance": 0.044217687074829926,
	"batch_id": "0e1be3ce-33a4-4637-a83c-7ad33adfee15-agent_eval",
	"run_id": "1769460249",
	"intent_is_present_recall": 1

  • match_function_call_f1: Evaluates if the expected function call matched the actual function that was called.

  • match_function_name_f1: Evaluates if the expected function name matched the actual name of the function that was called.

  • match_function_name_recall: Evaluates if the expected function matches the actually called function (e.g., expected functions called divided by total expected functions).

  • match_raw_names: Evaluates how closely the names in your results matched the names in your input file.

  • match_cosine_similarity_tool_call_values: The average degree of similarity between expected and actual tool call firing.

  • match_cosine_similarity_ai_response_values: The average degree of similarity between expected and actual responses.

  • The following values compare the results across iterations:

    • cosine_variance_tool_call

    • cosine_variance_ai_response

    • hamming_distance

      • For example, if your input file included a use case with the customer just saying “hi” and you set your task to 5 iterations, these metrics evaluate if the result was the same across each occurrence.

  • {function}_is_present_recall: Recall of the correct function. For example, "intent_is_present_recall": 1 indicates the intent function was recalled accurately.

 

Next Steps

Depending on your use case and metrics, you may need to make edits to your agent. Once you’re satisfied with your agent’s performance, your agent is ready for real-life interactions!

 

We recommend revisiting your agent’s performance periodically and after you make any edits to the configuration to ensure it continues to perform as expected.