Before you start following this tutorial, you must set up your IBM watsonx Orchestrate ADK environment, where you build agents and tools. It also provides a convenient interface for managing credentials, sending requests, and handling responses from the service’s APIs. See the Installing the watsonx Orchestrate ADK and Installing the watsonx Orchestrate Developer Edition.
The following steps guide you to create the agent and tool files in YAML.
In your directory, create a folder with the name healthcare_provider.
Open a text editor, such as Visual Studio Code.
To create the agent, copy the following code:
[YAML]
Copy
Ask AI
spec_version: v1kind: nativename: healthcare_agentdescription: > You are a specialist in healthcare providers. When prompted use the getHealthCareProviders tool to get a list of all healthcare providers matching the users qquery. Display the results are a tablellm: watsonx/meta-llama/llama-3-2-90b-vision-instructstyle: defaulttools:- getHealthCareProviders
Paste the code in the text editor and save the file as healthcare_agent.yaml in the healthcare_provider folder.
To create the tool, copy the following code:
[YAML]
Copy
Ask AI
servers:- url: https://find-provider.1sqnxi8zv3dh.us-east.codeengine.appdomain.cloudpaths: /: get: operationId: getHealthCareProviders summary: Gets a list of healthcare providers description: Gets a list of healthcare providers parameters: - in: path name: location schema: type: string required: false description: The city, state or zipcode you want to get healthcare providers - in: path name: speciality schema: type: string enum: ["General Medicine", "Cardiology", "Pediatrics", "Orthopedics", "ENT", "Multi-specialty"] required: false description: The speciality of the healthcare provider responses: '200': description: Successfully retrieved list of healthcare providers content: application/json: schema: type: object properties: providers: type: array items: type: object properties: address: type: string contact: type: object properties: email: type: string phone: type: string name: type: string provider_id: type: string provider_type: type: string specialty: type: string required: - data
Paste the code in the text editor and save the file as get_healthcare_providers.yaml in the healthcare_provider folder.