Posts

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

Semantic kernel using google gemini and API key

If you're thinking about using Google Gemini as your model in semantic kernel, then you come to the right place. This is how you can setup  Run the following command to setup and install the required dependencies uv add semantic-kernel[google] Then you all you need is your Gemini API key import asyncio from semantic_kernel import Kernel from semantic_kernel . utils . logging import setup_logging from semantic_kernel . functions import kernel_function from semantic_kernel . connectors . ai . google . google_ai import GoogleAIChatCompletion from semantic_kernel . connectors . ai . function_choice_behavior import FunctionChoiceBehavior from semantic_kernel . connectors . ai . chat_completion_client_base import ChatCompletionClientBase from semantic_kernel . contents . chat_history import ChatHistory from semantic_kernel . functions . kernel_arguments import KernelArguments from semantic_kernel . connectors . ai . open_ai . prompt_execution_settings . azure_chat_promp...