A2A Hoster
A2A Hoster lets you make an agent that you have built in Nappai available to other applications or services.
It creates a small “card” that describes the agent, gives you the URLs you need to call it, and can even run the agent directly from the dashboard.
How it Works
- Build the agent card – The component sends the text you write in the Prompt field to a language model.
The model turns that description into a JSON card that follows the A2A specification. - Generate the endpoint URLs – It builds two URLs:
- A GET URL that returns the card (
agent.json
). - A POST URL that lets you send a request to the agent.
Both URLs include a placeholder for your Nappai API key (YOUR_NAPPAI_API_KEY
).
- A GET URL that returns the card (
- Optional direct interaction – If you send a request through the POST URL, the component can run the agent right away and return the result.
No external services are called except the language model you choose for the Model input.
Inputs
- Model – The language model that will generate the agent card.
- Agent – The agent you want to expose. Connect the output of an Agent component or any runnable that implements the agent logic.
- Prompt – A short description that tells the model how to build the card.
Example (default value): javascript Name: HelloWorldAgent, Description: Siempre te dirá “Hello World”, Inputs: [Text], Outputs: [Text]
Outputs
- Card Agent – A JSON dictionary that follows the A2A card format.
- Endpoint Path – Two URLs (GET and POST) that you can copy into other applications.
- Agent Response – The result of running the agent when you send a POST request. (Hidden by default in the dashboard.)
Usage Example
- Add an Agent – Drag an Agent component onto the canvas and build the logic you want.
- Add A2A Hoster – Connect the Agent’s output to the Agent input of A2A Hoster.
- Choose a Model – Pick a language model (e.g., GPT‑4) for the Model input.
- Write a Prompt – Describe the agent in the Prompt field.
- Run the Flow – The Card Agent output will contain the JSON card, and the Endpoint Path output will show the URLs.
- Expose the Agent – Copy the POST URL, replace
YOUR_NAPPAI_API_KEY
with your real key, and use it from any external system.
Related Components
- Agent – The component that defines the logic your agent will run.
- LanguageModel – Provides the model used to generate the agent card.
Tips and Best Practices
- Keep the Prompt concise but include all required fields: Name, Description, Inputs, Outputs.
- Use the Prompt example as a template and adjust it for your own agent.
- Store your Nappai API key securely; never hard‑code it in public scripts.
- Test the GET URL first to confirm the card is valid before exposing the POST endpoint.
- If your agent needs authentication, add the necessary headers when calling the POST URL.
Security Considerations
- The POST endpoint requires a valid Nappai API key.
- Only POST requests are allowed to run the agent; GET requests return the card only.
- Do not expose the API key in client‑side code. Use server‑side proxies or environment variables instead.