Posts

VertexAiSessionService creating client getting error -ValueError: Project/location and API key are mutually exclusive in the client initializer.

Bump into this error while trying to test out the adk service that is deployed to vertex AI. It seems like vertex agent can't decide it should use GOOGLE_API_KEY or another.  ValueError: Project/location and API key are mutually exclusive in the client initializer. To resolve this, just have to set   GOOGLE_API_KEY="". Then re-run  your script.

Postgres database and table storage and index optimizations

Image
Optimizating database storage is always a key focus area when running databases. Lets get started with some basics.  Database storage used Run the following query to see how much space your database currently using SELECT datname AS database_name , pg_size_pretty(pg_database_size(datname)) AS total_size FROM pg_database ORDER BY pg_database_size(datname) DESC ; And you may get further break down here:- Table size spaces used  Let's see how much space used between data and index  SELECT relname AS table_name , pg_size_pretty(pg_total_relation_size(relid)) AS total_size, pg_size_pretty(pg_relation_size(relid)) AS data_size, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) AS index_size FROM pg_catalog . pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC ; And we may get the following outputs. We can see how much actual data stored in the data (data_size) and how much taken up by the index_size .  It is important to keep...

azure keyvault role assigment for secret

This is a common workflow where user would be granted acceptes to a secret.  However role assignment to secret + version level can still happened like what we see here. But it is invalid. You won't be able to access the secret and the role assignment won't appear either Command will be successful but don't do this  az role assignment create assignee 868f2c6b - a124 - 45b5 - b0d1 - ae6e408a7098   --role "4633458b-17de-408a-b874-0445c86b69e6"   --scope /subscriptions/tenand-id/resourceGroups/mytest-kv-rg/providers/ Microsoft.KeyVault/vaults/pv-test-kv-dev/secrets/mytestsecet/ 550070619b634bee99d2b72d8e3616d8 Instead we should grant role assignment to secret level as the lowest level, for example. Then your role assignment magically appears as well az role assignment create assignee 868f2c6b - a124 - 45b5 - b0d1 - ae6e408a7098   --role "4633458b-17de-408a-b874-0445c86b69e6" --scope /subscriptions/tenantid/resourceGroups/mytest-kv-rg/providers/ Microso...

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