LeapAi.SDK.Providers.Google 2.0.1

dotnet add package LeapAi.SDK.Providers.Google --version 2.0.1
                    
NuGet\Install-Package LeapAi.SDK.Providers.Google -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LeapAi.SDK.Providers.Google" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LeapAi.SDK.Providers.Google" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="LeapAi.SDK.Providers.Google" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LeapAi.SDK.Providers.Google --version 2.0.1
                    
#r "nuget: LeapAi.SDK.Providers.Google, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LeapAi.SDK.Providers.Google@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LeapAi.SDK.Providers.Google&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=LeapAi.SDK.Providers.Google&version=2.0.1
                    
Install as a Cake Tool

<p align="center"> <img src="assets/leap_logo.png" alt="Ai-Logo" width="120"> </p>

Leap AI SDK

<p align="center"> <a href="https://www.nuget.org/packages/LeapAi.Sdk"><img src="https://img.shields.io/nuget/v/LeapAi.Sdk.svg" alt="NuGet" /></a> </p>

<p align="center"> <img src="assets/leap_banner.png" alt="Ai Banner" width="100%"> </p>

The Leap AI SDK is a provider-agnostic .NET toolkit designed to help you build AI-powered applications, chatbots, and agents. Built with a highly scalable, enterprise-grade architecture, it provides a unified, stateless service interface to interact with any language model.

AI Models

<p align="start"> <img src="assets/models/gpt.png" width="15%" /> <img src="assets/models/gemini.png" width="15%" /> <img src="assets/models/claude.png" width="15%" /> </p>

Installation

You will need the .NET SDK installed on your local development machine. You can find the package on NuGet.

dotnet add package LeapAi.Sdk

Available NuGet Packages

Leap AI SDK v2.0 introduces a modular architecture. You can install the fully-featured metapackage or adopt specifically what you need:

  • LeapAi.SDK: The all-in-one metapackage containing Core and all available providers.
  • Leap.AI.Core: The bare-metal abstractions, unified models, and pipeline architecture.
  • Leap.AI.Providers.OpenAi: Official OpenAI adapter (GPT-4o, o1, etc.).
  • Leap.AI.Providers.Anthropic: Official Anthropic adapter (Claude 3.5 Sonnet, etc.).
  • Leap.AI.Providers.Google: Official Google Gemini adapter (Gemini 1.5 Flash/Pro, etc.).
  • Leap.AI.Extensions.DependencyInjection: Official builder extensions for ASP.NET Core IServiceCollection integrations.

Unified Provider Architecture

Leap AI SDK v2.0 introduces a high-performance middleware pipeline architecture designed natively for .NET. It lets you plug in OpenAI, Anthropic, or Google Gemini and write strictly against a unified, model-agnostic LeapClient.

using Leap.AI.Core;
using Leap.AI.Providers.OpenAi;
using Leap.AI.Core.Models;

// 1. Build your client pipeline
var leap = LeapClient.Create()
    .UseOpenAi("sk-...", "gpt-4o-mini") // Or .UseAnthropic() / .UseGoogle()
    .UseLogging()
    .UseRetry(maxRetries: 3)
    .Build();

// 2. Generate
string result = await leap.GenerateTextAsync("Hello!");

Usage

Generating Text (Chat)

Generating conversational output is clean and simple. You can query models directly with raw strings or conversational histories.

var messages = new List<ChatMessage> {
    ChatMessage.System("You are a helpful assistant."),
    ChatMessage.User("What is an agent?")
};

var response = await leap.GenerateTextAsync(messages.ToString());
Console.WriteLine(response);

Streaming Text

The SDK natively leverages Server-Sent Events (SSE) providing an IAsyncEnumerable<ChatChunk>. It unifies the varying streaming schemas from Anthropic, Google, and OpenAI under a single interface.

await foreach (var chunk in leap.StreamAsync("Count to 3 quickly."))
{
    Console.Write(chunk.Text);
}

Generating Structured Data (JSON)

The GenerateObjectAsync<T> method dynamically builds JSON Schema definitions strictly from your C# record or class definitions, complete with type enforcement, enum mapping, nullable safety, and validation retries.

public record Recipe(string Name, int PrepTimeMinutes, List<string> Ingredients);

var recipe = await leap.GenerateObjectAsync<Recipe>(
    "Generate a simple chocolate chip cookie recipe."
);

Console.WriteLine($"Recipe: {recipe.Name} ({recipe.PrepTimeMinutes}m prep)");

Agents & Tool Calling

Leap AI v2.0 includes fully-automated tool calling execution. Just create a FunctionTool<T> definition, attach it to your client, and the SDK will automatically manage the round-trip loops required.

using Leap.AI.Core.Tools;

public record WeatherArgs(string City);

// 1. Define your tool
var weatherTool = FunctionTool<WeatherArgs>.Create(
    name: "get_weather",
    description: "Gets the current weather for a specific city.",
    handler: args => $"The weather in {args.City} is sunny and 22C."
);

// 2. Register it when building the client
var leap = LeapClient.Create()
    .UseOpenAi("sk-...")
    .UseTool(weatherTool)
    .Build();

// 3. The SDK automatically resolves the tool requests in the background!
var response = await leap.GenerateTextAsync("What's the weather like in Paris?");

Community

The Leap AI SDK community can be found on our GitHub repository where you can ask questions, voice ideas, and share your projects with other people.

Contributing

Contributions to the Leap AI SDK are welcome and highly appreciated. Stay tuned for our Contribution Guidelines to make sure you have a smooth experience contributing!

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LeapAi.SDK.Providers.Google:

Package Downloads
LeapAi.SDK

Leap AI SDK v2.0 - A high-performance, provider-agnostic .NET AI orchestrator with middleware pipelines, structured output, and automatic tool calling. This metapackage includes Core and all official providers: OpenAI, Anthropic, Google Gemini, and xAI Grok.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 102 4/30/2026
2.0.0 115 4/19/2026