// Copyright (c) Microsoft. All rights reserved.
using Google.Apis.Util;
using Google.GenAI;
namespace Microsoft.Extensions.AI;
/// Provides implementations of Microsoft.Extensions.AI abstractions based on .
public static class GoogleGenAIExtensions
{
///
/// Creates an wrapper around the specified .
///
/// The to wrap.
/// The default model ID to use for chat requests if not specified in .
/// An that wraps the specified client.
/// is .
public static IChatClient AsIChatClient(this Client client, string? defaultModelId = null)
{
Utilities.ThrowIfNull(client, nameof(client));
return new GoogleGenAIChatClient(client, defaultModelId);
}
///
/// Creates an wrapper around the specified .
///
/// The client to wrap.
/// The default model ID to use for chat requests if not specified in .
/// An that wraps the specified client.
/// is .
public static IChatClient AsIChatClient(this Models models, string? defaultModelId = null)
{
Utilities.ThrowIfNull(models, nameof(models));
return new GoogleGenAIChatClient(models, defaultModelId);
}
}