ai

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChatRole_name = map[int32]string{
		0: "CHAT_ROLE_UNSPECIFIED",
		1: "CHAT_ROLE_USER",
		2: "CHAT_ROLE_ASSISTANT",
		3: "CHAT_ROLE_SYSTEM",
	}
	ChatRole_value = map[string]int32{
		"CHAT_ROLE_UNSPECIFIED": 0,
		"CHAT_ROLE_USER":        1,
		"CHAT_ROLE_ASSISTANT":   2,
		"CHAT_ROLE_SYSTEM":      3,
	}
)

Enum value maps for ChatRole.

View Source
var File_ai_entity_proto protoreflect.FileDescriptor
View Source
var File_ai_service_proto protoreflect.FileDescriptor

Functions

func RegisterAIServiceServer

func RegisterAIServiceServer(s *grpc.Server, srv AIServiceServer)

Types

type AIServiceClient

type AIServiceClient interface {
	ChatAI(ctx context.Context, in *ChatAIRequest, opts ...grpc.CallOption) (*ChatAIResponse, error)
}

AIServiceClient is the client API for AIService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAIServiceClient

func NewAIServiceClient(cc grpc.ClientConnInterface) AIServiceClient

type AIServiceServer

type AIServiceServer interface {
	ChatAI(context.Context, *ChatAIRequest) (*ChatAIResponse, error)
}

AIServiceServer is the server API for AIService service.

type ChatAIRequest

type ChatAIRequest struct {
	Question    string         `protobuf:"bytes,1,opt,name=question,proto3" json:"question,omitempty"` // Required
	ChatHistory []*ChatHistory `protobuf:"bytes,2,rep,name=chat_history,json=chatHistory,proto3" json:"chat_history,omitempty"`
	// contains filtered or unexported fields
}

func (*ChatAIRequest) Descriptor deprecated

func (*ChatAIRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChatAIRequest.ProtoReflect.Descriptor instead.

func (*ChatAIRequest) GetChatHistory

func (x *ChatAIRequest) GetChatHistory() []*ChatHistory

func (*ChatAIRequest) GetQuestion

func (x *ChatAIRequest) GetQuestion() string

func (*ChatAIRequest) ProtoMessage

func (*ChatAIRequest) ProtoMessage()

func (*ChatAIRequest) ProtoReflect

func (x *ChatAIRequest) ProtoReflect() protoreflect.Message

func (*ChatAIRequest) Reset

func (x *ChatAIRequest) Reset()

func (*ChatAIRequest) String

func (x *ChatAIRequest) String() string

func (*ChatAIRequest) Validate

func (m *ChatAIRequest) Validate() error

Validate checks the field values on ChatAIRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ChatAIRequest) ValidateAll

func (m *ChatAIRequest) ValidateAll() error

ValidateAll checks the field values on ChatAIRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ChatAIRequestMultiError, or nil if none found.

type ChatAIRequestMultiError

type ChatAIRequestMultiError []error

ChatAIRequestMultiError is an error wrapping multiple validation errors returned by ChatAIRequest.ValidateAll() if the designated constraints aren't met.

func (ChatAIRequestMultiError) AllErrors

func (m ChatAIRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ChatAIRequestMultiError) Error

func (m ChatAIRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ChatAIRequestValidationError

type ChatAIRequestValidationError struct {
	// contains filtered or unexported fields
}

ChatAIRequestValidationError is the validation error returned by ChatAIRequest.Validate if the designated constraints aren't met.

func (ChatAIRequestValidationError) Cause

Cause function returns cause value.

func (ChatAIRequestValidationError) Error

Error satisfies the builtin error interface

func (ChatAIRequestValidationError) ErrorName

func (e ChatAIRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ChatAIRequestValidationError) Field

Field function returns field value.

func (ChatAIRequestValidationError) Key

Key function returns key value.

func (ChatAIRequestValidationError) Reason

Reason function returns reason value.

type ChatAIResponse

type ChatAIResponse struct {
	Answer string `protobuf:"bytes,1,opt,name=answer,proto3" json:"answer,omitempty"`
	// contains filtered or unexported fields
}

func (*ChatAIResponse) Descriptor deprecated

func (*ChatAIResponse) Descriptor() ([]byte, []int)

Deprecated: Use ChatAIResponse.ProtoReflect.Descriptor instead.

func (*ChatAIResponse) GetAnswer

func (x *ChatAIResponse) GetAnswer() string

func (*ChatAIResponse) ProtoMessage

func (*ChatAIResponse) ProtoMessage()

func (*ChatAIResponse) ProtoReflect

func (x *ChatAIResponse) ProtoReflect() protoreflect.Message

func (*ChatAIResponse) Reset

func (x *ChatAIResponse) Reset()

func (*ChatAIResponse) String

func (x *ChatAIResponse) String() string

func (*ChatAIResponse) Validate

func (m *ChatAIResponse) Validate() error

Validate checks the field values on ChatAIResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ChatAIResponse) ValidateAll

