GoogleProvider
Namespace: Vercel.AI.Google
public class GoogleProvider : ProviderBase, IBatchProviderGoogle Gemini provider.
Inheritance: object → ProviderBase
Implements: IBatchProvider
Derived: GoogleVertexProvider
Constructors
Section titled “Constructors”GoogleProvider(HttpClient, GoogleOptions?)
Section titled “GoogleProvider(HttpClient, GoogleOptions?)”public GoogleProvider(HttpClient httpClient, GoogleOptions? options = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
httpClient |
HttpClient | |
options |
GoogleOptions |
GoogleProvider(HttpClient, GoogleOptions?, string)
Section titled “GoogleProvider(HttpClient, GoogleOptions?, string)”protected GoogleProvider(HttpClient httpClient, GoogleOptions? options, string modelProvider)Creates a provider with an explicit model provider id.
Parameters
| Name | Type | Description |
|---|---|---|
httpClient |
HttpClient | |
options |
GoogleOptions | |
modelProvider |
string |
Fields
Section titled “Fields”ProviderName
Section titled “ProviderName”public const string ProviderName = "google"Provider id.
Value: string
Properties
Section titled “Properties”public Func<DateTimeOffset> Clock { get; set; }Clock used for response timestamps.
Value: Func<DateTimeOffset>
public ProviderHttp Http { get; }HTTP helper.
Value: ProviderHttp
ModelProvider
Section titled “ModelProvider”public string ModelProvider { get; }Provider id recorded on models, such as google.generative-ai or google.vertex.chat.
Value: string
Options
Section titled “Options”public GoogleOptions Options { get; }Options.
Value: GoogleOptions
Methods
Section titled “Methods”Create(GoogleOptions?, HttpMessageHandler?)
Section titled “Create(GoogleOptions?, HttpMessageHandler?)”public static GoogleProvider Create(GoogleOptions? options = null, HttpMessageHandler? handler = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
options |
GoogleOptions | |
handler |
HttpMessageHandler |
Returns: GoogleProvider
DecisionModel(string)
Section titled “DecisionModel(string)”public DecisionLanguageModel DecisionModel(string modelId)Experimental Choice/Score/Boolean decision model that uses Gemini structured output.
The provider id is google.decision.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: DecisionLanguageModel
EmbeddingModel(string)
Section titled “EmbeddingModel(string)”public override IEmbeddingModel EmbeddingModel(string modelId)Returns an embedding model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IEmbeddingModel
ExperimentalBatch()
Section titled “ExperimentalBatch()”public IBatchApi? ExperimentalBatch()Gemini Batch API. Downloads batch results.
Returns: IBatchApi
ImageModel(string)
Section titled “ImageModel(string)”public override IImageModel ImageModel(string modelId)Returns an image model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IImageModel
Interactions(string)
Section titled “Interactions(string)”public virtual ILanguageModel Interactions(string modelId)Language model that posts to the Interactions API.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ILanguageModel
Interactions(GoogleInteractionsAgent)
Section titled “Interactions(GoogleInteractionsAgent)”public virtual ILanguageModel Interactions(GoogleInteractionsAgent agent)Language model that calls an agent through the Interactions API. The request sends agent instead of model.
Parameters
| Name | Type | Description |
|---|---|---|
agent |
GoogleInteractionsAgent |
Returns: ILanguageModel
LanguageModel(string)
Section titled “LanguageModel(string)”public override ILanguageModel LanguageModel(string modelId)Returns a language model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ILanguageModel
RealtimeModel(string)
Section titled “RealtimeModel(string)”public override IRealtimeModel RealtimeModel(string modelId)Returns a realtime model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IRealtimeModel
SpeechModel(string)
Section titled “SpeechModel(string)”public override ISpeechModel SpeechModel(string modelId)Returns a speech model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ISpeechModel
TranscriptionModel(string)
Section titled “TranscriptionModel(string)”public override ITranscriptionModel TranscriptionModel(string modelId)Returns a transcription model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ITranscriptionModel
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product