---
title: googleapis/swift-google-cloud-dialogflow-v2
framework: Swift Package Catalog
role: article
path: packages/googleapis/swift-google-cloud-dialogflow-v2
---

# googleapis/swift-google-cloud-dialogflow-v2

Builds conversational interfaces (for example, chatbots, and voice-powered

## Overview

The following types provide methods to make RPCs. They are a good starting point to learn about this library.

- `AgentsClient`: Service for managing Agents. (enabled by the `Agents` trait) - `AnswerRecordsClient`: Service for managing AnswerRecords. (enabled by the `AnswerRecords` trait) - `CompanionAgentsClient`: Service for managing companion agents. (enabled by the `CompanionAgents` trait) - `ContextsClient`: Service for managing Contexts. (enabled by the `Contexts` trait) - `ConversationsClient`: Service for managing Conversations. (enabled by the `Conversations` trait) - `ConversationDatasetsClient`: Conversation datasets. (enabled by the `ConversationDatasets` trait) - `ConversationModelsClient`: Manages a collection of models for human agent assistant. (enabled by the `ConversationModels` trait) - `ConversationProfilesClient`: Service for managing ConversationProfiles. (enabled by the `ConversationProfiles` trait) - `DocumentsClient`: Service for managing knowledge Documents. (enabled by the `Documents` trait) - `EncryptionSpecServiceClient`: Manages encryption spec settings for Dialogflow and Agent Assist. (enabled by the `EncryptionSpecService` trait) - `EntityTypesClient`: Service for managing EntityTypes. (enabled by the `EntityTypes` trait) - `EnvironmentsClient`: Service for managing Environments. (enabled by the `Environments` trait) - `FulfillmentsClient`: Service for managing Fulfillments. (enabled by the `Fulfillments` trait) - `GeneratorsClient`: Generator Service for LLM powered Agent Assist. (enabled by the `Generators` trait) - `GeneratorEvaluationsClient`: Service for managing generator evaluations. (enabled by the `GeneratorEvaluations` trait) - `IntentsClient`: Service for managing Intents. (enabled by the `Intents` trait) - `KnowledgeBasesClient`: Service for managing KnowledgeBases. (enabled by the `KnowledgeBases` trait) - `ParticipantsClient`: Service for managing Participants. (enabled by the `Participants` trait) - `SessionsClient`: A service used for session interactions. (enabled by the `Sessions` trait) - `SessionEntityTypesClient`: Service for managing SessionEntityTypes. (enabled by the `SessionEntityTypes` trait) - `SipTrunksClient`: Service for managing SipTrunks. (enabled by the `SipTrunks` trait) - `ToolsClient`: Tool Service for LLM powered Agent Assist. (enabled by the `Tools` trait) - `VersionsClient`: Service for managing Versions. (enabled by the `Versions` trait)

## Quickstart

The following example demonstrates using `AnswerRecordsClient`:

```swift import Foundation import GoogleCloudDialogflowV2 import GoogleCloudLocation import GoogleLongRunning import GoogleWKT

func sample(projectId: String, ) async throws {   let client = try GoogleCloudDialogflowV2.AnswerRecordsClient()   let items = client.listAnswerRecordsByItems(     request: ListAnswerRecordsRequest()   .with {     $0.parent = "projects/\(projectId)"   } )   for try await item in items {     print("  \(item)")   } } ```

## Requirements

For the minimum supported Swift version and platform requirements, see the [Requirements](https://github.com/googleapis/google-cloud-swift#minimum-supported-swift-version) section in the `google-cloud-swift` repository.

## Installation

Add `swift-google-cloud-dialogflow-v2` as a package dependency:

```bash swift package add-dependency https://github.com/googleapis/swift-google-cloud-dialogflow-v2.git --from 0.6.0 ```

Then add `GoogleCloudDialogflowV2` to your target's dependencies:

```bash swift package add-target-dependency GoogleCloudDialogflowV2 <target-name> --package swift-google-cloud-dialogflow-v2 ```

### Package Traits

This package uses Swift package traits to conditionally compile individual service clients and their associated types. Enabling a trait enables the corresponding client and all the request, response, and model types needed to use that client.

The following traits are enabled by default: - `Agents`

To enable additional traits alongside the defaults, specify them in `Package.swift`:

```swift .package(url: "https://github.com/googleapis/swift-google-cloud-dialogflow-v2.git", from: "0.6.0", traits: [".defaults", "<TraitName>"]) ```

| Trait | Default | Enabled Client | |---|:---:|---| | `Agents` | Yes | `AgentsClient` | | `AnswerRecords` | No | `AnswerRecordsClient` | | `CompanionAgents` | No | `CompanionAgentsClient` | | `Contexts` | No | `ContextsClient` | | `ConversationDatasets` | No | `ConversationDatasetsClient` | | `ConversationModels` | No | `ConversationModelsClient` | | `ConversationProfiles` | No | `ConversationProfilesClient` | | `Conversations` | No | `ConversationsClient` | | `Documents` | No | `DocumentsClient` | | `EncryptionSpecService` | No | `EncryptionSpecServiceClient` | | `EntityTypes` | No | `EntityTypesClient` | | `Environments` | No | `EnvironmentsClient` | | `Fulfillments` | No | `FulfillmentsClient` | | `GeneratorEvaluations` | No | `GeneratorEvaluationsClient` | | `Generators` | No | `GeneratorsClient` | | `Intents` | No | `IntentsClient` | | `KnowledgeBases` | No | `KnowledgeBasesClient` | | `Participants` | No | `ParticipantsClient` | | `SessionEntityTypes` | No | `SessionEntityTypesClient` | | `Sessions` | No | `SessionsClient` | | `SipTrunks` | No | `SipTrunksClient` | | `Tools` | No | `ToolsClient` | | `Versions` | No | `VersionsClient` |

## Troubleshooting

For questions, bug reports, or feature requests, please open an issue in the [google-cloud-swift](https://github.com/googleapis/google-cloud-swift/issues) repository.

## Contributing

Contributions to this library are always welcome and highly encouraged.

All development, issues, and pull requests are managed in the [google-cloud-swift](https://github.com/googleapis/google-cloud-swift) monorepo. See [CONTRIBUTING.md](https://github.com/googleapis/google-cloud-swift/blob/main/CONTRIBUTING.md) for details on getting started.

## License

Apache 2.0 - See [LICENSE](LICENSE) for more information.

## Package Metadata

Repository: googleapis/swift-google-cloud-dialogflow-v2

Default branch: main

README: README.md
