Posts

Showing posts from March, 2026

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...

adk samples repository

 This is the main repository for adk samples. It is such a cool place to do some rapid agentic AI development going. https://github.com/google/adk-samples/blob/main/python/agents/order-processing/order_processing/order_processing_tool.py

google adk docs link

This link provides google adk docs https://google.github.io/adk-docs/tools/limitations/#one-tool-one-agent

semantic kernel - creating a mcp server and calling it using a sse client

Image
 To create a mcp server with semantic kernel we just have to declare a kernel_function like so @ kernel_function () def echo_function ( message : str , extra : str = "" ) -> str :     """ Echo a message as a function """     return f "Hello hello function echo: { message } { extra } " Integrate that into our kernel kernel . add_function ( " echo " , echo_function , " echo_function " )     kernel . add_function (         plugin_name = " prompt " ,         function_name = " prompt " ,         prompt_template_config = PromptTemplateConfig (             name = " prompt " ,             description = " This is a prompt " ,             template = " Please repeat this: {{ $message }} and this: {{ $extra }} " ,             input_variables =[        ...