Skip to main content

Build an Agent

A platform-hosted agent is built from its source repository. A successful build is required before the agent can be deployed or published.

Open the Build page​

  1. Open the agent from the breadcrumb at the top of the Console.
  2. In the left navigation, under Agent lifecycle, click Build.

The Build page shows the following:

FieldDescription
Latest build statusThe status of the latest build, for example Running or Completed.
Build success rateThe percentage of builds that succeeded.
Total buildsThe number of builds of the agent.

The page also lists the builds with their Branch and commit, Build Name, Started At time, and Status.

Trigger a build​

  1. On the Build page, click Trigger a Build. The Trigger Build panel opens.
  2. Under Commit, select the commit to build. To build the latest commit, leave Latest commit selected.
  3. Click Trigger build.

The build is listed on the Build page.

View the progress and logs of a build​

On the Build page, click Details of a build. The Build Details panel shows when the build was triggered, the stages of the build, and its Log.

Deploy a build​

When a build is Completed, click Deploy of the build. For more information, see Deploy an Agent.

Configure the build​

The build configuration defines where the source of the agent comes from, how the agent is built, how it receives requests, and how Kubernetes checks it. Changes apply from the next build.

On the Build page, click Configure build. The Configure Build panel opens.

Repository Details​

FieldDescriptionExample
GitHub RepositoryThe URL of the repository, up to 2048 characters.https://github.com/wso2/agent-manager
BranchThe branch to build, up to 255 characters.main
Project PathThe folder of the agent in the repository, up to 512 characters./samples/hotel-booking-agent/agent

Build Details​

Select how the agent is built:

  • Python: Run a Python app.
  • Ballerina: Run a Ballerina program.
  • Docker: Build from your Dockerfile.

For Python, set the following:

FieldDescriptionExample
Language VersionThe runtime version, up to 255 characters.3.11
Start CommandThe command that starts the agent, up to 4096 characters. Dependencies are installed automatically from package.json, requirements.txt, or pyproject.toml.python -m uvicorn app:app --host 0.0.0.0 --port 8000

Agent Interface​

Select how the agent receives requests:

TypeDescription
Chat agentUses the standard chat interface: POST /chat on port 8000.
Custom API agentUses your OpenAPI specification and port.

A chat agent receives requests and returns responses in the following form:

Request: {message: string, session_id: string, context: JSON}
Response: {response: string}

Health Checks​

Health checks define how Kubernetes checks the agent. Turn each check on or off, and set its fields:

FieldDescription
TypeThe type of check, for example TCP.
PortThe port to check.
Initial delay (s)How long to wait before the first check, in seconds.
Interval (s)How often to run the check, in seconds.
Timeout (s)How long to wait for the check to respond, in seconds.
Failures allowedHow many consecutive failures are allowed before the check fails.

Empty fields use the following defaults:

CheckDescriptionDefault stateDefault values
StartupWaits for the agent to start, and runs until it first passes.OnTCP on port 8000. Initial delay 10 s, interval 5 s, timeout 1 s, 60 failures allowed.
ReadinessDecides whether the agent receives traffic, and runs for as long as the agent runs.OnTCP on port 8000. Initial delay 0 s, interval 5 s, timeout 1 s, 6 failures allowed.
LivenessRestarts the agent when it stops responding.Off

Save the configuration​

Click Update build configuration. To build the agent with the new configuration, trigger a build.

Was this page helpful?