Before you begin
- If you already have an agent, you must check whether your agent is:
- External: hosted outside watsonx Orchestrate, connected via configuration.
- Native: runs within watsonx Orchestrate, built with the Agent Development Kit .
- If External, you must prepare it to connect to the watsonx Orchestrate platform. For more information, see Connect to external agents .
- Install the watsonx Orchestrate Agent Development Kit. For more information, see Installing the ADK .
- Install the watsonx Orchestrate Developer Edition. For more information, see Installing the Developer Edition .
- For more information about the evaluation framework, see the Evaluation framework overview .
Validating your external agent
External agents refer to agents that were not created with the watsonx Orchestrate Agent Development Kit or the watsonx Orchestrate platform. This step checks:- Whether your external agent works without a native agent.
- Whether the agent is able to ingest events and produce events that follow the watsonx Orchestrate API contract .
- Prepare your user story.
- Run the validation command.
- Connect your external agent to a collaborator agent to validate its performance.
- Iterate and fix issues until you are satisfied with the results.
- Submit your results.
Preparing your user story
A user story describes the intention of the user with context information. You must provide all the relevant user information for the agent to process. For example:.tsv
file with two columns. The first column contains user stories. The second column is the expected final output from the agent. For an example file, see the external agent validation folder example. Please prepare at least one example per use case that is supported by your agent. For an example file, see the external agent validation folder example.
Do not include a column header in the
.tsv
file.Running the external agent validation
Thevalidate-external
command validates your external agent to the chat completions schema for streamed events and stores validation results including the streamed events from the external agent for later triaging and debugging.
You must provide the external agent json specification, such as the following:
sample.json
You must provide valid credentials to connect to your external agent.
validate_external
subfolder under the path provided for the --output
flag.
- Your environment must be properly configured. To learn how to properly set up your environment see:
- For remote environments: Configure access to remote environments .
- For the watsonx Orchestrate Developer Edition (local environment): Installing watsonx Orchestrate Developer Edition .
- If you don’t get the expected outputs, you can keep iterating and improve your agent to get better results.
Evaluating the agent
After validation, you can evaluate the agent by using the provided input. This evaluation checks whether the external agent works when added as a collaborator agent to a native agent. Running the following validation command will import the external agent, automatically create a native agent, and add the external agent as a collaborator to the native agent.external_agent_validation_{external_agent_name}_{number}
. You can see this native agent automatically imported by running the list agents
command . After validation, if you wish, you can remove the agents using the remove agent
command .
After the results are generated, you can review them and keep iterating until you get satisfactory results from the evaluation.
Analyzing the validation results
Thevalidation_results.json
stores the results from the validation tests. The validation tests send sample inputs and record the responses. The “success” field indicates if the external agent events matched the chat-completions spec.
The validation tests prepend default messages to the user story. These messages act as context to the agent. Considering that there are n
messages, the goal is to validate if the external agent can properly handle an array of messages where n - 1
messages act as the context. The nth
message is the message the external agent should respond to provided the context. The following default messages are prepended:
success
: Boolean value that indicates if the events streamed back adhered to the expected schema.logged-events
: Streamed events from the external agent.messages
: The messages that were sent to the external agent.
What to do next
You can now proceed to Preparing for submission.Validating your native agent
Native agents refer to agents that were created with the watsonx Orchestrate Agent Development Kit or inside the watsonx Orchestrate platform. Thevalidate-native
command validates the native agent and registered tools, collaborator agents, and knowledge bases against a set of inputs.
Running the Validation
Prepare a TSV file with three columns:- The first column contains user stories.
- The second column is the expected summary or output.
- The third column is the name of the native agent that you want to validate.
example.tsv
<output-folder>/native_agent_evaluations/generated_test_data
Running the command
Preparing for submission
To prepare your agent for submission, you must include all the result files from the validation and evaluation stages. You must also provide a valid credential that can be used to test your agent. Compress the results into a zip file to send them, as follows: External agentsNext steps
After you prepare the evaluation files, you must package your agent if you haven’t already. For more information, see Packaging your agent. Your must put the validation results under theevaluations/
folder, for example: