8000 GitHub - grainier/a2a-weather-client · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2FGitHub.com%2Fgrainier%2Fa2a-weather-client","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E\u0026source=header-repo\u0026source_repo=grainier%2Fa2a-weather-client","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://GitHub.com/grainier/a2a-weather-client\",\"user_id\":null}}","auth_hydro_click_hmac":"96ced944d66a9589ef175f94996cedabcfddfd041a9e74c1e5c6a223c3fd75eb"}}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A2A Weather Agent Client

A small Node.js example that queries the Weather Assistant agent using the @a2a-js/sdk. Two scripts are included:

  • index.js – performs a blocking request and prints the final result.
  • stream.js – streams partial responses as they are produced by the agent.

Prerequisites

  • Node.js 18 or later (for built‑in fetch; older versions need a polyfill)
  • An API key if your agent requires one

Setup

  1. Clone & install

    git clone <this-repo-url>
    cd a2a-weather-client
    npm install
  2. Configure

    • Export your API key:

      export A2A_API_KEY="your_key_here"
    • Set the agent's base URL:

      export A2A_AGENT_URL="http://your-host/gateway/a2a/weather-agent/1"
  3. Run

    # Query for London in blocking mode
    npm start -- "London"       # or: node index.js "London"
    
    # Stream the response instead
    node stream.js "Tokyo"

You should see output like:

📡 Asking for weather in London…
🌤  Agent says: The current temperature in London is 18°C with light rain…

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0