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 theAgentstrait)AnswerRecordsClient: Service for managing AnswerRecords. (enabled by theAnswerRecordstrait)CompanionAgentsClient: Service for managing companion agents. (enabled by theCompanionAgentstrait)ContextsClient: Service for managing Contexts. (enabled by theContextstrait)ConversationsClient: Service for managing Conversations. (enabled by theConversationstrait)ConversationDatasetsClient: Conversation datasets. (enabled by theConversationDatasetstrait)ConversationModelsClient: Manages a collection of models for human agent assistant. (enabled by theConversationModelstrait)ConversationProfilesClient: Service for managing ConversationProfiles. (enabled by theConversationProfilestrait)DocumentsClient: Service for managing knowledge Documents. (enabled by theDocumentstrait)EncryptionSpecServiceClient: Manages encryption spec settings for Dialogflow and Agent Assist. (enabled by theEncryptionSpecServicetrait)EntityTypesClient: Service for managing EntityTypes. (enabled by theEntityTypestrait)EnvironmentsClient: Service for managing Environments. (enabled by theEnvironmentstrait)FulfillmentsClient: Service for managing Fulfillments. (enabled by theFulfillmentstrait)GeneratorsClient: Generator Service for LLM powered Agent Assist. (enabled by theGeneratorstrait)GeneratorEvaluationsClient: Service for managing generator evaluations. (enabled by theGeneratorEvaluationstrait)IntentsClient: Service for managing Intents. (enabled by theIntentstrait)KnowledgeBasesClient: Service for managing KnowledgeBases. (enabled by theKnowledgeBasestrait)ParticipantsClient: Service for managing Participants. (enabled by theParticipantstrait)SessionsClient: A service used for session interactions. (enabled by theSessionstrait)SessionEntityTypesClient: Service for managing SessionEntityTypes. (enabled by theSessionEntityTypestrait)SipTrunksClient: Service for managing SipTrunks. (enabled by theSipTrunkstrait)ToolsClient: Tool Service for LLM powered Agent Assist. (enabled by theToolstrait)VersionsClient: Service for managing Versions. (enabled by theVersionstrait)
Quickstart
The following example demonstrates using AnswerRecordsClient:
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 section in the google-cloud-swift repository.
Installation
Add swift-google-cloud-dialogflow-v2 as a package dependency:
swift package add-dependency https://github.com/googleapis/swift-google-cloud-dialogflow-v2.git --from 0.6.0Then add GoogleCloudDialogflowV2 to your target's dependencies:
swift package add-target-dependency GoogleCloudDialogflowV2 <target-name> --package swift-google-cloud-dialogflow-v2Package 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:
.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 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 monorepo. See CONTRIBUTING.md for details on getting started.
License
Apache 2.0 - See LICENSE for more information.
Package Metadata
Repository: googleapis/swift-google-cloud-dialogflow-v2
Default branch: main
README: README.md