Table of Contents
- Configuration File Reference
- Environment Variables Management
- Streaming Responses
- Version Management
- Health Checks
- Multi-turn Conversations
- Example Projects
Configuration File Reference
.novita-agent.yaml Structure
The.novita-agent.yaml configuration file uses Kubernetes-style YAML format:
Modifying Configuration
Modifying CPU and Memory Settings
Modify resource configuration underspec.runtime in .novita-agent.yaml:
Modifying Environment Variables
Thespec.envVars in .novita-agent.yaml is only used for the CLI’s agent invoke command and will not be passed to the deployed sandbox template.
Modify environment variables under spec.envVars in .novita-agent.yaml:
- ⚠️ Do not store sensitive information (such as API Keys) in
.novita-agent.yaml - You can also pass environment variables via the
--envparameter when running theagent invokecommand
Redeploy to Apply Configuration Changes
After modifying resource specifications in.novita-agent.yaml, redeploy is required:
Environment Variables Management
There are several ways to pass environment variables to Agents running in sandbox instances:Method 1: Define in Configuration File (CLI invocation only)
Define environment variables underspec.envVars in .novita-agent.yaml:
Method 2: Pass Dynamically via SDK
When invoking an Agent using the SDK’sinvoke_agent_runtime method, pass them dynamically via the envVars parameter:
Streaming Responses
Implementing Streaming with Synchronous Generators
Use Python generators to implement streaming responses:Implementing Streaming with Async Generators
Use Python async generators:LangChain Streaming Response Example
Complete example using LangChain for streaming responses:Invoking a Streaming Agent
Invoke a streaming Agent using the SDK:Version Management
Deploying a New Agent Version
Modify the version number and deploy a new version:agent_id is generated. Each deployment generates a unique agent_id that corresponds to a specific version.
Health Checks
Default Health Check Endpoint
AgentRuntimeApp automatically provides a/ping health check endpoint:
Custom Health Checks
Use the@app.ping decorator to customize health check logic:
Supported Health Check Statuses
Agents can return the following health statuses:| Status | Description | HTTP Status Code |
|---|---|---|
Healthy | Agent is fully available | 200 |
HealthyBusy | Agent is partially available (e.g., processing heavy load) | 200 |
Unhealthy | Agent is unavailable | 503 |
Multi-turn Conversations
Using Session ID for Multi-turn Conversations
Use theruntimeSessionId parameter to route multiple requests to the same sandbox instance: