-
-
Notifications
You must be signed in to change notification settings - Fork 5
Rasmus Wulff Jensen edited this page Jan 27, 2026
·
4 revisions
- AgentFactory (
GoogleAgentFactory) - AIToolsFactory integration (tools in
GoogleAgentOptions.Tools) - EmbeddingFactory (
GoogleEmbeddingFactory) - Thinking controls via
ThinkingBudget(Gemini < 3) orThinkingLevel+IncludeThoughts(Gemini 3+)
dotnet add package AgentFrameworkToolkit.Google
GoogleAgentFactory agentFactory = new("<apiKey>");
GoogleAgent agent = agentFactory.CreateAgent(new GoogleAgentOptions
{
Model = "gemini-2.5-flash",
ThinkingBudget = 5000,
Instructions = "You are a nice AI"
});
AgentRunResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);GoogleEmbeddingFactory embeddingFactory = new("<apiKey>");
IEmbeddingGenerator<string, Embedding<float>> generator =
embeddingFactory.GetEmbeddingGenerator("gemini-embedding-001", dimensions: 3072);
Embedding<float> embedding = await generator.GenerateAsync("Hello");-
ApiKey(Gemini API key, optional depending on usage) -
VertexAI(optional, use Vertex AI APIs) -
Credential(Vertex-only, optional) -
Project(Vertex-only, optional) -
Location(Vertex-only, optional) -
NetworkTimeout(optional) -
HttpOptions(optional)
builder.Services.AddGoogleAgentFactory("<apiKey>");
builder.Services.AddGoogleAgentFactory(new GoogleConnection
{
ApiKey = "<apiKey>"
});
builder.Services.AddGoogleEmbeddingFactory("<apiKey>");- See AgentFactories and AIToolsFactory for shared options.
- See EmbeddingFactories for additional embedding examples.