func (m *ChatAIResponse) ValidateAll() error

ValidateAll checks the field values on ChatAIResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ChatAIResponseMultiError, or nil if none found.

type ChatAIResponseMultiError

type ChatAIResponseMultiError []error

ChatAIResponseMultiError is an error wrapping multiple validation errors returned by ChatAIResponse.ValidateAll() if the designated constraints aren't met.

func (ChatAIResponseMultiError) AllErrors

func (m ChatAIResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ChatAIResponseMultiError) Error

func (m ChatAIResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ChatAIResponseValidationError

type ChatAIResponseValidationError struct {
	// contains filtered or unexported fields
}

ChatAIResponseValidationError is the validation error returned by ChatAIResponse.Validate if the designated constraints aren't met.

func (ChatAIResponseValidationError) Cause

Cause function returns cause value.

func (ChatAIResponseValidationError) Error

Error satisfies the builtin error interface

func (ChatAIResponseValidationError) ErrorName

func (e ChatAIResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ChatAIResponseValidationError) Field

Field function returns field value.

func (ChatAIResponseValidationError) Key

Key function returns key value.

func (ChatAIResponseValidationError) Reason

Reason function returns reason value.

type ChatHistory

type ChatHistory struct {
	Role    ChatRole `protobuf:"varint,1,opt,name=role,proto3,enum=core.ai.ChatRole" json:"role,omitempty"`
	Content string   `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

ChatHistory

func (*ChatHistory) Descriptor deprecated

func (*ChatHistory) Descriptor() ([]byte, []int)

Deprecated: Use ChatHistory.ProtoReflect.Descriptor instead.

func (*ChatHistory) GetContent

func (x *ChatHistory) GetContent() string

func (*ChatHistory) GetRole

func (x *ChatHistory) GetRole() ChatRole

func (*ChatHistory) ProtoMessage

func (*ChatHistory) ProtoMessage()

func (*ChatHistory) ProtoReflect

func (x *ChatHistory) ProtoReflect() protoreflect.Message

func (*ChatHistory) Reset

func (x *ChatHistory) Reset()

func (*ChatHistory) String

func (x *ChatHistory) String() string

func (*ChatHistory) Validate

func (m *ChatHistory) Validate() error

Validate checks the field values on ChatHistory with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ChatHistory) ValidateAll

func (m *ChatHistory) ValidateAll() error

ValidateAll checks the field values on ChatHistory with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ChatHistoryMultiError, or nil if none found.

type ChatHistoryMultiError

type ChatHistoryMultiError []error

ChatHistoryMultiError is an error wrapping multiple validation errors returned by ChatHistory.ValidateAll() if the designated constraints aren't met.

func (ChatHistoryMultiError) AllErrors

func (m ChatHistoryMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ChatHistoryMultiError) Error

func (m ChatHistoryMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ChatHistoryValidationError

type ChatHistoryValidationError struct {
	// contains filtered or unexported fields
}

ChatHistoryValidationError is the validation error returned by ChatHistory.Validate if the designated constraints aren't met.

func (ChatHistoryValidationError) Cause

Cause function returns cause value.

func (ChatHistoryValidationError) Error

Error satisfies the builtin error interface

func (ChatHistoryValidationError) ErrorName

func (e ChatHistoryValidationError) ErrorName() string

ErrorName returns error name.

func (ChatHistoryValidationError) Field

Field function returns field value.

func (ChatHistoryValidationError) Key

Key function returns key value.

func (ChatHistoryValidationError) Reason

Reason function returns reason value.

type ChatRole

type ChatRole int32

ChatRole

const (
	ChatRole_CHAT_ROLE_UNSPECIFIED ChatRole = 0
	ChatRole_CHAT_ROLE_USER        ChatRole = 1
	ChatRole_CHAT_ROLE_ASSISTANT   ChatRole = 2
	ChatRole_CHAT_ROLE_SYSTEM      ChatRole = 3
)

func (ChatRole) Descriptor

func (ChatRole) Descriptor() protoreflect.EnumDescriptor

func (ChatRole) Enum

func (x ChatRole) Enum() *ChatRole

func (ChatRole) EnumDescriptor deprecated

func (ChatRole) EnumDescriptor() ([]byte, []int)

Deprecated: Use ChatRole.Descriptor instead.

func (ChatRole) Number

func (x ChatRole) Number() protoreflect.EnumNumber

func (ChatRole) String

func (x ChatRole) String() string

func (ChatRole) Type

type UnimplementedAIServiceServer

type UnimplementedAIServiceServer struct {
}

UnimplementedAIServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedAIServiceServer) ChatAI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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