Posts

Google ADK - adding A2A support for your agent rapidly

Image
In this post, I am going to show how easy it is to convert your agentic app created using ADK to support A2A. What we will do is setup an agentic app that supports A2A. Then we will bring it up to serve new requests. Finally we will call it from ADK app. Ensure we have the proper module installed uv add google-adk[a2a] And then once we have the dependencies, we have a agent.py file contains code to your hello world agent or get weather agent - something really basic. Notice we purposely put the core code in agent.py so we can have another other deployment options for example AppEngine we can create another file called app_engine.py.  But in our case, we will call it a2a_agent.py as we wrapping our agent.py and expose it as a A2A server.   agent.py code (your typical get weather sample) import datetime from zoneinfo import ZoneInfo from google . adk . agents import Agent from google . adk . apps import App from google . adk . models import Gemini from google . g...

semantic kernel exposing services using A2A (server and client)

Image
Semantic kernel hasn't natively provide full support for A2A or atleast not proper yet So i am using these 2 libraries here to do all the hard work. There is no agent llm added in this post - you need to add in those code. dotnet add package A2A dotnet add package A2A.AspNetCore The server side code  using A2A ; using A2A . AspNetCore ; using AgentServer ; var builder = WebApplication . CreateBuilder ( args ) ; var baseUrl = " http://localhost:5000 " ; builder . Services . AddA2AAgent < EchoAgent > ( EchoAgent . GetAgentCard ( $" { baseUrl } /echo " ) ) ; var agentType = " echo " ; var app = builder . Build ( ) ;   app . UseHttpsRedirection ( ) ; app . MapGet ( " /health " , ( ) => Results . Ok ( new { Status = " Healthy " , Timestamp = DateTimeOffset . UtcNow } ) ) ; // Map A2A endpoints using DI-registered services var path = agentType . ToLowerInvariant ( ) switch {     " echo " =...

GCP You currently do not have permission to create API keys - block by organization policy

Image
I ran into this error here where i can't configure an API key for my project. After reviewing, I need a role "Organization Policy Admin". Added that in a flash yet no difference.  After waiting for 5 min, I notice i can now can manage policy. So i am guessing it is a cached thing.  And i can go about creating my API key:

semantic kernel using google gemini chat competion in C#

Image
We can easily implement Gemini Google Chat completion in Semantic Kernel using C#.  First we need to create a new dotnet project dotnet new console  Next we will add the packages from the command line  dotnet add package Microsoft.SemanticKernel dotnet add package Microsoft.Extensions.Logging dotnet add package Microsoft.Extensions.Logging.Console dotnet add package Microsoft.SemanticKernel.Connectors.Google --prerelease And finally this code here  // Import packages using Microsoft . Extensions . DependencyInjection ; using Microsoft . Extensions . Logging ; using Microsoft . SemanticKernel ; using Microsoft . SemanticKernel . ChatCompletion ; using Microsoft . SemanticKernel . Connectors . OpenAI ; using Microsoft . SemanticKernel ; using Microsoft . SemanticKernel . Connectors . Google ; var modelId = " gemini-2.5-flash-lite " ; var serviceId = " service-id " ; var apiKey = "" ; // Create a kernel with Azure OpenAI chat completion var buil...

adk agent integration using github tool

Image
In Google ADK integration there is a tool call "github code" that allow us to do quite a bit of things with github if you provide it work your github token. So we will do this integration and then test it out by asking it to list branches. I tried with PR but not successful.  Here is the code and the docs can be found here:-  https://google.github.io/adk-docs/integrations/github/#available-tools import datetime from zoneinfo import ZoneInfo from google . adk . agents import Agent from google . adk . apps import App from google . adk . models import Gemini from google . genai import types from google . adk . tools . mcp_tool import McpToolset from google . adk . tools . mcp_tool . mcp_session_manager import StreamableHTTPServerParams import os import google . auth _ , project_id = google . auth . default () os . environ [ " GOOGLE_CLOUD_PROJECT " ] = " project-00e3e1b1-5433-464c-b5e " os . environ [ " GOOGLE_CLOUD_LOCATION ...

adk integrating with mcp server

ADK provides integration with MCP server. This is an example of how agent can use mcp tools import logging import os from dotenv import load_dotenv from google . adk . a2a . utils . agent_to_a2a import to_a2a from google . adk . agents import LlmAgent from google . adk . tools . mcp_tool import MCPToolset , StreamableHTTPConnectionParams logger = logging . getLogger ( __name__ ) logging . basicConfig ( format = " [ %(levelname)s ]: %(message)s " , level = logging . INFO ) load_dotenv () SYSTEM_INSTRUCTION = (     " You are a specialized assistant for currency conversions. "     " Your sole purpose is to use the 'get_exchange_rate' tool to answer questions about currency exchange rates. "     " If the user asks about anything other than currency conversion or exchange rates, "     " politely state that you cannot help with that topic and can only assist with currency-related queries. "     " Do not attemp...