4.34.0 (latest) 4.33.0 4.32.0 4.31.0 4.30.0 4.29.0 4.28.0 4.27.0 4.26.0 4.25.0 4.24.0 4.23.0 4.22.0 4.21.0 4.20.0 4.19.0 4.18.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0

    [BindServiceMethod(typeof(Agents), "BindService")]
    public abstract class Agents.AgentsBase

Reference documentation and code samples for the Google Cloud Dialogflow v2 API class Agents.AgentsBase.

Base class for server-side implementations of Agents

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Agents.AgentsBase

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Dialogflow.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.md.txt)

## Assembly

Google.Cloud.Dialogflow.V2.dll

## Methods

### DeleteAgent(DeleteAgentRequest, ServerCallContext)

    public virtual Task<Empty> DeleteAgent(DeleteAgentRequest request, ServerCallContext context)

Deletes the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteAgentRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskEmpty` | The response to send back to the client (wrapped by a task). |

### ExportAgent(ExportAgentRequest, ServerCallContext)

    public virtual Task<Operation> ExportAgent(ExportAgentRequest request, ServerCallContext context)

Exports the specified agent to a ZIP file.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: \[ExportAgentResponse\]\[google.cloud.dialogflow.v2.ExportAgentResponse\]

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ExportAgentRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskOperation` | The response to send back to the client (wrapped by a task). |

### GetAgent(GetAgentRequest, ServerCallContext)

    public virtual Task<Agent> GetAgent(GetAgentRequest request, ServerCallContext context)

Retrieves the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetAgentRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskAgent` | The response to send back to the client (wrapped by a task). |

### GetValidationResult(GetValidationResultRequest, ServerCallContext)

    public virtual Task<ValidationResult> GetValidationResult(GetValidationResultRequest request, ServerCallContext context)

Gets agent validation result. Agent validation is performed during
training time and is updated automatically when training is completed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetValidationResultRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskValidationResult` | The response to send back to the client (wrapped by a task). |

### ImportAgent(ImportAgentRequest, ServerCallContext)

    public virtual Task<Operation> ImportAgent(ImportAgentRequest request, ServerCallContext context)

Imports the specified agent from a ZIP file.

Uploads new intents and entity types without deleting the existing ones.
Intents and entity types with the same name are replaced with the new
versions from
\[ImportAgentRequest\]\[google.cloud.dialogflow.v2.ImportAgentRequest\]. After
the import, the imported draft agent will be trained automatically (unless
disabled in agent settings). However, once the import is done, training may
not be completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when importing is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ImportAgentRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskOperation` | The response to send back to the client (wrapped by a task). |

### RestoreAgent(RestoreAgentRequest, ServerCallContext)

    public virtual Task<Operation> RestoreAgent(RestoreAgentRequest request, ServerCallContext context)

Restores the specified agent from a ZIP file.

Replaces the current agent version with a new one. All the intents and
entity types in the older version are deleted. After the restore, the
restored draft agent will be trained automatically (unless disabled in
agent settings). However, once the restore is done, training may not be
completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when restoring is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `RestoreAgentRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskOperation` | The response to send back to the client (wrapped by a task). |

### SearchAgents(SearchAgentsRequest, ServerCallContext)

    public virtual Task<SearchAgentsResponse> SearchAgents(SearchAgentsRequest request, ServerCallContext context)

Returns the list of agents.

Since there is at most one conversational agent per project, this method is
useful primarily for listing all agents across projects the caller has
access to. One can achieve that with a wildcard project collection id "-".
Refer to [List
Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `SearchAgentsRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskSearchAgentsResponse` | The response to send back to the client (wrapped by a task). |

### SetAgent(SetAgentRequest, ServerCallContext)

    public virtual Task<Agent> SetAgent(SetAgentRequest request, ServerCallContext context)

Creates/updates the specified agent.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `SetAgentRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskAgent` | The response to send back to the client (wrapped by a task). |

### TrainAgent(TrainAgentRequest, ServerCallContext)

    public virtual Task<Operation> TrainAgent(TrainAgentRequest request, ServerCallContext context)

Trains the specified agent.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `TrainAgentRequest` The request received from the client. |
| `context` | `ServerCallContext` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskOperation` | The response to send back to the client (wrapped by a task). |