Table of Contents

Class Agent

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

A managed agent (/agents): a reusable agent definition (base agent, configuration, system instruction, tools and base environment) that interactions can reference by ID.

public sealed class Agent
Inheritance
Agent
Inherited Members
Extension Methods

Properties

AgentConfig

The agent configuration (python-genai types it as the Antigravity configuration; any InteractionAgentConfig is accepted and unknown types are kept as raw JSON).

[JsonPropertyName("agent_config")]
public InteractionAgentConfig? AgentConfig { get; set; }

Property Value

InteractionAgentConfig

BaseAgent

The agent this agent is based on (see InteractionAgents).

[JsonPropertyName("base_agent")]
public string? BaseAgent { get; set; }

Property Value

string

BaseEnvironment

The base environment: an environment ID or a remote environment configuration.

[JsonPropertyName("base_environment")]
public InteractionEnvironmentReference? BaseEnvironment { get; set; }

Property Value

InteractionEnvironmentReference

Description

A description of the agent.

[JsonPropertyName("description")]
public string? Description { get; set; }

Property Value

string

ExtensionData

Fields this SDK does not model yet.

[JsonExtensionData]
public Dictionary<string, JsonElement>? ExtensionData { get; set; }

Property Value

Dictionary<string, JsonElement>

Id

The agent ID. Optional on creation (the server assigns one when omitted).

[JsonPropertyName("id")]
public string? Id { get; set; }

Property Value

string

SystemInstruction

The system instruction of the agent.

[JsonPropertyName("system_instruction")]
public string? SystemInstruction { get; set; }

Property Value

string

Tools

The tools of the agent (code execution, function, Google Search, MCP server, URL context). Unknown tool types are read as UnknownInteractionTool.

[JsonPropertyName("tools")]
public List<InteractionTool>? Tools { get; set; }

Property Value

List<InteractionTool>