Documentation ¶
Overview ¶
Package dialogflow is an auto-generated package for the Dialogflow API.
Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).
Use of Context ¶
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
Index ¶
- func DefaultAuthScopes() []string
- type AgentIterator
- type AgentsCallOptions
- type AgentsClient
- func (c *AgentsClient) Close() error
- func (c *AgentsClient) Connection() *grpc.ClientConn
- func (c *AgentsClient) DeleteAgent(ctx context.Context, req *dialogflowpb.DeleteAgentRequest, ...) error
- func (c *AgentsClient) ExportAgent(ctx context.Context, req *dialogflowpb.ExportAgentRequest, ...) (*ExportAgentOperation, error)
- func (c *AgentsClient) ExportAgentOperation(name string) *ExportAgentOperation
- func (c *AgentsClient) GetAgent(ctx context.Context, req *dialogflowpb.GetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error)
- func (c *AgentsClient) GetValidationResult(ctx context.Context, req *dialogflowpb.GetValidationResultRequest, ...) (*dialogflowpb.ValidationResult, error)
- func (c *AgentsClient) ImportAgent(ctx context.Context, req *dialogflowpb.ImportAgentRequest, ...) (*ImportAgentOperation, error)
- func (c *AgentsClient) ImportAgentOperation(name string) *ImportAgentOperation
- func (c *AgentsClient) RestoreAgent(ctx context.Context, req *dialogflowpb.RestoreAgentRequest, ...) (*RestoreAgentOperation, error)
- func (c *AgentsClient) RestoreAgentOperation(name string) *RestoreAgentOperation
- func (c *AgentsClient) SearchAgents(ctx context.Context, req *dialogflowpb.SearchAgentsRequest, ...) *AgentIterator
- func (c *AgentsClient) SetAgent(ctx context.Context, req *dialogflowpb.SetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error)
- func (c *AgentsClient) TrainAgent(ctx context.Context, req *dialogflowpb.TrainAgentRequest, ...) (*TrainAgentOperation, error)
- func (c *AgentsClient) TrainAgentOperation(name string) *TrainAgentOperation
- type AnswerRecordIterator
- type AnswerRecordsCallOptions
- type AnswerRecordsClient
- func (c *AnswerRecordsClient) Close() error
- func (c *AnswerRecordsClient) Connection() *grpc.ClientConn
- func (c *AnswerRecordsClient) ListAnswerRecords(ctx context.Context, req *dialogflowpb.ListAnswerRecordsRequest, ...) *AnswerRecordIterator
- func (c *AnswerRecordsClient) UpdateAnswerRecord(ctx context.Context, req *dialogflowpb.UpdateAnswerRecordRequest, ...) (*dialogflowpb.AnswerRecord, error)
- type BatchCreateEntitiesOperation
- func (op *BatchCreateEntitiesOperation) Done() bool
- func (op *BatchCreateEntitiesOperation) Metadata() (*structpb.Struct, error)
- func (op *BatchCreateEntitiesOperation) Name() string
- func (op *BatchCreateEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *BatchCreateEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type BatchDeleteEntitiesOperation
- func (op *BatchDeleteEntitiesOperation) Done() bool
- func (op *BatchDeleteEntitiesOperation) Metadata() (*structpb.Struct, error)
- func (op *BatchDeleteEntitiesOperation) Name() string
- func (op *BatchDeleteEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *BatchDeleteEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type BatchDeleteEntityTypesOperation
- func (op *BatchDeleteEntityTypesOperation) Done() bool
- func (op *BatchDeleteEntityTypesOperation) Metadata() (*structpb.Struct, error)
- func (op *BatchDeleteEntityTypesOperation) Name() string
- func (op *BatchDeleteEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *BatchDeleteEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type BatchDeleteIntentsOperation
- func (op *BatchDeleteIntentsOperation) Done() bool
- func (op *BatchDeleteIntentsOperation) Metadata() (*structpb.Struct, error)
- func (op *BatchDeleteIntentsOperation) Name() string
- func (op *BatchDeleteIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *BatchDeleteIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type BatchUpdateEntitiesOperation
- func (op *BatchUpdateEntitiesOperation) Done() bool
- func (op *BatchUpdateEntitiesOperation) Metadata() (*structpb.Struct, error)
- func (op *BatchUpdateEntitiesOperation) Name() string
- func (op *BatchUpdateEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *BatchUpdateEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type BatchUpdateEntityTypesOperation
- func (op *BatchUpdateEntityTypesOperation) Done() bool
- func (op *BatchUpdateEntityTypesOperation) Metadata() (*structpb.Struct, error)
- func (op *BatchUpdateEntityTypesOperation) Name() string
- func (op *BatchUpdateEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateEntityTypesResponse, error)
- func (op *BatchUpdateEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateEntityTypesResponse, error)
- type BatchUpdateIntentsOperation
- func (op *BatchUpdateIntentsOperation) Done() bool
- func (op *BatchUpdateIntentsOperation) Metadata() (*structpb.Struct, error)
- func (op *BatchUpdateIntentsOperation) Name() string
- func (op *BatchUpdateIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateIntentsResponse, error)
- func (op *BatchUpdateIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateIntentsResponse, error)
- type ContextIterator
- type ContextsCallOptions
- type ContextsClient
- func (c *ContextsClient) Close() error
- func (c *ContextsClient) Connection() *grpc.ClientConn
- func (c *ContextsClient) CreateContext(ctx context.Context, req *dialogflowpb.CreateContextRequest, ...) (*dialogflowpb.Context, error)
- func (c *ContextsClient) DeleteAllContexts(ctx context.Context, req *dialogflowpb.DeleteAllContextsRequest, ...) error
- func (c *ContextsClient) DeleteContext(ctx context.Context, req *dialogflowpb.DeleteContextRequest, ...) error
- func (c *ContextsClient) GetContext(ctx context.Context, req *dialogflowpb.GetContextRequest, ...) (*dialogflowpb.Context, error)
- func (c *ContextsClient) ListContexts(ctx context.Context, req *dialogflowpb.ListContextsRequest, ...) *ContextIterator
- func (c *ContextsClient) UpdateContext(ctx context.Context, req *dialogflowpb.UpdateContextRequest, ...) (*dialogflowpb.Context, error)
- type ConversationIterator
- type ConversationProfileIterator
- type ConversationProfilesCallOptions
- type ConversationProfilesClient
- func (c *ConversationProfilesClient) Close() error
- func (c *ConversationProfilesClient) Connection() *grpc.ClientConn
- func (c *ConversationProfilesClient) CreateConversationProfile(ctx context.Context, req *dialogflowpb.CreateConversationProfileRequest, ...) (*dialogflowpb.ConversationProfile, error)
- func (c *ConversationProfilesClient) DeleteConversationProfile(ctx context.Context, req *dialogflowpb.DeleteConversationProfileRequest, ...) error
- func (c *ConversationProfilesClient) GetConversationProfile(ctx context.Context, req *dialogflowpb.GetConversationProfileRequest, ...) (*dialogflowpb.ConversationProfile, error)
- func (c *ConversationProfilesClient) ListConversationProfiles(ctx context.Context, req *dialogflowpb.ListConversationProfilesRequest, ...) *ConversationProfileIterator
- func (c *ConversationProfilesClient) UpdateConversationProfile(ctx context.Context, req *dialogflowpb.UpdateConversationProfileRequest, ...) (*dialogflowpb.ConversationProfile, error)
- type ConversationsCallOptions
- type ConversationsClient
- func (c *ConversationsClient) Close() error
- func (c *ConversationsClient) CompleteConversation(ctx context.Context, req *dialogflowpb.CompleteConversationRequest, ...) (*dialogflowpb.Conversation, error)
- func (c *ConversationsClient) Connection() *grpc.ClientConn
- func (c *ConversationsClient) CreateConversation(ctx context.Context, req *dialogflowpb.CreateConversationRequest, ...) (*dialogflowpb.Conversation, error)
- func (c *ConversationsClient) GetConversation(ctx context.Context, req *dialogflowpb.GetConversationRequest, ...) (*dialogflowpb.Conversation, error)
- func (c *ConversationsClient) ListConversations(ctx context.Context, req *dialogflowpb.ListConversationsRequest, ...) *ConversationIterator
- func (c *ConversationsClient) ListMessages(ctx context.Context, req *dialogflowpb.ListMessagesRequest, ...) *MessageIterator
- type CreateDocumentOperation
- func (op *CreateDocumentOperation) Done() bool
- func (op *CreateDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
- func (op *CreateDocumentOperation) Name() string
- func (op *CreateDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
- func (op *CreateDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
- type DeleteDocumentOperation
- func (op *DeleteDocumentOperation) Done() bool
- func (op *DeleteDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
- func (op *DeleteDocumentOperation) Name() string
- func (op *DeleteDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DocumentIterator
- type DocumentsCallOptions
- type DocumentsClient
- func (c *DocumentsClient) Close() error
- func (c *DocumentsClient) Connection() *grpc.ClientConn
- func (c *DocumentsClient) CreateDocument(ctx context.Context, req *dialogflowpb.CreateDocumentRequest, ...) (*CreateDocumentOperation, error)
- func (c *DocumentsClient) CreateDocumentOperation(name string) *CreateDocumentOperation
- func (c *DocumentsClient) DeleteDocument(ctx context.Context, req *dialogflowpb.DeleteDocumentRequest, ...) (*DeleteDocumentOperation, error)
- func (c *DocumentsClient) DeleteDocumentOperation(name string) *DeleteDocumentOperation
- func (c *DocumentsClient) GetDocument(ctx context.Context, req *dialogflowpb.GetDocumentRequest, ...) (*dialogflowpb.Document, error)
- func (c *DocumentsClient) ListDocuments(ctx context.Context, req *dialogflowpb.ListDocumentsRequest, ...) *DocumentIterator
- func (c *DocumentsClient) ReloadDocument(ctx context.Context, req *dialogflowpb.ReloadDocumentRequest, ...) (*ReloadDocumentOperation, error)
- func (c *DocumentsClient) ReloadDocumentOperation(name string) *ReloadDocumentOperation
- func (c *DocumentsClient) UpdateDocument(ctx context.Context, req *dialogflowpb.UpdateDocumentRequest, ...) (*UpdateDocumentOperation, error)
- func (c *DocumentsClient) UpdateDocumentOperation(name string) *UpdateDocumentOperation
- type EntityTypeIterator
- type EntityTypesCallOptions
- type EntityTypesClient
- func (c *EntityTypesClient) BatchCreateEntities(ctx context.Context, req *dialogflowpb.BatchCreateEntitiesRequest, ...) (*BatchCreateEntitiesOperation, error)
- func (c *EntityTypesClient) BatchCreateEntitiesOperation(name string) *BatchCreateEntitiesOperation
- func (c *EntityTypesClient) BatchDeleteEntities(ctx context.Context, req *dialogflowpb.BatchDeleteEntitiesRequest, ...) (*BatchDeleteEntitiesOperation, error)
- func (c *EntityTypesClient) BatchDeleteEntitiesOperation(name string) *BatchDeleteEntitiesOperation
- func (c *EntityTypesClient) BatchDeleteEntityTypes(ctx context.Context, req *dialogflowpb.BatchDeleteEntityTypesRequest, ...) (*BatchDeleteEntityTypesOperation, error)
- func (c *EntityTypesClient) BatchDeleteEntityTypesOperation(name string) *BatchDeleteEntityTypesOperation
- func (c *EntityTypesClient) BatchUpdateEntities(ctx context.Context, req *dialogflowpb.BatchUpdateEntitiesRequest, ...) (*BatchUpdateEntitiesOperation, error)
- func (c *EntityTypesClient) BatchUpdateEntitiesOperation(name string) *BatchUpdateEntitiesOperation
- func (c *EntityTypesClient) BatchUpdateEntityTypes(ctx context.Context, req *dialogflowpb.BatchUpdateEntityTypesRequest, ...) (*BatchUpdateEntityTypesOperation, error)
- func (c *EntityTypesClient) BatchUpdateEntityTypesOperation(name string) *BatchUpdateEntityTypesOperation
- func (c *EntityTypesClient) Close() error
- func (c *EntityTypesClient) Connection() *grpc.ClientConn
- func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *dialogflowpb.CreateEntityTypeRequest, ...) (*dialogflowpb.EntityType, error)
- func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *dialogflowpb.DeleteEntityTypeRequest, ...) error
- func (c *EntityTypesClient) GetEntityType(ctx context.Context, req *dialogflowpb.GetEntityTypeRequest, ...) (*dialogflowpb.EntityType, error)
- func (c *EntityTypesClient) ListEntityTypes(ctx context.Context, req *dialogflowpb.ListEntityTypesRequest, ...) *EntityTypeIterator
- func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *dialogflowpb.UpdateEntityTypeRequest, ...) (*dialogflowpb.EntityType, error)
- type EnvironmentHistory_EntryIterator
- type EnvironmentIterator
- type EnvironmentsCallOptions
- type EnvironmentsClient
- func (c *EnvironmentsClient) Close() error
- func (c *EnvironmentsClient) Connection() *grpc.ClientConn
- func (c *EnvironmentsClient) CreateEnvironment(ctx context.Context, req *dialogflowpb.CreateEnvironmentRequest, ...) (*dialogflowpb.Environment, error)
- func (c *EnvironmentsClient) DeleteEnvironment(ctx context.Context, req *dialogflowpb.DeleteEnvironmentRequest, ...) error
- func (c *EnvironmentsClient) GetEnvironment(ctx context.Context, req *dialogflowpb.GetEnvironmentRequest, ...) (*dialogflowpb.Environment, error)
- func (c *EnvironmentsClient) GetEnvironmentHistory(ctx context.Context, req *dialogflowpb.GetEnvironmentHistoryRequest, ...) *EnvironmentHistory_EntryIterator
- func (c *EnvironmentsClient) ListEnvironments(ctx context.Context, req *dialogflowpb.ListEnvironmentsRequest, ...) *EnvironmentIterator
- func (c *EnvironmentsClient) UpdateEnvironment(ctx context.Context, req *dialogflowpb.UpdateEnvironmentRequest, ...) (*dialogflowpb.Environment, error)
- type ExportAgentOperation
- func (op *ExportAgentOperation) Done() bool
- func (op *ExportAgentOperation) Metadata() (*structpb.Struct, error)
- func (op *ExportAgentOperation) Name() string
- func (op *ExportAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.ExportAgentResponse, error)
- func (op *ExportAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.ExportAgentResponse, error)
- type FulfillmentsCallOptions
- type FulfillmentsClient
- func (c *FulfillmentsClient) Close() error
- func (c *FulfillmentsClient) Connection() *grpc.ClientConn
- func (c *FulfillmentsClient) GetFulfillment(ctx context.Context, req *dialogflowpb.GetFulfillmentRequest, ...) (*dialogflowpb.Fulfillment, error)
- func (c *FulfillmentsClient) UpdateFulfillment(ctx context.Context, req *dialogflowpb.UpdateFulfillmentRequest, ...) (*dialogflowpb.Fulfillment, error)
- type ImportAgentOperation
- func (op *ImportAgentOperation) Done() bool
- func (op *ImportAgentOperation) Metadata() (*structpb.Struct, error)
- func (op *ImportAgentOperation) Name() string
- func (op *ImportAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *ImportAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type IntentIterator
- type IntentsCallOptions
- type IntentsClient
- func (c *IntentsClient) BatchDeleteIntents(ctx context.Context, req *dialogflowpb.BatchDeleteIntentsRequest, ...) (*BatchDeleteIntentsOperation, error)
- func (c *IntentsClient) BatchDeleteIntentsOperation(name string) *BatchDeleteIntentsOperation
- func (c *IntentsClient) BatchUpdateIntents(ctx context.Context, req *dialogflowpb.BatchUpdateIntentsRequest, ...) (*BatchUpdateIntentsOperation, error)
- func (c *IntentsClient) BatchUpdateIntentsOperation(name string) *BatchUpdateIntentsOperation
- func (c *IntentsClient) Close() error
- func (c *IntentsClient) Connection() *grpc.ClientConn
- func (c *IntentsClient) CreateIntent(ctx context.Context, req *dialogflowpb.CreateIntentRequest, ...) (*dialogflowpb.Intent, error)
- func (c *IntentsClient) DeleteIntent(ctx context.Context, req *dialogflowpb.DeleteIntentRequest, ...) error
- func (c *IntentsClient) GetIntent(ctx context.Context, req *dialogflowpb.GetIntentRequest, ...) (*dialogflowpb.Intent, error)
- func (c *IntentsClient) ListIntents(ctx context.Context, req *dialogflowpb.ListIntentsRequest, ...) *IntentIterator
- func (c *IntentsClient) UpdateIntent(ctx context.Context, req *dialogflowpb.UpdateIntentRequest, ...) (*dialogflowpb.Intent, error)
- type KnowledgeBaseIterator
- type KnowledgeBasesCallOptions
- type KnowledgeBasesClient
- func (c *KnowledgeBasesClient) Close() error
- func (c *KnowledgeBasesClient) Connection() *grpc.ClientConn
- func (c *KnowledgeBasesClient) CreateKnowledgeBase(ctx context.Context, req *dialogflowpb.CreateKnowledgeBaseRequest, ...) (*dialogflowpb.KnowledgeBase, error)
- func (c *KnowledgeBasesClient) DeleteKnowledgeBase(ctx context.Context, req *dialogflowpb.DeleteKnowledgeBaseRequest, ...) error
- func (c *KnowledgeBasesClient) GetKnowledgeBase(ctx context.Context, req *dialogflowpb.GetKnowledgeBaseRequest, ...) (*dialogflowpb.KnowledgeBase, error)
- func (c *KnowledgeBasesClient) ListKnowledgeBases(ctx context.Context, req *dialogflowpb.ListKnowledgeBasesRequest, ...) *KnowledgeBaseIterator
- func (c *KnowledgeBasesClient) UpdateKnowledgeBase(ctx context.Context, req *dialogflowpb.UpdateKnowledgeBaseRequest, ...) (*dialogflowpb.KnowledgeBase, error)
- type MessageIterator
- type ParticipantIterator
- type ParticipantsCallOptions
- type ParticipantsClient
- func (c *ParticipantsClient) AnalyzeContent(ctx context.Context, req *dialogflowpb.AnalyzeContentRequest, ...) (*dialogflowpb.AnalyzeContentResponse, error)
- func (c *ParticipantsClient) Close() error
- func (c *ParticipantsClient) Connection() *grpc.ClientConn
- func (c *ParticipantsClient) CreateParticipant(ctx context.Context, req *dialogflowpb.CreateParticipantRequest, ...) (*dialogflowpb.Participant, error)
- func (c *ParticipantsClient) GetParticipant(ctx context.Context, req *dialogflowpb.GetParticipantRequest, ...) (*dialogflowpb.Participant, error)
- func (c *ParticipantsClient) ListParticipants(ctx context.Context, req *dialogflowpb.ListParticipantsRequest, ...) *ParticipantIterator
- func (c *ParticipantsClient) SuggestArticles(ctx context.Context, req *dialogflowpb.SuggestArticlesRequest, ...) (*dialogflowpb.SuggestArticlesResponse, error)
- func (c *ParticipantsClient) SuggestFaqAnswers(ctx context.Context, req *dialogflowpb.SuggestFaqAnswersRequest, ...) (*dialogflowpb.SuggestFaqAnswersResponse, error)
- func (c *ParticipantsClient) UpdateParticipant(ctx context.Context, req *dialogflowpb.UpdateParticipantRequest, ...) (*dialogflowpb.Participant, error)
- type ReloadDocumentOperation
- func (op *ReloadDocumentOperation) Done() bool
- func (op *ReloadDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
- func (op *ReloadDocumentOperation) Name() string
- func (op *ReloadDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
- func (op *ReloadDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
- type RestoreAgentOperation
- func (op *RestoreAgentOperation) Done() bool
- func (op *RestoreAgentOperation) Metadata() (*structpb.Struct, error)
- func (op *RestoreAgentOperation) Name() string
- func (op *RestoreAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *RestoreAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type SessionEntityTypeIterator
- type SessionEntityTypesCallOptions
- type SessionEntityTypesClient
- func (c *SessionEntityTypesClient) Close() error
- func (c *SessionEntityTypesClient) Connection() *grpc.ClientConn
- func (c *SessionEntityTypesClient) CreateSessionEntityType(ctx context.Context, req *dialogflowpb.CreateSessionEntityTypeRequest, ...) (*dialogflowpb.SessionEntityType, error)
- func (c *SessionEntityTypesClient) DeleteSessionEntityType(ctx context.Context, req *dialogflowpb.DeleteSessionEntityTypeRequest, ...) error
- func (c *SessionEntityTypesClient) GetSessionEntityType(ctx context.Context, req *dialogflowpb.GetSessionEntityTypeRequest, ...) (*dialogflowpb.SessionEntityType, error)
- func (c *SessionEntityTypesClient) ListSessionEntityTypes(ctx context.Context, req *dialogflowpb.ListSessionEntityTypesRequest, ...) *SessionEntityTypeIterator
- func (c *SessionEntityTypesClient) UpdateSessionEntityType(ctx context.Context, req *dialogflowpb.UpdateSessionEntityTypeRequest, ...) (*dialogflowpb.SessionEntityType, error)
- type SessionsCallOptions
- type SessionsClient
- func (c *SessionsClient) Close() error
- func (c *SessionsClient) Connection() *grpc.ClientConn
- func (c *SessionsClient) DetectIntent(ctx context.Context, req *dialogflowpb.DetectIntentRequest, ...) (*dialogflowpb.DetectIntentResponse, error)
- func (c *SessionsClient) StreamingDetectIntent(ctx context.Context, opts ...gax.CallOption) (dialogflowpb.Sessions_StreamingDetectIntentClient, error)
- type TrainAgentOperation
- func (op *TrainAgentOperation) Done() bool
- func (op *TrainAgentOperation) Metadata() (*structpb.Struct, error)
- func (op *TrainAgentOperation) Name() string
- func (op *TrainAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *TrainAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type UpdateDocumentOperation
- func (op *UpdateDocumentOperation) Done() bool
- func (op *UpdateDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
- func (op *UpdateDocumentOperation) Name() string
- func (op *UpdateDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
- func (op *UpdateDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
- type VersionIterator
- type VersionsCallOptions
- type VersionsClient
- func (c *VersionsClient) Close() error
- func (c *VersionsClient) Connection() *grpc.ClientConn
- func (c *VersionsClient) CreateVersion(ctx context.Context, req *dialogflowpb.CreateVersionRequest, ...) (*dialogflowpb.Version, error)
- func (c *VersionsClient) DeleteVersion(ctx context.Context, req *dialogflowpb.DeleteVersionRequest, ...) error
- func (c *VersionsClient) GetVersion(ctx context.Context, req *dialogflowpb.GetVersionRequest, ...) (*dialogflowpb.Version, error)
- func (c *VersionsClient) ListVersions(ctx context.Context, req *dialogflowpb.ListVersionsRequest, ...) *VersionIterator
- func (c *VersionsClient) UpdateVersion(ctx context.Context, req *dialogflowpb.UpdateVersionRequest, ...) (*dialogflowpb.Version, error)
Examples ¶
- AgentsClient.DeleteAgent
- AgentsClient.ExportAgent
- AgentsClient.GetAgent
- AgentsClient.GetValidationResult
- AgentsClient.ImportAgent
- AgentsClient.RestoreAgent
- AgentsClient.SearchAgents
- AgentsClient.SetAgent
- AgentsClient.TrainAgent
- AnswerRecordsClient.ListAnswerRecords
- AnswerRecordsClient.UpdateAnswerRecord
- ContextsClient.CreateContext
- ContextsClient.DeleteAllContexts
- ContextsClient.DeleteContext
- ContextsClient.GetContext
- ContextsClient.ListContexts
- ContextsClient.UpdateContext
- ConversationProfilesClient.CreateConversationProfile
- ConversationProfilesClient.DeleteConversationProfile
- ConversationProfilesClient.GetConversationProfile
- ConversationProfilesClient.ListConversationProfiles
- ConversationProfilesClient.UpdateConversationProfile
- ConversationsClient.CompleteConversation
- ConversationsClient.CreateConversation
- ConversationsClient.GetConversation
- ConversationsClient.ListConversations
- ConversationsClient.ListMessages
- DocumentsClient.CreateDocument
- DocumentsClient.DeleteDocument
- DocumentsClient.GetDocument
- DocumentsClient.ListDocuments
- DocumentsClient.ReloadDocument
- DocumentsClient.UpdateDocument
- EntityTypesClient.BatchCreateEntities
- EntityTypesClient.BatchDeleteEntities
- EntityTypesClient.BatchDeleteEntityTypes
- EntityTypesClient.BatchUpdateEntities
- EntityTypesClient.BatchUpdateEntityTypes
- EntityTypesClient.CreateEntityType
- EntityTypesClient.DeleteEntityType
- EntityTypesClient.GetEntityType
- EntityTypesClient.ListEntityTypes
- EntityTypesClient.UpdateEntityType
- EnvironmentsClient.CreateEnvironment
- EnvironmentsClient.DeleteEnvironment
- EnvironmentsClient.GetEnvironment
- EnvironmentsClient.GetEnvironmentHistory
- EnvironmentsClient.ListEnvironments
- EnvironmentsClient.UpdateEnvironment
- FulfillmentsClient.GetFulfillment
- FulfillmentsClient.UpdateFulfillment
- IntentsClient.BatchDeleteIntents
- IntentsClient.BatchUpdateIntents
- IntentsClient.CreateIntent
- IntentsClient.DeleteIntent
- IntentsClient.GetIntent
- IntentsClient.ListIntents
- IntentsClient.UpdateIntent
- KnowledgeBasesClient.CreateKnowledgeBase
- KnowledgeBasesClient.DeleteKnowledgeBase
- KnowledgeBasesClient.GetKnowledgeBase
- KnowledgeBasesClient.ListKnowledgeBases
- KnowledgeBasesClient.UpdateKnowledgeBase
- NewAgentsClient
- NewAnswerRecordsClient
- NewContextsClient
- NewConversationProfilesClient
- NewConversationsClient
- NewDocumentsClient
- NewEntityTypesClient
- NewEnvironmentsClient
- NewFulfillmentsClient
- NewIntentsClient
- NewKnowledgeBasesClient
- NewParticipantsClient
- NewSessionEntityTypesClient
- NewSessionsClient
- NewVersionsClient
- ParticipantsClient.AnalyzeContent
- ParticipantsClient.CreateParticipant
- ParticipantsClient.GetParticipant
- ParticipantsClient.ListParticipants
- ParticipantsClient.SuggestArticles
- ParticipantsClient.SuggestFaqAnswers
- ParticipantsClient.UpdateParticipant
- SessionEntityTypesClient.CreateSessionEntityType
- SessionEntityTypesClient.DeleteSessionEntityType
- SessionEntityTypesClient.GetSessionEntityType
- SessionEntityTypesClient.ListSessionEntityTypes
- SessionEntityTypesClient.UpdateSessionEntityType
- SessionsClient.DetectIntent
- SessionsClient.StreamingDetectIntent
- VersionsClient.CreateVersion
- VersionsClient.DeleteVersion
- VersionsClient.GetVersion
- VersionsClient.ListVersions
- VersionsClient.UpdateVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AgentIterator ¶
type AgentIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Agent, nextPageToken string, err error) // contains filtered or unexported fields }
AgentIterator manages a stream of *dialogflowpb.Agent.
func (*AgentIterator) Next ¶
func (it *AgentIterator) Next() (*dialogflowpb.Agent, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AgentIterator) PageInfo ¶
func (it *AgentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AgentsCallOptions ¶
type AgentsCallOptions struct { GetAgent []gax.CallOption SetAgent []gax.CallOption DeleteAgent []gax.CallOption SearchAgents []gax.CallOption TrainAgent []gax.CallOption ExportAgent []gax.CallOption ImportAgent []gax.CallOption RestoreAgent []gax.CallOption GetValidationResult []gax.CallOption }
AgentsCallOptions contains the retry settings for each method of AgentsClient.
type AgentsClient ¶
type AgentsClient struct { // The call options for this service. CallOptions *AgentsCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
AgentsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Agents.
func NewAgentsClient ¶
func NewAgentsClient(ctx context.Context, opts ...option.ClientOption) (*AgentsClient, error)
NewAgentsClient creates a new agents client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Agents.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*AgentsClient) Close ¶
func (c *AgentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AgentsClient) Connection ¶
func (c *AgentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*AgentsClient) DeleteAgent ¶ added in v1.42.0
func (c *AgentsClient) DeleteAgent(ctx context.Context, req *dialogflowpb.DeleteAgentRequest, opts ...gax.CallOption) error
DeleteAgent deletes the specified agent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteAgentRequest{ // TODO: Fill request struct fields. } err = c.DeleteAgent(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*AgentsClient) ExportAgent ¶
func (c *AgentsClient) ExportAgent(ctx context.Context, req *dialogflowpb.ExportAgentRequest, opts ...gax.CallOption) (*ExportAgentOperation, error)
ExportAgent exports the specified agent to a ZIP file.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ExportAgentRequest{ // TODO: Fill request struct fields. } op, err := c.ExportAgent(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AgentsClient) ExportAgentOperation ¶
func (c *AgentsClient) ExportAgentOperation(name string) *ExportAgentOperation
ExportAgentOperation returns a new ExportAgentOperation from a given name. The name must be that of a previously created ExportAgentOperation, possibly from a different process.
func (*AgentsClient) GetAgent ¶
func (c *AgentsClient) GetAgent(ctx context.Context, req *dialogflowpb.GetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error)
GetAgent retrieves the specified agent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetAgentRequest{ // TODO: Fill request struct fields. } resp, err := c.GetAgent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AgentsClient) GetValidationResult ¶ added in v1.42.0
func (c *AgentsClient) GetValidationResult(ctx context.Context, req *dialogflowpb.GetValidationResultRequest, opts ...gax.CallOption) (*dialogflowpb.ValidationResult, error)
GetValidationResult gets agent validation result. Agent validation is performed during training time and is updated automatically when training is completed.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetValidationResultRequest{ // TODO: Fill request struct fields. } resp, err := c.GetValidationResult(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AgentsClient) ImportAgent ¶
func (c *AgentsClient) ImportAgent(ctx context.Context, req *dialogflowpb.ImportAgentRequest, opts ...gax.CallOption) (*ImportAgentOperation, error)
ImportAgent 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. 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 and wait for the operation it returns in order to train explicitly.
An operation which tracks when importing is complete. It only tracks when the draft agent is updated not when it is done training.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ImportAgentRequest{ // TODO: Fill request struct fields. } op, err := c.ImportAgent(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*AgentsClient) ImportAgentOperation ¶
func (c *AgentsClient) ImportAgentOperation(name string) *ImportAgentOperation
ImportAgentOperation returns a new ImportAgentOperation from a given name. The name must be that of a previously created ImportAgentOperation, possibly from a different process.
func (*AgentsClient) RestoreAgent ¶
func (c *AgentsClient) RestoreAgent(ctx context.Context, req *dialogflowpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error)
RestoreAgent 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 and wait for the operation it returns in order to train explicitly.
An operation which tracks when restoring is complete. It only tracks when the draft agent is updated not when it is done training.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.RestoreAgentRequest{ // TODO: Fill request struct fields. } op, err := c.RestoreAgent(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*AgentsClient) RestoreAgentOperation ¶
func (c *AgentsClient) RestoreAgentOperation(name string) *RestoreAgentOperation
RestoreAgentOperation returns a new RestoreAgentOperation from a given name. The name must be that of a previously created RestoreAgentOperation, possibly from a different process.
func (*AgentsClient) SearchAgents ¶
func (c *AgentsClient) SearchAgents(ctx context.Context, req *dialogflowpb.SearchAgentsRequest, opts ...gax.CallOption) *AgentIterator
SearchAgents 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 (at https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.SearchAgentsRequest{ // TODO: Fill request struct fields. } it := c.SearchAgents(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*AgentsClient) SetAgent ¶ added in v1.42.0
func (c *AgentsClient) SetAgent(ctx context.Context, req *dialogflowpb.SetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error)
SetAgent creates/updates the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.SetAgentRequest{ // TODO: Fill request struct fields. } resp, err := c.SetAgent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AgentsClient) TrainAgent ¶
func (c *AgentsClient) TrainAgent(ctx context.Context, req *dialogflowpb.TrainAgentRequest, opts ...gax.CallOption) (*TrainAgentOperation, error)
TrainAgent trains the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.TrainAgentRequest{ // TODO: Fill request struct fields. } op, err := c.TrainAgent(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*AgentsClient) TrainAgentOperation ¶
func (c *AgentsClient) TrainAgentOperation(name string) *TrainAgentOperation
TrainAgentOperation returns a new TrainAgentOperation from a given name. The name must be that of a previously created TrainAgentOperation, possibly from a different process.
type AnswerRecordIterator ¶ added in v1.42.0
type AnswerRecordIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.AnswerRecord, nextPageToken string, err error) // contains filtered or unexported fields }
AnswerRecordIterator manages a stream of *dialogflowpb.AnswerRecord.
func (*AnswerRecordIterator) Next ¶ added in v1.42.0
func (it *AnswerRecordIterator) Next() (*dialogflowpb.AnswerRecord, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AnswerRecordIterator) PageInfo ¶ added in v1.42.0
func (it *AnswerRecordIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AnswerRecordsCallOptions ¶ added in v1.42.0
type AnswerRecordsCallOptions struct { ListAnswerRecords []gax.CallOption UpdateAnswerRecord []gax.CallOption }
AnswerRecordsCallOptions contains the retry settings for each method of AnswerRecordsClient.
type AnswerRecordsClient ¶ added in v1.42.0
type AnswerRecordsClient struct { // The call options for this service. CallOptions *AnswerRecordsCallOptions // contains filtered or unexported fields }
AnswerRecordsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing AnswerRecords.
func NewAnswerRecordsClient ¶ added in v1.42.0
func NewAnswerRecordsClient(ctx context.Context, opts ...option.ClientOption) (*AnswerRecordsClient, error)
NewAnswerRecordsClient creates a new answer records client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing AnswerRecords.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAnswerRecordsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*AnswerRecordsClient) Close ¶ added in v1.42.0
func (c *AnswerRecordsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AnswerRecordsClient) Connection ¶ added in v1.42.0
func (c *AnswerRecordsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*AnswerRecordsClient) ListAnswerRecords ¶ added in v1.42.0
func (c *AnswerRecordsClient) ListAnswerRecords(ctx context.Context, req *dialogflowpb.ListAnswerRecordsRequest, opts ...gax.CallOption) *AnswerRecordIterator
ListAnswerRecords returns the list of all answer records in the specified project in reverse chronological order.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAnswerRecordsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListAnswerRecordsRequest{ // TODO: Fill request struct fields. } it := c.ListAnswerRecords(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*AnswerRecordsClient) UpdateAnswerRecord ¶ added in v1.42.0
func (c *AnswerRecordsClient) UpdateAnswerRecord(ctx context.Context, req *dialogflowpb.UpdateAnswerRecordRequest, opts ...gax.CallOption) (*dialogflowpb.AnswerRecord, error)
UpdateAnswerRecord updates the specified answer record.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewAnswerRecordsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateAnswerRecordRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateAnswerRecord(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type BatchCreateEntitiesOperation ¶
type BatchCreateEntitiesOperation struct {
// contains filtered or unexported fields
}
BatchCreateEntitiesOperation manages a long-running operation from BatchCreateEntities.
func (*BatchCreateEntitiesOperation) Done ¶
func (op *BatchCreateEntitiesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchCreateEntitiesOperation) Metadata ¶
func (op *BatchCreateEntitiesOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchCreateEntitiesOperation) Name ¶
func (op *BatchCreateEntitiesOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchCreateEntitiesOperation) Poll ¶
func (op *BatchCreateEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchCreateEntitiesOperation) Wait ¶
func (op *BatchCreateEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type BatchDeleteEntitiesOperation ¶
type BatchDeleteEntitiesOperation struct {
// contains filtered or unexported fields
}
BatchDeleteEntitiesOperation manages a long-running operation from BatchDeleteEntities.
func (*BatchDeleteEntitiesOperation) Done ¶
func (op *BatchDeleteEntitiesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchDeleteEntitiesOperation) Metadata ¶
func (op *BatchDeleteEntitiesOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchDeleteEntitiesOperation) Name ¶
func (op *BatchDeleteEntitiesOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchDeleteEntitiesOperation) Poll ¶
func (op *BatchDeleteEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchDeleteEntitiesOperation) Wait ¶
func (op *BatchDeleteEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type BatchDeleteEntityTypesOperation ¶
type BatchDeleteEntityTypesOperation struct {
// contains filtered or unexported fields
}
BatchDeleteEntityTypesOperation manages a long-running operation from BatchDeleteEntityTypes.
func (*BatchDeleteEntityTypesOperation) Done ¶
func (op *BatchDeleteEntityTypesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchDeleteEntityTypesOperation) Metadata ¶
func (op *BatchDeleteEntityTypesOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchDeleteEntityTypesOperation) Name ¶
func (op *BatchDeleteEntityTypesOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchDeleteEntityTypesOperation) Poll ¶
func (op *BatchDeleteEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchDeleteEntityTypesOperation) Wait ¶
func (op *BatchDeleteEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type BatchDeleteIntentsOperation ¶
type BatchDeleteIntentsOperation struct {
// contains filtered or unexported fields
}
BatchDeleteIntentsOperation manages a long-running operation from BatchDeleteIntents.
func (*BatchDeleteIntentsOperation) Done ¶
func (op *BatchDeleteIntentsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchDeleteIntentsOperation) Metadata ¶
func (op *BatchDeleteIntentsOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchDeleteIntentsOperation) Name ¶
func (op *BatchDeleteIntentsOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchDeleteIntentsOperation) Poll ¶
func (op *BatchDeleteIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchDeleteIntentsOperation) Wait ¶
func (op *BatchDeleteIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type BatchUpdateEntitiesOperation ¶
type BatchUpdateEntitiesOperation struct {
// contains filtered or unexported fields
}
BatchUpdateEntitiesOperation manages a long-running operation from BatchUpdateEntities.
func (*BatchUpdateEntitiesOperation) Done ¶
func (op *BatchUpdateEntitiesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchUpdateEntitiesOperation) Metadata ¶
func (op *BatchUpdateEntitiesOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchUpdateEntitiesOperation) Name ¶
func (op *BatchUpdateEntitiesOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchUpdateEntitiesOperation) Poll ¶
func (op *BatchUpdateEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchUpdateEntitiesOperation) Wait ¶
func (op *BatchUpdateEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type BatchUpdateEntityTypesOperation ¶
type BatchUpdateEntityTypesOperation struct {
// contains filtered or unexported fields
}
BatchUpdateEntityTypesOperation manages a long-running operation from BatchUpdateEntityTypes.
func (*BatchUpdateEntityTypesOperation) Done ¶
func (op *BatchUpdateEntityTypesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchUpdateEntityTypesOperation) Metadata ¶
func (op *BatchUpdateEntityTypesOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchUpdateEntityTypesOperation) Name ¶
func (op *BatchUpdateEntityTypesOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchUpdateEntityTypesOperation) Poll ¶
func (op *BatchUpdateEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateEntityTypesResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchUpdateEntityTypesOperation) Wait ¶
func (op *BatchUpdateEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateEntityTypesResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type BatchUpdateIntentsOperation ¶
type BatchUpdateIntentsOperation struct {
// contains filtered or unexported fields
}
BatchUpdateIntentsOperation manages a long-running operation from BatchUpdateIntents.
func (*BatchUpdateIntentsOperation) Done ¶
func (op *BatchUpdateIntentsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchUpdateIntentsOperation) Metadata ¶
func (op *BatchUpdateIntentsOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchUpdateIntentsOperation) Name ¶
func (op *BatchUpdateIntentsOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchUpdateIntentsOperation) Poll ¶
func (op *BatchUpdateIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateIntentsResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchUpdateIntentsOperation) Wait ¶
func (op *BatchUpdateIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateIntentsResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ContextIterator ¶
type ContextIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Context, nextPageToken string, err error) // contains filtered or unexported fields }
ContextIterator manages a stream of *dialogflowpb.Context.
func (*ContextIterator) Next ¶
func (it *ContextIterator) Next() (*dialogflowpb.Context, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ContextIterator) PageInfo ¶
func (it *ContextIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ContextsCallOptions ¶
type ContextsCallOptions struct { ListContexts []gax.CallOption GetContext []gax.CallOption CreateContext []gax.CallOption UpdateContext []gax.CallOption DeleteContext []gax.CallOption DeleteAllContexts []gax.CallOption }
ContextsCallOptions contains the retry settings for each method of ContextsClient.
type ContextsClient ¶
type ContextsClient struct { // The call options for this service. CallOptions *ContextsCallOptions // contains filtered or unexported fields }
ContextsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Contexts.
func NewContextsClient ¶
func NewContextsClient(ctx context.Context, opts ...option.ClientOption) (*ContextsClient, error)
NewContextsClient creates a new contexts client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Contexts.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewContextsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ContextsClient) Close ¶
func (c *ContextsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ContextsClient) Connection ¶
func (c *ContextsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ContextsClient) CreateContext ¶
func (c *ContextsClient) CreateContext(ctx context.Context, req *dialogflowpb.CreateContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error)
CreateContext creates a context.
If the specified context already exists, overrides the context.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewContextsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateContextRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateContext(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ContextsClient) DeleteAllContexts ¶
func (c *ContextsClient) DeleteAllContexts(ctx context.Context, req *dialogflowpb.DeleteAllContextsRequest, opts ...gax.CallOption) error
DeleteAllContexts deletes all active contexts in the specified session.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewContextsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteAllContextsRequest{ // TODO: Fill request struct fields. } err = c.DeleteAllContexts(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*ContextsClient) DeleteContext ¶
func (c *ContextsClient) DeleteContext(ctx context.Context, req *dialogflowpb.DeleteContextRequest, opts ...gax.CallOption) error
DeleteContext deletes the specified context.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewContextsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteContextRequest{ // TODO: Fill request struct fields. } err = c.DeleteContext(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*ContextsClient) GetContext ¶
func (c *ContextsClient) GetContext(ctx context.Context, req *dialogflowpb.GetContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error)
GetContext retrieves the specified context.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewContextsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetContextRequest{ // TODO: Fill request struct fields. } resp, err := c.GetContext(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ContextsClient) ListContexts ¶
func (c *ContextsClient) ListContexts(ctx context.Context, req *dialogflowpb.ListContextsRequest, opts ...gax.CallOption) *ContextIterator
ListContexts returns the list of all contexts in the specified session.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewContextsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListContextsRequest{ // TODO: Fill request struct fields. } it := c.ListContexts(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*ContextsClient) UpdateContext ¶
func (c *ContextsClient) UpdateContext(ctx context.Context, req *dialogflowpb.UpdateContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error)
UpdateContext updates the specified context.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewContextsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateContextRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateContext(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ConversationIterator ¶ added in v1.42.0
type ConversationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Conversation, nextPageToken string, err error) // contains filtered or unexported fields }
ConversationIterator manages a stream of *dialogflowpb.Conversation.
func (*ConversationIterator) Next ¶ added in v1.42.0
func (it *ConversationIterator) Next() (*dialogflowpb.Conversation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ConversationIterator) PageInfo ¶ added in v1.42.0
func (it *ConversationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ConversationProfileIterator ¶ added in v1.42.0
type ConversationProfileIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.ConversationProfile, nextPageToken string, err error) // contains filtered or unexported fields }
ConversationProfileIterator manages a stream of *dialogflowpb.ConversationProfile.
func (*ConversationProfileIterator) Next ¶ added in v1.42.0
func (it *ConversationProfileIterator) Next() (*dialogflowpb.ConversationProfile, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ConversationProfileIterator) PageInfo ¶ added in v1.42.0
func (it *ConversationProfileIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ConversationProfilesCallOptions ¶ added in v1.42.0
type ConversationProfilesCallOptions struct { ListConversationProfiles []gax.CallOption GetConversationProfile []gax.CallOption CreateConversationProfile []gax.CallOption UpdateConversationProfile []gax.CallOption DeleteConversationProfile []gax.CallOption }
ConversationProfilesCallOptions contains the retry settings for each method of ConversationProfilesClient.
type ConversationProfilesClient ¶ added in v1.42.0
type ConversationProfilesClient struct { // The call options for this service. CallOptions *ConversationProfilesCallOptions // contains filtered or unexported fields }
ConversationProfilesClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing ConversationProfiles.
func NewConversationProfilesClient ¶ added in v1.42.0
func NewConversationProfilesClient(ctx context.Context, opts ...option.ClientOption) (*ConversationProfilesClient, error)
NewConversationProfilesClient creates a new conversation profiles client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing ConversationProfiles.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationProfilesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ConversationProfilesClient) Close ¶ added in v1.42.0
func (c *ConversationProfilesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ConversationProfilesClient) Connection ¶ added in v1.42.0
func (c *ConversationProfilesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ConversationProfilesClient) CreateConversationProfile ¶ added in v1.42.0
func (c *ConversationProfilesClient) CreateConversationProfile(ctx context.Context, req *dialogflowpb.CreateConversationProfileRequest, opts ...gax.CallOption) (*dialogflowpb.ConversationProfile, error)
CreateConversationProfile creates a conversation profile in the specified project.
ConversationProfile.CreateTime and ConversationProfile.UpdateTime aren’t populated in the response. You can retrieve them via GetConversationProfile API.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationProfilesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateConversationProfileRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateConversationProfile(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ConversationProfilesClient) DeleteConversationProfile ¶ added in v1.42.0
func (c *ConversationProfilesClient) DeleteConversationProfile(ctx context.Context, req *dialogflowpb.DeleteConversationProfileRequest, opts ...gax.CallOption) error
DeleteConversationProfile deletes the specified conversation profile.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationProfilesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteConversationProfileRequest{ // TODO: Fill request struct fields. } err = c.DeleteConversationProfile(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*ConversationProfilesClient) GetConversationProfile ¶ added in v1.42.0
func (c *ConversationProfilesClient) GetConversationProfile(ctx context.Context, req *dialogflowpb.GetConversationProfileRequest, opts ...gax.CallOption) (*dialogflowpb.ConversationProfile, error)
GetConversationProfile retrieves the specified conversation profile.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationProfilesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetConversationProfileRequest{ // TODO: Fill request struct fields. } resp, err := c.GetConversationProfile(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ConversationProfilesClient) ListConversationProfiles ¶ added in v1.42.0
func (c *ConversationProfilesClient) ListConversationProfiles(ctx context.Context, req *dialogflowpb.ListConversationProfilesRequest, opts ...gax.CallOption) *ConversationProfileIterator
ListConversationProfiles returns the list of all conversation profiles in the specified project.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationProfilesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListConversationProfilesRequest{ // TODO: Fill request struct fields. } it := c.ListConversationProfiles(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*ConversationProfilesClient) UpdateConversationProfile ¶ added in v1.42.0
func (c *ConversationProfilesClient) UpdateConversationProfile(ctx context.Context, req *dialogflowpb.UpdateConversationProfileRequest, opts ...gax.CallOption) (*dialogflowpb.ConversationProfile, error)
UpdateConversationProfile updates the specified conversation profile.
ConversationProfile.CreateTime and ConversationProfile.UpdateTime aren’t populated in the response. You can retrieve them via GetConversationProfile API.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationProfilesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateConversationProfileRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateConversationProfile(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ConversationsCallOptions ¶ added in v1.42.0
type ConversationsCallOptions struct { CreateConversation []gax.CallOption ListConversations []gax.CallOption GetConversation []gax.CallOption CompleteConversation []gax.CallOption ListMessages []gax.CallOption }
ConversationsCallOptions contains the retry settings for each method of ConversationsClient.
type ConversationsClient ¶ added in v1.42.0
type ConversationsClient struct { // The call options for this service. CallOptions *ConversationsCallOptions // contains filtered or unexported fields }
ConversationsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Conversations.
func NewConversationsClient ¶ added in v1.42.0
func NewConversationsClient(ctx context.Context, opts ...option.ClientOption) (*ConversationsClient, error)
NewConversationsClient creates a new conversations client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Conversations.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ConversationsClient) Close ¶ added in v1.42.0
func (c *ConversationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ConversationsClient) CompleteConversation ¶ added in v1.42.0
func (c *ConversationsClient) CompleteConversation(ctx context.Context, req *dialogflowpb.CompleteConversationRequest, opts ...gax.CallOption) (*dialogflowpb.Conversation, error)
CompleteConversation completes the specified conversation. Finished conversations are purged from the database after 30 days.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CompleteConversationRequest{ // TODO: Fill request struct fields. } resp, err := c.CompleteConversation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ConversationsClient) Connection ¶ added in v1.42.0
func (c *ConversationsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ConversationsClient) CreateConversation ¶ added in v1.42.0
func (c *ConversationsClient) CreateConversation(ctx context.Context, req *dialogflowpb.CreateConversationRequest, opts ...gax.CallOption) (*dialogflowpb.Conversation, error)
CreateConversation creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there’s no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If Conversation.conversation_profile is configured for a dialogflow agent, conversation will start from Automated Agent Stage, otherwise, it will start from Assist Stage. And during Automated Agent Stage, once an Intent with Intent.live_agent_handoff is triggered, conversation will transfer to Assist Stage.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateConversationRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateConversation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ConversationsClient) GetConversation ¶ added in v1.42.0
func (c *ConversationsClient) GetConversation(ctx context.Context, req *dialogflowpb.GetConversationRequest, opts ...gax.CallOption) (*dialogflowpb.Conversation, error)
GetConversation retrieves the specific conversation.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetConversationRequest{ // TODO: Fill request struct fields. } resp, err := c.GetConversation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ConversationsClient) ListConversations ¶ added in v1.42.0
func (c *ConversationsClient) ListConversations(ctx context.Context, req *dialogflowpb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator
ListConversations returns the list of all conversations in the specified project.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListConversationsRequest{ // TODO: Fill request struct fields. } it := c.ListConversations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*ConversationsClient) ListMessages ¶ added in v1.42.0
func (c *ConversationsClient) ListMessages(ctx context.Context, req *dialogflowpb.ListMessagesRequest, opts ...gax.CallOption) *MessageIterator
ListMessages lists messages that belong to a given conversation. messages are ordered by create_time in descending order. To fetch updates without duplication, send request with filter create_time_epoch_microseconds > [first item's create_time of previous request] and empty page_token.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewConversationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListMessagesRequest{ // TODO: Fill request struct fields. } it := c.ListMessages(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
type CreateDocumentOperation ¶ added in v1.42.0
type CreateDocumentOperation struct {
// contains filtered or unexported fields
}
CreateDocumentOperation manages a long-running operation from CreateDocument.
func (*CreateDocumentOperation) Done ¶ added in v1.42.0
func (op *CreateDocumentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateDocumentOperation) Metadata ¶ added in v1.42.0
func (op *CreateDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateDocumentOperation) Name ¶ added in v1.42.0
func (op *CreateDocumentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateDocumentOperation) Poll ¶ added in v1.42.0
func (op *CreateDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateDocumentOperation) Wait ¶ added in v1.42.0
func (op *CreateDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteDocumentOperation ¶ added in v1.42.0
type DeleteDocumentOperation struct {
// contains filtered or unexported fields
}
DeleteDocumentOperation manages a long-running operation from DeleteDocument.
func (*DeleteDocumentOperation) Done ¶ added in v1.42.0
func (op *DeleteDocumentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteDocumentOperation) Metadata ¶ added in v1.42.0
func (op *DeleteDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteDocumentOperation) Name ¶ added in v1.42.0
func (op *DeleteDocumentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteDocumentOperation) Poll ¶ added in v1.42.0
func (op *DeleteDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteDocumentOperation) Wait ¶ added in v1.42.0
func (op *DeleteDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DocumentIterator ¶ added in v1.42.0
type DocumentIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Document, nextPageToken string, err error) // contains filtered or unexported fields }
DocumentIterator manages a stream of *dialogflowpb.Document.
func (*DocumentIterator) Next ¶ added in v1.42.0
func (it *DocumentIterator) Next() (*dialogflowpb.Document, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DocumentIterator) PageInfo ¶ added in v1.42.0
func (it *DocumentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DocumentsCallOptions ¶ added in v1.42.0
type DocumentsCallOptions struct { ListDocuments []gax.CallOption GetDocument []gax.CallOption CreateDocument []gax.CallOption DeleteDocument []gax.CallOption UpdateDocument []gax.CallOption ReloadDocument []gax.CallOption }
DocumentsCallOptions contains the retry settings for each method of DocumentsClient.
type DocumentsClient ¶ added in v1.42.0
type DocumentsClient struct { // The call options for this service. CallOptions *DocumentsCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
DocumentsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing knowledge Documents.
func NewDocumentsClient ¶ added in v1.42.0
func NewDocumentsClient(ctx context.Context, opts ...option.ClientOption) (*DocumentsClient, error)
NewDocumentsClient creates a new documents client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing knowledge Documents.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewDocumentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*DocumentsClient) Close ¶ added in v1.42.0
func (c *DocumentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DocumentsClient) Connection ¶ added in v1.42.0
func (c *DocumentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*DocumentsClient) CreateDocument ¶ added in v1.42.0
func (c *DocumentsClient) CreateDocument(ctx context.Context, req *dialogflowpb.CreateDocumentRequest, opts ...gax.CallOption) (*CreateDocumentOperation, error)
CreateDocument creates a new document.
Operation <response: Document, metadata: KnowledgeOperationMetadata>
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewDocumentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateDocumentRequest{ // TODO: Fill request struct fields. } op, err := c.CreateDocument(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*DocumentsClient) CreateDocumentOperation ¶ added in v1.42.0
func (c *DocumentsClient) CreateDocumentOperation(name string) *CreateDocumentOperation
CreateDocumentOperation returns a new CreateDocumentOperation from a given name. The name must be that of a previously created CreateDocumentOperation, possibly from a different process.
func (*DocumentsClient) DeleteDocument ¶ added in v1.42.0
func (c *DocumentsClient) DeleteDocument(ctx context.Context, req *dialogflowpb.DeleteDocumentRequest, opts ...gax.CallOption) (*DeleteDocumentOperation, error)
DeleteDocument deletes the specified document.
Operation <response: google.protobuf.Empty, metadata: KnowledgeOperationMetadata>
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewDocumentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteDocumentRequest{ // TODO: Fill request struct fields. } op, err := c.DeleteDocument(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*DocumentsClient) DeleteDocumentOperation ¶ added in v1.42.0
func (c *DocumentsClient) DeleteDocumentOperation(name string) *DeleteDocumentOperation
DeleteDocumentOperation returns a new DeleteDocumentOperation from a given name. The name must be that of a previously created DeleteDocumentOperation, possibly from a different process.
func (*DocumentsClient) GetDocument ¶ added in v1.42.0
func (c *DocumentsClient) GetDocument(ctx context.Context, req *dialogflowpb.GetDocumentRequest, opts ...gax.CallOption) (*dialogflowpb.Document, error)
GetDocument retrieves the specified document.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewDocumentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetDocumentRequest{ // TODO: Fill request struct fields. } resp, err := c.GetDocument(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*DocumentsClient) ListDocuments ¶ added in v1.42.0
func (c *DocumentsClient) ListDocuments(ctx context.Context, req *dialogflowpb.ListDocumentsRequest, opts ...gax.CallOption) *DocumentIterator
ListDocuments returns the list of all documents of the knowledge base.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewDocumentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListDocumentsRequest{ // TODO: Fill request struct fields. } it := c.ListDocuments(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*DocumentsClient) ReloadDocument ¶ added in v1.42.0
func (c *DocumentsClient) ReloadDocument(ctx context.Context, req *dialogflowpb.ReloadDocumentRequest, opts ...gax.CallOption) (*ReloadDocumentOperation, error)
ReloadDocument reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents resource is deprecated; only use projects.knowledgeBases.documents.
Operation <response: Document, metadata: KnowledgeOperationMetadata>
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewDocumentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ReloadDocumentRequest{ // TODO: Fill request struct fields. } op, err := c.ReloadDocument(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*DocumentsClient) ReloadDocumentOperation ¶ added in v1.42.0
func (c *DocumentsClient) ReloadDocumentOperation(name string) *ReloadDocumentOperation
ReloadDocumentOperation returns a new ReloadDocumentOperation from a given name. The name must be that of a previously created ReloadDocumentOperation, possibly from a different process.
func (*DocumentsClient) UpdateDocument ¶ added in v1.42.0
func (c *DocumentsClient) UpdateDocument(ctx context.Context, req *dialogflowpb.UpdateDocumentRequest, opts ...gax.CallOption) (*UpdateDocumentOperation, error)
UpdateDocument updates the specified document.
Operation <response: Document, metadata: KnowledgeOperationMetadata>
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewDocumentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateDocumentRequest{ // TODO: Fill request struct fields. } op, err := c.UpdateDocument(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*DocumentsClient) UpdateDocumentOperation ¶ added in v1.42.0
func (c *DocumentsClient) UpdateDocumentOperation(name string) *UpdateDocumentOperation
UpdateDocumentOperation returns a new UpdateDocumentOperation from a given name. The name must be that of a previously created UpdateDocumentOperation, possibly from a different process.
type EntityTypeIterator ¶
type EntityTypeIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.EntityType, nextPageToken string, err error) // contains filtered or unexported fields }
EntityTypeIterator manages a stream of *dialogflowpb.EntityType.
func (*EntityTypeIterator) Next ¶
func (it *EntityTypeIterator) Next() (*dialogflowpb.EntityType, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*EntityTypeIterator) PageInfo ¶
func (it *EntityTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EntityTypesCallOptions ¶
type EntityTypesCallOptions struct { ListEntityTypes []gax.CallOption GetEntityType []gax.CallOption CreateEntityType []gax.CallOption UpdateEntityType []gax.CallOption DeleteEntityType []gax.CallOption BatchUpdateEntityTypes []gax.CallOption BatchDeleteEntityTypes []gax.CallOption BatchCreateEntities []gax.CallOption BatchUpdateEntities []gax.CallOption BatchDeleteEntities []gax.CallOption }
EntityTypesCallOptions contains the retry settings for each method of EntityTypesClient.
type EntityTypesClient ¶
type EntityTypesClient struct { // The call options for this service. CallOptions *EntityTypesCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
EntityTypesClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing EntityTypes.
func NewEntityTypesClient ¶
func NewEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*EntityTypesClient, error)
NewEntityTypesClient creates a new entity types client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing EntityTypes.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*EntityTypesClient) BatchCreateEntities ¶
func (c *EntityTypesClient) BatchCreateEntities(ctx context.Context, req *dialogflowpb.BatchCreateEntitiesRequest, opts ...gax.CallOption) (*BatchCreateEntitiesOperation, error)
BatchCreateEntities creates multiple new entities in the specified entity type.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.BatchCreateEntitiesRequest{ // TODO: Fill request struct fields. } op, err := c.BatchCreateEntities(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*EntityTypesClient) BatchCreateEntitiesOperation ¶
func (c *EntityTypesClient) BatchCreateEntitiesOperation(name string) *BatchCreateEntitiesOperation
BatchCreateEntitiesOperation returns a new BatchCreateEntitiesOperation from a given name. The name must be that of a previously created BatchCreateEntitiesOperation, possibly from a different process.
func (*EntityTypesClient) BatchDeleteEntities ¶
func (c *EntityTypesClient) BatchDeleteEntities(ctx context.Context, req *dialogflowpb.BatchDeleteEntitiesRequest, opts ...gax.CallOption) (*BatchDeleteEntitiesOperation, error)
BatchDeleteEntities deletes entities in the specified entity type.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.BatchDeleteEntitiesRequest{ // TODO: Fill request struct fields. } op, err := c.BatchDeleteEntities(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*EntityTypesClient) BatchDeleteEntitiesOperation ¶
func (c *EntityTypesClient) BatchDeleteEntitiesOperation(name string) *BatchDeleteEntitiesOperation
BatchDeleteEntitiesOperation returns a new BatchDeleteEntitiesOperation from a given name. The name must be that of a previously created BatchDeleteEntitiesOperation, possibly from a different process.
func (*EntityTypesClient) BatchDeleteEntityTypes ¶
func (c *EntityTypesClient) BatchDeleteEntityTypes(ctx context.Context, req *dialogflowpb.BatchDeleteEntityTypesRequest, opts ...gax.CallOption) (*BatchDeleteEntityTypesOperation, error)
BatchDeleteEntityTypes deletes entity types in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.BatchDeleteEntityTypesRequest{ // TODO: Fill request struct fields. } op, err := c.BatchDeleteEntityTypes(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*EntityTypesClient) BatchDeleteEntityTypesOperation ¶
func (c *EntityTypesClient) BatchDeleteEntityTypesOperation(name string) *BatchDeleteEntityTypesOperation
BatchDeleteEntityTypesOperation returns a new BatchDeleteEntityTypesOperation from a given name. The name must be that of a previously created BatchDeleteEntityTypesOperation, possibly from a different process.
func (*EntityTypesClient) BatchUpdateEntities ¶
func (c *EntityTypesClient) BatchUpdateEntities(ctx context.Context, req *dialogflowpb.BatchUpdateEntitiesRequest, opts ...gax.CallOption) (*BatchUpdateEntitiesOperation, error)
BatchUpdateEntities updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren’t explicitly specified in the request.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.BatchUpdateEntitiesRequest{ // TODO: Fill request struct fields. } op, err := c.BatchUpdateEntities(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*EntityTypesClient) BatchUpdateEntitiesOperation ¶
func (c *EntityTypesClient) BatchUpdateEntitiesOperation(name string) *BatchUpdateEntitiesOperation
BatchUpdateEntitiesOperation returns a new BatchUpdateEntitiesOperation from a given name. The name must be that of a previously created BatchUpdateEntitiesOperation, possibly from a different process.
func (*EntityTypesClient) BatchUpdateEntityTypes ¶
func (c *EntityTypesClient) BatchUpdateEntityTypes(ctx context.Context, req *dialogflowpb.BatchUpdateEntityTypesRequest, opts ...gax.CallOption) (*BatchUpdateEntityTypesOperation, error)
BatchUpdateEntityTypes updates/Creates multiple entity types in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.BatchUpdateEntityTypesRequest{ // TODO: Fill request struct fields. } op, err := c.BatchUpdateEntityTypes(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EntityTypesClient) BatchUpdateEntityTypesOperation ¶
func (c *EntityTypesClient) BatchUpdateEntityTypesOperation(name string) *BatchUpdateEntityTypesOperation
BatchUpdateEntityTypesOperation returns a new BatchUpdateEntityTypesOperation from a given name. The name must be that of a previously created BatchUpdateEntityTypesOperation, possibly from a different process.
func (*EntityTypesClient) Close ¶
func (c *EntityTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*EntityTypesClient) Connection ¶
func (c *EntityTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*EntityTypesClient) CreateEntityType ¶
func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *dialogflowpb.CreateEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error)
CreateEntityType creates an entity type in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateEntityTypeRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateEntityType(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EntityTypesClient) DeleteEntityType ¶
func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *dialogflowpb.DeleteEntityTypeRequest, opts ...gax.CallOption) error
DeleteEntityType deletes the specified entity type.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteEntityTypeRequest{ // TODO: Fill request struct fields. } err = c.DeleteEntityType(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*EntityTypesClient) GetEntityType ¶
func (c *EntityTypesClient) GetEntityType(ctx context.Context, req *dialogflowpb.GetEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error)
GetEntityType retrieves the specified entity type.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetEntityTypeRequest{ // TODO: Fill request struct fields. } resp, err := c.GetEntityType(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EntityTypesClient) ListEntityTypes ¶
func (c *EntityTypesClient) ListEntityTypes(ctx context.Context, req *dialogflowpb.ListEntityTypesRequest, opts ...gax.CallOption) *EntityTypeIterator
ListEntityTypes returns the list of all entity types in the specified agent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListEntityTypesRequest{ // TODO: Fill request struct fields. } it := c.ListEntityTypes(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*EntityTypesClient) UpdateEntityType ¶
func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *dialogflowpb.UpdateEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error)
UpdateEntityType updates the specified entity type.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateEntityTypeRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateEntityType(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type EnvironmentHistory_EntryIterator ¶ added in v1.42.0
type EnvironmentHistory_EntryIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.EnvironmentHistory_Entry, nextPageToken string, err error) // contains filtered or unexported fields }
EnvironmentHistory_EntryIterator manages a stream of *dialogflowpb.EnvironmentHistory_Entry.
func (*EnvironmentHistory_EntryIterator) Next ¶ added in v1.42.0
func (it *EnvironmentHistory_EntryIterator) Next() (*dialogflowpb.EnvironmentHistory_Entry, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*EnvironmentHistory_EntryIterator) PageInfo ¶ added in v1.42.0
func (it *EnvironmentHistory_EntryIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EnvironmentIterator ¶ added in v1.42.0
type EnvironmentIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Environment, nextPageToken string, err error) // contains filtered or unexported fields }
EnvironmentIterator manages a stream of *dialogflowpb.Environment.
func (*EnvironmentIterator) Next ¶ added in v1.42.0
func (it *EnvironmentIterator) Next() (*dialogflowpb.Environment, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*EnvironmentIterator) PageInfo ¶ added in v1.42.0
func (it *EnvironmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EnvironmentsCallOptions ¶ added in v1.42.0
type EnvironmentsCallOptions struct { ListEnvironments []gax.CallOption GetEnvironment []gax.CallOption CreateEnvironment []gax.CallOption UpdateEnvironment []gax.CallOption DeleteEnvironment []gax.CallOption GetEnvironmentHistory []gax.CallOption }
EnvironmentsCallOptions contains the retry settings for each method of EnvironmentsClient.
type EnvironmentsClient ¶ added in v1.42.0
type EnvironmentsClient struct { // The call options for this service. CallOptions *EnvironmentsCallOptions // contains filtered or unexported fields }
EnvironmentsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Environments.
func NewEnvironmentsClient ¶ added in v1.42.0
func NewEnvironmentsClient(ctx context.Context, opts ...option.ClientOption) (*EnvironmentsClient, error)
NewEnvironmentsClient creates a new environments client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Environments.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*EnvironmentsClient) Close ¶ added in v1.42.0
func (c *EnvironmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*EnvironmentsClient) Connection ¶ added in v1.42.0
func (c *EnvironmentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*EnvironmentsClient) CreateEnvironment ¶ added in v1.42.0
func (c *EnvironmentsClient) CreateEnvironment(ctx context.Context, req *dialogflowpb.CreateEnvironmentRequest, opts ...gax.CallOption) (*dialogflowpb.Environment, error)
CreateEnvironment creates an agent environment.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateEnvironmentRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateEnvironment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) DeleteEnvironment ¶ added in v1.42.0
func (c *EnvironmentsClient) DeleteEnvironment(ctx context.Context, req *dialogflowpb.DeleteEnvironmentRequest, opts ...gax.CallOption) error
DeleteEnvironment deletes the specified agent environment.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteEnvironmentRequest{ // TODO: Fill request struct fields. } err = c.DeleteEnvironment(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*EnvironmentsClient) GetEnvironment ¶ added in v1.42.0
func (c *EnvironmentsClient) GetEnvironment(ctx context.Context, req *dialogflowpb.GetEnvironmentRequest, opts ...gax.CallOption) (*dialogflowpb.Environment, error)
GetEnvironment retrieves the specified agent environment.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetEnvironmentRequest{ // TODO: Fill request struct fields. } resp, err := c.GetEnvironment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EnvironmentsClient) GetEnvironmentHistory ¶ added in v1.42.0
func (c *EnvironmentsClient) GetEnvironmentHistory(ctx context.Context, req *dialogflowpb.GetEnvironmentHistoryRequest, opts ...gax.CallOption) *EnvironmentHistory_EntryIterator
GetEnvironmentHistory gets the history of the specified environment.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetEnvironmentHistoryRequest{ // TODO: Fill request struct fields. } it := c.GetEnvironmentHistory(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*EnvironmentsClient) ListEnvironments ¶ added in v1.42.0
func (c *EnvironmentsClient) ListEnvironments(ctx context.Context, req *dialogflowpb.ListEnvironmentsRequest, opts ...gax.CallOption) *EnvironmentIterator
ListEnvironments returns the list of all non-draft environments of the specified agent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListEnvironmentsRequest{ // TODO: Fill request struct fields. } it := c.ListEnvironments(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*EnvironmentsClient) UpdateEnvironment ¶ added in v1.42.0
func (c *EnvironmentsClient) UpdateEnvironment(ctx context.Context, req *dialogflowpb.UpdateEnvironmentRequest, opts ...gax.CallOption) (*dialogflowpb.Environment, error)
UpdateEnvironment updates the specified agent environment.
This method allows you to deploy new agent versions into the environment. When an environment is pointed to a new agent version by setting environment.agent_version, the environment is temporarily set to the LOADING state. During that time, the environment keeps on serving the previous version of the agent. After the new agent version is done loading, the environment is set back to the RUNNING state. You can use “-” as Environment ID in environment name to update version in “draft” environment. WARNING: this will negate all recent changes to draft and can’t be undone. You may want to save the draft to a version before calling this function.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateEnvironmentRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateEnvironment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ExportAgentOperation ¶
type ExportAgentOperation struct {
// contains filtered or unexported fields
}
ExportAgentOperation manages a long-running operation from ExportAgent.
func (*ExportAgentOperation) Done ¶
func (op *ExportAgentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ExportAgentOperation) Metadata ¶
func (op *ExportAgentOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ExportAgentOperation) Name ¶
func (op *ExportAgentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*ExportAgentOperation) Poll ¶
func (op *ExportAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.ExportAgentResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*ExportAgentOperation) Wait ¶
func (op *ExportAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.ExportAgentResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type FulfillmentsCallOptions ¶ added in v1.42.0
type FulfillmentsCallOptions struct { GetFulfillment []gax.CallOption UpdateFulfillment []gax.CallOption }
FulfillmentsCallOptions contains the retry settings for each method of FulfillmentsClient.
type FulfillmentsClient ¶ added in v1.42.0
type FulfillmentsClient struct { // The call options for this service. CallOptions *FulfillmentsCallOptions // contains filtered or unexported fields }
FulfillmentsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Fulfillments.
func NewFulfillmentsClient ¶ added in v1.42.0
func NewFulfillmentsClient(ctx context.Context, opts ...option.ClientOption) (*FulfillmentsClient, error)
NewFulfillmentsClient creates a new fulfillments client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Fulfillments.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewFulfillmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*FulfillmentsClient) Close ¶ added in v1.42.0
func (c *FulfillmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*FulfillmentsClient) Connection ¶ added in v1.42.0
func (c *FulfillmentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*FulfillmentsClient) GetFulfillment ¶ added in v1.42.0
func (c *FulfillmentsClient) GetFulfillment(ctx context.Context, req *dialogflowpb.GetFulfillmentRequest, opts ...gax.CallOption) (*dialogflowpb.Fulfillment, error)
GetFulfillment retrieves the fulfillment.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewFulfillmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetFulfillmentRequest{ // TODO: Fill request struct fields. } resp, err := c.GetFulfillment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*FulfillmentsClient) UpdateFulfillment ¶ added in v1.42.0
func (c *FulfillmentsClient) UpdateFulfillment(ctx context.Context, req *dialogflowpb.UpdateFulfillmentRequest, opts ...gax.CallOption) (*dialogflowpb.Fulfillment, error)
UpdateFulfillment updates the fulfillment.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewFulfillmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateFulfillmentRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateFulfillment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ImportAgentOperation ¶
type ImportAgentOperation struct {
// contains filtered or unexported fields
}
ImportAgentOperation manages a long-running operation from ImportAgent.
func (*ImportAgentOperation) Done ¶
func (op *ImportAgentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ImportAgentOperation) Metadata ¶
func (op *ImportAgentOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ImportAgentOperation) Name ¶
func (op *ImportAgentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*ImportAgentOperation) Poll ¶
func (op *ImportAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*ImportAgentOperation) Wait ¶
func (op *ImportAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type IntentIterator ¶
type IntentIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Intent, nextPageToken string, err error) // contains filtered or unexported fields }
IntentIterator manages a stream of *dialogflowpb.Intent.
func (*IntentIterator) Next ¶
func (it *IntentIterator) Next() (*dialogflowpb.Intent, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*IntentIterator) PageInfo ¶
func (it *IntentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type IntentsCallOptions ¶
type IntentsCallOptions struct { ListIntents []gax.CallOption GetIntent []gax.CallOption CreateIntent []gax.CallOption UpdateIntent []gax.CallOption DeleteIntent []gax.CallOption BatchUpdateIntents []gax.CallOption BatchDeleteIntents []gax.CallOption }
IntentsCallOptions contains the retry settings for each method of IntentsClient.
type IntentsClient ¶
type IntentsClient struct { // The call options for this service. CallOptions *IntentsCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
IntentsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Intents.
func NewIntentsClient ¶
func NewIntentsClient(ctx context.Context, opts ...option.ClientOption) (*IntentsClient, error)
NewIntentsClient creates a new intents client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Intents.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*IntentsClient) BatchDeleteIntents ¶
func (c *IntentsClient) BatchDeleteIntents(ctx context.Context, req *dialogflowpb.BatchDeleteIntentsRequest, opts ...gax.CallOption) (*BatchDeleteIntentsOperation, error)
BatchDeleteIntents deletes intents in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.BatchDeleteIntentsRequest{ // TODO: Fill request struct fields. } op, err := c.BatchDeleteIntents(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*IntentsClient) BatchDeleteIntentsOperation ¶
func (c *IntentsClient) BatchDeleteIntentsOperation(name string) *BatchDeleteIntentsOperation
BatchDeleteIntentsOperation returns a new BatchDeleteIntentsOperation from a given name. The name must be that of a previously created BatchDeleteIntentsOperation, possibly from a different process.
func (*IntentsClient) BatchUpdateIntents ¶
func (c *IntentsClient) BatchUpdateIntents(ctx context.Context, req *dialogflowpb.BatchUpdateIntentsRequest, opts ...gax.CallOption) (*BatchUpdateIntentsOperation, error)
BatchUpdateIntents updates/Creates multiple intents in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.BatchUpdateIntentsRequest{ // TODO: Fill request struct fields. } op, err := c.BatchUpdateIntents(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IntentsClient) BatchUpdateIntentsOperation ¶
func (c *IntentsClient) BatchUpdateIntentsOperation(name string) *BatchUpdateIntentsOperation
BatchUpdateIntentsOperation returns a new BatchUpdateIntentsOperation from a given name. The name must be that of a previously created BatchUpdateIntentsOperation, possibly from a different process.
func (*IntentsClient) Close ¶
func (c *IntentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*IntentsClient) Connection ¶
func (c *IntentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*IntentsClient) CreateIntent ¶
func (c *IntentsClient) CreateIntent(ctx context.Context, req *dialogflowpb.CreateIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error)
CreateIntent creates an intent in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateIntentRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateIntent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IntentsClient) DeleteIntent ¶
func (c *IntentsClient) DeleteIntent(ctx context.Context, req *dialogflowpb.DeleteIntentRequest, opts ...gax.CallOption) error
DeleteIntent deletes the specified intent and its direct or indirect followup intents.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteIntentRequest{ // TODO: Fill request struct fields. } err = c.DeleteIntent(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*IntentsClient) GetIntent ¶
func (c *IntentsClient) GetIntent(ctx context.Context, req *dialogflowpb.GetIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error)
GetIntent retrieves the specified intent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetIntentRequest{ // TODO: Fill request struct fields. } resp, err := c.GetIntent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IntentsClient) ListIntents ¶
func (c *IntentsClient) ListIntents(ctx context.Context, req *dialogflowpb.ListIntentsRequest, opts ...gax.CallOption) *IntentIterator
ListIntents returns the list of all intents in the specified agent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListIntentsRequest{ // TODO: Fill request struct fields. } it := c.ListIntents(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*IntentsClient) UpdateIntent ¶
func (c *IntentsClient) UpdateIntent(ctx context.Context, req *dialogflowpb.UpdateIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error)
UpdateIntent updates the specified intent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateIntentRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateIntent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type KnowledgeBaseIterator ¶ added in v1.42.0
type KnowledgeBaseIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.KnowledgeBase, nextPageToken string, err error) // contains filtered or unexported fields }
KnowledgeBaseIterator manages a stream of *dialogflowpb.KnowledgeBase.
func (*KnowledgeBaseIterator) Next ¶ added in v1.42.0
func (it *KnowledgeBaseIterator) Next() (*dialogflowpb.KnowledgeBase, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*KnowledgeBaseIterator) PageInfo ¶ added in v1.42.0
func (it *KnowledgeBaseIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type KnowledgeBasesCallOptions ¶ added in v1.42.0
type KnowledgeBasesCallOptions struct { ListKnowledgeBases []gax.CallOption GetKnowledgeBase []gax.CallOption CreateKnowledgeBase []gax.CallOption DeleteKnowledgeBase []gax.CallOption UpdateKnowledgeBase []gax.CallOption }
KnowledgeBasesCallOptions contains the retry settings for each method of KnowledgeBasesClient.
type KnowledgeBasesClient ¶ added in v1.42.0
type KnowledgeBasesClient struct { // The call options for this service. CallOptions *KnowledgeBasesCallOptions // contains filtered or unexported fields }
KnowledgeBasesClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing KnowledgeBases.
func NewKnowledgeBasesClient ¶ added in v1.42.0
func NewKnowledgeBasesClient(ctx context.Context, opts ...option.ClientOption) (*KnowledgeBasesClient, error)
NewKnowledgeBasesClient creates a new knowledge bases client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing KnowledgeBases.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewKnowledgeBasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*KnowledgeBasesClient) Close ¶ added in v1.42.0
func (c *KnowledgeBasesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*KnowledgeBasesClient) Connection ¶ added in v1.42.0
func (c *KnowledgeBasesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*KnowledgeBasesClient) CreateKnowledgeBase ¶ added in v1.42.0
func (c *KnowledgeBasesClient) CreateKnowledgeBase(ctx context.Context, req *dialogflowpb.CreateKnowledgeBaseRequest, opts ...gax.CallOption) (*dialogflowpb.KnowledgeBase, error)
CreateKnowledgeBase creates a knowledge base.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewKnowledgeBasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateKnowledgeBaseRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateKnowledgeBase(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*KnowledgeBasesClient) DeleteKnowledgeBase ¶ added in v1.42.0
func (c *KnowledgeBasesClient) DeleteKnowledgeBase(ctx context.Context, req *dialogflowpb.DeleteKnowledgeBaseRequest, opts ...gax.CallOption) error
DeleteKnowledgeBase deletes the specified knowledge base.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewKnowledgeBasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteKnowledgeBaseRequest{ // TODO: Fill request struct fields. } err = c.DeleteKnowledgeBase(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*KnowledgeBasesClient) GetKnowledgeBase ¶ added in v1.42.0
func (c *KnowledgeBasesClient) GetKnowledgeBase(ctx context.Context, req *dialogflowpb.GetKnowledgeBaseRequest, opts ...gax.CallOption) (*dialogflowpb.KnowledgeBase, error)
GetKnowledgeBase retrieves the specified knowledge base.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewKnowledgeBasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetKnowledgeBaseRequest{ // TODO: Fill request struct fields. } resp, err := c.GetKnowledgeBase(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*KnowledgeBasesClient) ListKnowledgeBases ¶ added in v1.42.0
func (c *KnowledgeBasesClient) ListKnowledgeBases(ctx context.Context, req *dialogflowpb.ListKnowledgeBasesRequest, opts ...gax.CallOption) *KnowledgeBaseIterator
ListKnowledgeBases returns the list of all knowledge bases of the specified agent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewKnowledgeBasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListKnowledgeBasesRequest{ // TODO: Fill request struct fields. } it := c.ListKnowledgeBases(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*KnowledgeBasesClient) UpdateKnowledgeBase ¶ added in v1.42.0
func (c *KnowledgeBasesClient) UpdateKnowledgeBase(ctx context.Context, req *dialogflowpb.UpdateKnowledgeBaseRequest, opts ...gax.CallOption) (*dialogflowpb.KnowledgeBase, error)
UpdateKnowledgeBase updates the specified knowledge base.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewKnowledgeBasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateKnowledgeBaseRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateKnowledgeBase(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type MessageIterator ¶ added in v1.42.0
type MessageIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Message, nextPageToken string, err error) // contains filtered or unexported fields }
MessageIterator manages a stream of *dialogflowpb.Message.
func (*MessageIterator) Next ¶ added in v1.42.0
func (it *MessageIterator) Next() (*dialogflowpb.Message, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MessageIterator) PageInfo ¶ added in v1.42.0
func (it *MessageIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ParticipantIterator ¶ added in v1.42.0
type ParticipantIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Participant, nextPageToken string, err error) // contains filtered or unexported fields }
ParticipantIterator manages a stream of *dialogflowpb.Participant.
func (*ParticipantIterator) Next ¶ added in v1.42.0
func (it *ParticipantIterator) Next() (*dialogflowpb.Participant, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ParticipantIterator) PageInfo ¶ added in v1.42.0
func (it *ParticipantIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ParticipantsCallOptions ¶ added in v1.42.0
type ParticipantsCallOptions struct { CreateParticipant []gax.CallOption GetParticipant []gax.CallOption ListParticipants []gax.CallOption UpdateParticipant []gax.CallOption AnalyzeContent []gax.CallOption SuggestArticles []gax.CallOption SuggestFaqAnswers []gax.CallOption }
ParticipantsCallOptions contains the retry settings for each method of ParticipantsClient.
type ParticipantsClient ¶ added in v1.42.0
type ParticipantsClient struct { // The call options for this service. CallOptions *ParticipantsCallOptions // contains filtered or unexported fields }
ParticipantsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Participants.
func NewParticipantsClient ¶ added in v1.42.0
func NewParticipantsClient(ctx context.Context, opts ...option.ClientOption) (*ParticipantsClient, error)
NewParticipantsClient creates a new participants client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Participants.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ParticipantsClient) AnalyzeContent ¶ added in v1.42.0
func (c *ParticipantsClient) AnalyzeContent(ctx context.Context, req *dialogflowpb.AnalyzeContentRequest, opts ...gax.CallOption) (*dialogflowpb.AnalyzeContentResponse, error)
AnalyzeContent adds a text (chat, for example), or audio (phone recording, for example) message from a participant into the conversation.
Note: Always use agent versions for production traffic sent to virtual agents. See Versions and environments (at https://cloud.google.com/dialogflow/es/docs/agents-versions).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.AnalyzeContentRequest{ // TODO: Fill request struct fields. } resp, err := c.AnalyzeContent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ParticipantsClient) Close ¶ added in v1.42.0
func (c *ParticipantsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ParticipantsClient) Connection ¶ added in v1.42.0
func (c *ParticipantsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ParticipantsClient) CreateParticipant ¶ added in v1.42.0
func (c *ParticipantsClient) CreateParticipant(ctx context.Context, req *dialogflowpb.CreateParticipantRequest, opts ...gax.CallOption) (*dialogflowpb.Participant, error)
CreateParticipant creates a new participant in a conversation.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateParticipantRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateParticipant(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ParticipantsClient) GetParticipant ¶ added in v1.42.0
func (c *ParticipantsClient) GetParticipant(ctx context.Context, req *dialogflowpb.GetParticipantRequest, opts ...gax.CallOption) (*dialogflowpb.Participant, error)
GetParticipant retrieves a conversation participant.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetParticipantRequest{ // TODO: Fill request struct fields. } resp, err := c.GetParticipant(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ParticipantsClient) ListParticipants ¶ added in v1.42.0
func (c *ParticipantsClient) ListParticipants(ctx context.Context, req *dialogflowpb.ListParticipantsRequest, opts ...gax.CallOption) *ParticipantIterator
ListParticipants returns the list of all participants in the specified conversation.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListParticipantsRequest{ // TODO: Fill request struct fields. } it := c.ListParticipants(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*ParticipantsClient) SuggestArticles ¶ added in v1.42.0
func (c *ParticipantsClient) SuggestArticles(ctx context.Context, req *dialogflowpb.SuggestArticlesRequest, opts ...gax.CallOption) (*dialogflowpb.SuggestArticlesResponse, error)
SuggestArticles gets suggested articles for a participant based on specific historical messages.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.SuggestArticlesRequest{ // TODO: Fill request struct fields. } resp, err := c.SuggestArticles(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ParticipantsClient) SuggestFaqAnswers ¶ added in v1.42.0
func (c *ParticipantsClient) SuggestFaqAnswers(ctx context.Context, req *dialogflowpb.SuggestFaqAnswersRequest, opts ...gax.CallOption) (*dialogflowpb.SuggestFaqAnswersResponse, error)
SuggestFaqAnswers gets suggested faq answers for a participant based on specific historical messages.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.SuggestFaqAnswersRequest{ // TODO: Fill request struct fields. } resp, err := c.SuggestFaqAnswers(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ParticipantsClient) UpdateParticipant ¶ added in v1.42.0
func (c *ParticipantsClient) UpdateParticipant(ctx context.Context, req *dialogflowpb.UpdateParticipantRequest, opts ...gax.CallOption) (*dialogflowpb.Participant, error)
UpdateParticipant updates the specified participant.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewParticipantsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateParticipantRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateParticipant(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ReloadDocumentOperation ¶ added in v1.42.0
type ReloadDocumentOperation struct {
// contains filtered or unexported fields
}
ReloadDocumentOperation manages a long-running operation from ReloadDocument.
func (*ReloadDocumentOperation) Done ¶ added in v1.42.0
func (op *ReloadDocumentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ReloadDocumentOperation) Metadata ¶ added in v1.42.0
func (op *ReloadDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ReloadDocumentOperation) Name ¶ added in v1.42.0
func (op *ReloadDocumentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*ReloadDocumentOperation) Poll ¶ added in v1.42.0
func (op *ReloadDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*ReloadDocumentOperation) Wait ¶ added in v1.42.0
func (op *ReloadDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type RestoreAgentOperation ¶
type RestoreAgentOperation struct {
// contains filtered or unexported fields
}
RestoreAgentOperation manages a long-running operation from RestoreAgent.
func (*RestoreAgentOperation) Done ¶
func (op *RestoreAgentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RestoreAgentOperation) Metadata ¶
func (op *RestoreAgentOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RestoreAgentOperation) Name ¶
func (op *RestoreAgentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*RestoreAgentOperation) Poll ¶
func (op *RestoreAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RestoreAgentOperation) Wait ¶
func (op *RestoreAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type SessionEntityTypeIterator ¶
type SessionEntityTypeIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.SessionEntityType, nextPageToken string, err error) // contains filtered or unexported fields }
SessionEntityTypeIterator manages a stream of *dialogflowpb.SessionEntityType.
func (*SessionEntityTypeIterator) Next ¶
func (it *SessionEntityTypeIterator) Next() (*dialogflowpb.SessionEntityType, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SessionEntityTypeIterator) PageInfo ¶
func (it *SessionEntityTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SessionEntityTypesCallOptions ¶
type SessionEntityTypesCallOptions struct { ListSessionEntityTypes []gax.CallOption GetSessionEntityType []gax.CallOption CreateSessionEntityType []gax.CallOption UpdateSessionEntityType []gax.CallOption DeleteSessionEntityType []gax.CallOption }
SessionEntityTypesCallOptions contains the retry settings for each method of SessionEntityTypesClient.
type SessionEntityTypesClient ¶
type SessionEntityTypesClient struct { // The call options for this service. CallOptions *SessionEntityTypesCallOptions // contains filtered or unexported fields }
SessionEntityTypesClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing SessionEntityTypes.
func NewSessionEntityTypesClient ¶
func NewSessionEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*SessionEntityTypesClient, error)
NewSessionEntityTypesClient creates a new session entity types client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing SessionEntityTypes.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*SessionEntityTypesClient) Close ¶
func (c *SessionEntityTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SessionEntityTypesClient) Connection ¶
func (c *SessionEntityTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*SessionEntityTypesClient) CreateSessionEntityType ¶
func (c *SessionEntityTypesClient) CreateSessionEntityType(ctx context.Context, req *dialogflowpb.CreateSessionEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.SessionEntityType, error)
CreateSessionEntityType creates a session entity type.
If the specified session entity type already exists, overrides the session entity type.
This method doesn’t work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateSessionEntityTypeRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateSessionEntityType(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionEntityTypesClient) DeleteSessionEntityType ¶
func (c *SessionEntityTypesClient) DeleteSessionEntityType(ctx context.Context, req *dialogflowpb.DeleteSessionEntityTypeRequest, opts ...gax.CallOption) error
DeleteSessionEntityType deletes the specified session entity type.
This method doesn’t work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteSessionEntityTypeRequest{ // TODO: Fill request struct fields. } err = c.DeleteSessionEntityType(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*SessionEntityTypesClient) GetSessionEntityType ¶
func (c *SessionEntityTypesClient) GetSessionEntityType(ctx context.Context, req *dialogflowpb.GetSessionEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.SessionEntityType, error)
GetSessionEntityType retrieves the specified session entity type.
This method doesn’t work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetSessionEntityTypeRequest{ // TODO: Fill request struct fields. } resp, err := c.GetSessionEntityType(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionEntityTypesClient) ListSessionEntityTypes ¶
func (c *SessionEntityTypesClient) ListSessionEntityTypes(ctx context.Context, req *dialogflowpb.ListSessionEntityTypesRequest, opts ...gax.CallOption) *SessionEntityTypeIterator
ListSessionEntityTypes returns the list of all session entity types in the specified session.
This method doesn’t work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListSessionEntityTypesRequest{ // TODO: Fill request struct fields. } it := c.ListSessionEntityTypes(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*SessionEntityTypesClient) UpdateSessionEntityType ¶
func (c *SessionEntityTypesClient) UpdateSessionEntityType(ctx context.Context, req *dialogflowpb.UpdateSessionEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.SessionEntityType, error)
UpdateSessionEntityType updates the specified session entity type.
This method doesn’t work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionEntityTypesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateSessionEntityTypeRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateSessionEntityType(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type SessionsCallOptions ¶
type SessionsCallOptions struct { DetectIntent []gax.CallOption StreamingDetectIntent []gax.CallOption }
SessionsCallOptions contains the retry settings for each method of SessionsClient.
type SessionsClient ¶
type SessionsClient struct { // The call options for this service. CallOptions *SessionsCallOptions // contains filtered or unexported fields }
SessionsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
A service used for session interactions.
For more information, see the API interactions guide (at https://cloud.google.com/dialogflow/docs/api-overview).
func NewSessionsClient ¶
func NewSessionsClient(ctx context.Context, opts ...option.ClientOption) (*SessionsClient, error)
NewSessionsClient creates a new sessions client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
A service used for session interactions.
For more information, see the API interactions guide (at https://cloud.google.com/dialogflow/docs/api-overview).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*SessionsClient) Close ¶
func (c *SessionsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SessionsClient) Connection ¶
func (c *SessionsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*SessionsClient) DetectIntent ¶
func (c *SessionsClient) DetectIntent(ctx context.Context, req *dialogflowpb.DetectIntentRequest, opts ...gax.CallOption) (*dialogflowpb.DetectIntentResponse, error)
DetectIntent processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries.
Note: Always use agent versions for production traffic. See Versions and environments (at https://cloud.google.com/dialogflow/es/docs/agents-versions).
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DetectIntentRequest{ // TODO: Fill request struct fields. } resp, err := c.DetectIntent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionsClient) StreamingDetectIntent ¶
func (c *SessionsClient) StreamingDetectIntent(ctx context.Context, opts ...gax.CallOption) (dialogflowpb.Sessions_StreamingDetectIntentClient, error)
StreamingDetectIntent processes a natural language query in audio format in a streaming fashion and returns structured, actionable data as a result. This method is only available via the gRPC API (not REST).
Note: Always use agent versions for production traffic. See Versions and environments (at https://cloud.google.com/dialogflow/es/docs/agents-versions).
Example ¶
package main import ( "context" "io" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewSessionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() stream, err := c.StreamingDetectIntent(ctx) if err != nil { // TODO: Handle error. } go func() { reqs := []*dialogflowpb.StreamingDetectIntentRequest{ // TODO: Create requests. } for _, req := range reqs { if err := stream.Send(req); err != nil { // TODO: Handle error. } } stream.CloseSend() }() for { resp, err := stream.Recv() if err == io.EOF { break } if err != nil { // TODO: handle error. } // TODO: Use resp. _ = resp } }
Output:
type TrainAgentOperation ¶
type TrainAgentOperation struct {
// contains filtered or unexported fields
}
TrainAgentOperation manages a long-running operation from TrainAgent.
func (*TrainAgentOperation) Done ¶
func (op *TrainAgentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*TrainAgentOperation) Metadata ¶
func (op *TrainAgentOperation) Metadata() (*structpb.Struct, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*TrainAgentOperation) Name ¶
func (op *TrainAgentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*TrainAgentOperation) Poll ¶
func (op *TrainAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*TrainAgentOperation) Wait ¶
func (op *TrainAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateDocumentOperation ¶ added in v1.42.0
type UpdateDocumentOperation struct {
// contains filtered or unexported fields
}
UpdateDocumentOperation manages a long-running operation from UpdateDocument.
func (*UpdateDocumentOperation) Done ¶ added in v1.42.0
func (op *UpdateDocumentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateDocumentOperation) Metadata ¶ added in v1.42.0
func (op *UpdateDocumentOperation) Metadata() (*dialogflowpb.KnowledgeOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateDocumentOperation) Name ¶ added in v1.42.0
func (op *UpdateDocumentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateDocumentOperation) Poll ¶ added in v1.42.0
func (op *UpdateDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateDocumentOperation) Wait ¶ added in v1.42.0
func (op *UpdateDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.Document, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type VersionIterator ¶ added in v1.42.0
type VersionIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*dialogflowpb.Version, nextPageToken string, err error) // contains filtered or unexported fields }
VersionIterator manages a stream of *dialogflowpb.Version.
func (*VersionIterator) Next ¶ added in v1.42.0
func (it *VersionIterator) Next() (*dialogflowpb.Version, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*VersionIterator) PageInfo ¶ added in v1.42.0
func (it *VersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VersionsCallOptions ¶ added in v1.42.0
type VersionsCallOptions struct { ListVersions []gax.CallOption GetVersion []gax.CallOption CreateVersion []gax.CallOption UpdateVersion []gax.CallOption DeleteVersion []gax.CallOption }
VersionsCallOptions contains the retry settings for each method of VersionsClient.
type VersionsClient ¶ added in v1.42.0
type VersionsClient struct { // The call options for this service. CallOptions *VersionsCallOptions // contains filtered or unexported fields }
VersionsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Versions.
func NewVersionsClient ¶ added in v1.42.0
func NewVersionsClient(ctx context.Context, opts ...option.ClientOption) (*VersionsClient, error)
NewVersionsClient creates a new versions client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Versions.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" ) func main() { ctx := context.Background() c, err := dialogflow.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*VersionsClient) Close ¶ added in v1.42.0
func (c *VersionsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*VersionsClient) Connection ¶ added in v1.42.0
func (c *VersionsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*VersionsClient) CreateVersion ¶ added in v1.42.0
func (c *VersionsClient) CreateVersion(ctx context.Context, req *dialogflowpb.CreateVersionRequest, opts ...gax.CallOption) (*dialogflowpb.Version, error)
CreateVersion creates an agent version.
The new version points to the agent instance in the “default” environment.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.CreateVersionRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*VersionsClient) DeleteVersion ¶ added in v1.42.0
func (c *VersionsClient) DeleteVersion(ctx context.Context, req *dialogflowpb.DeleteVersionRequest, opts ...gax.CallOption) error
DeleteVersion delete the specified agent version.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.DeleteVersionRequest{ // TODO: Fill request struct fields. } err = c.DeleteVersion(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*VersionsClient) GetVersion ¶ added in v1.42.0
func (c *VersionsClient) GetVersion(ctx context.Context, req *dialogflowpb.GetVersionRequest, opts ...gax.CallOption) (*dialogflowpb.Version, error)
GetVersion retrieves the specified agent version.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetVersionRequest{ // TODO: Fill request struct fields. } resp, err := c.GetVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*VersionsClient) ListVersions ¶ added in v1.42.0
func (c *VersionsClient) ListVersions(ctx context.Context, req *dialogflowpb.ListVersionsRequest, opts ...gax.CallOption) *VersionIterator
ListVersions returns the list of all versions of the specified agent.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" "google.golang.org/api/iterator" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.ListVersionsRequest{ // TODO: Fill request struct fields. } it := c.ListVersions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*VersionsClient) UpdateVersion ¶ added in v1.42.0
func (c *VersionsClient) UpdateVersion(ctx context.Context, req *dialogflowpb.UpdateVersionRequest, opts ...gax.CallOption) (*dialogflowpb.Version, error)
UpdateVersion updates the specified agent version.
Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.
Example ¶
package main import ( "context" dialogflow "cloud.google.com/go/dialogflow/apiv2" dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" ) func main() { ctx := context.Background() c, err := dialogflow.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.UpdateVersionRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
Source Files ¶
- agents_client.go
- answer_records_client.go
- contexts_client.go
- conversation_profiles_client.go
- conversations_client.go
- doc.go
- documents_client.go
- entity_types_client.go
- environments_client.go
- fulfillments_client.go
- intents_client.go
- knowledge_bases_client.go
- participants_client.go
- session_entity_types_client.go
- sessions_client.go
- versions_client.go