assistv1

package
v0.0.0-...-5c79d48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceGetter

type ResourceGetter interface {
	GetNode(ctx context.Context, namespace, name string) (types.Server, error)
	GetKubernetesCluster(ctx context.Context, name string) (types.KubeCluster, error)
	GetApp(ctx context.Context, name string) (types.Application, error)
	GetDatabase(ctx context.Context, name string) (types.Database, error)
	GetWindowsDesktops(ctx context.Context, filter types.WindowsDesktopFilter) ([]types.WindowsDesktop, error)
}

ResourceGetter represents a subset of the auth.Cache interface. Created to avoid circular dependencies.

type Service

type Service struct {
	assist.UnimplementedAssistServiceServer
	assist.UnimplementedAssistEmbeddingServiceServer
	// contains filtered or unexported fields
}

Service implements the teleport.assist.v1.AssistService RPC service.

func NewService

func NewService(cfg *ServiceConfig) (*Service, error)

NewService returns a new assist gRPC service.

func (*Service) CreateAssistantConversation

func (a *Service) CreateAssistantConversation(ctx context.Context, req *assist.CreateAssistantConversationRequest) (*assist.CreateAssistantConversationResponse, error)

CreateAssistantConversation creates a new conversation entry in the backend.

func (*Service) CreateAssistantMessage

func (a *Service) CreateAssistantMessage(ctx context.Context, req *assist.CreateAssistantMessageRequest) (*emptypb.Empty, error)

CreateAssistantMessage adds the message to the backend.

func (*Service) DeleteAssistantConversation

func (a *Service) DeleteAssistantConversation(ctx context.Context, req *assist.DeleteAssistantConversationRequest) (*emptypb.Empty, error)

DeleteAssistantConversation deletes a conversation entry and associated messages from the backend.

func (*Service) GetAssistantConversations

func (a *Service) GetAssistantConversations(ctx context.Context, req *assist.GetAssistantConversationsRequest) (*assist.GetAssistantConversationsResponse, error)

GetAssistantConversations returns all conversations started by a user.

func (*Service) GetAssistantEmbeddings

func (a *Service) GetAssistantEmbeddings(ctx context.Context, msg *assist.GetAssistantEmbeddingsRequest) (*assist.GetAssistantEmbeddingsResponse, error)

func (*Service) GetAssistantMessages

func (a *Service) GetAssistantMessages(ctx context.Context, req *assist.GetAssistantMessagesRequest) (*assist.GetAssistantMessagesResponse, error)

GetAssistantMessages returns all messages with given conversation ID.

func (*Service) IsAssistEnabled

func (a *Service) IsAssistEnabled(ctx context.Context, _ *assist.IsAssistEnabledRequest) (*assist.IsAssistEnabledResponse, error)

IsAssistEnabled returns true if the assist is enabled or not on the auth level.

func (*Service) SearchUnifiedResources

func (a *Service) SearchUnifiedResources(ctx context.Context, msg *assist.SearchUnifiedResourcesRequest) (*assist.SearchUnifiedResourcesResponse, error)

SearchUnifiedResources returns a similarity-ordered list of resources from the unified resource cache

func (*Service) UpdateAssistantConversationInfo

func (a *Service) UpdateAssistantConversationInfo(ctx context.Context, req *assist.UpdateAssistantConversationInfoRequest) (*emptypb.Empty, error)

UpdateAssistantConversationInfo updates the conversation info for a conversation.

type ServiceConfig

type ServiceConfig struct {
	Backend        services.Assistant
	Embeddings     *ai.SimpleRetriever
	Embedder       embeddinglib.Embedder
	Authorizer     authz.Authorizer
	Logger         *logrus.Entry
	ResourceGetter ResourceGetter
}

ServiceConfig holds configuration options for the assist gRPC service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL