Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorBadRequest(format string, args ...interface{}) *errors.Error
- func ErrorRecordAlreadyExists(format string, args ...interface{}) *errors.Error
- func ErrorRecordNotFound(format string, args ...interface{}) *errors.Error
- func ErrorSystemError(format string, args ...interface{}) *errors.Error
- func IsBadRequest(err error) bool
- func IsRecordAlreadyExists(err error) bool
- func IsRecordNotFound(err error) bool
- func IsSystemError(err error) bool
- func RegisterAIServiceHTTPServer(s *http.Server, srv AIServiceHTTPServer)
- func RegisterAIServiceServer(s grpc.ServiceRegistrar, srv AIServiceServer)
- type AIServiceClient
- type AIServiceHTTPClient
- type AIServiceHTTPClientImpl
- type AIServiceHTTPServer
- type AIServiceServer
- type ChatgptChoiceMessageRes
- func (*ChatgptChoiceMessageRes) Descriptor() ([]byte, []int)deprecated
- func (x *ChatgptChoiceMessageRes) GetContent() string
- func (x *ChatgptChoiceMessageRes) GetRole() string
- func (*ChatgptChoiceMessageRes) ProtoMessage()
- func (x *ChatgptChoiceMessageRes) ProtoReflect() protoreflect.Message
- func (x *ChatgptChoiceMessageRes) Reset()
- func (x *ChatgptChoiceMessageRes) String() string
- func (m *ChatgptChoiceMessageRes) Validate() error
- func (m *ChatgptChoiceMessageRes) ValidateAll() error
- type ChatgptChoiceMessageResMultiError
- type ChatgptChoiceMessageResValidationError
- func (e ChatgptChoiceMessageResValidationError) Cause() error
- func (e ChatgptChoiceMessageResValidationError) Error() string
- func (e ChatgptChoiceMessageResValidationError) ErrorName() string
- func (e ChatgptChoiceMessageResValidationError) Field() string
- func (e ChatgptChoiceMessageResValidationError) Key() bool
- func (e ChatgptChoiceMessageResValidationError) Reason() string
- type ChatgptChoiceRes
- func (*ChatgptChoiceRes) Descriptor() ([]byte, []int)deprecated
- func (x *ChatgptChoiceRes) GetFinishReason() string
- func (x *ChatgptChoiceRes) GetIndex() string
- func (x *ChatgptChoiceRes) GetMessage() *ChatgptChoiceMessageRes
- func (*ChatgptChoiceRes) ProtoMessage()
- func (x *ChatgptChoiceRes) ProtoReflect() protoreflect.Message
- func (x *ChatgptChoiceRes) Reset()
- func (x *ChatgptChoiceRes) String() string
- func (m *ChatgptChoiceRes) Validate() error
- func (m *ChatgptChoiceRes) ValidateAll() error
- type ChatgptChoiceResMultiError
- type ChatgptChoiceResValidationError
- func (e ChatgptChoiceResValidationError) Cause() error
- func (e ChatgptChoiceResValidationError) Error() string
- func (e ChatgptChoiceResValidationError) ErrorName() string
- func (e ChatgptChoiceResValidationError) Field() string
- func (e ChatgptChoiceResValidationError) Key() bool
- func (e ChatgptChoiceResValidationError) Reason() string
- type ChatgptChoicesRes
- func (*ChatgptChoicesRes) Descriptor() ([]byte, []int)deprecated
- func (x *ChatgptChoicesRes) GetChoices() []*ChatgptChoiceRes
- func (*ChatgptChoicesRes) ProtoMessage()
- func (x *ChatgptChoicesRes) ProtoReflect() protoreflect.Message
- func (x *ChatgptChoicesRes) Reset()
- func (x *ChatgptChoicesRes) String() string
- func (m *ChatgptChoicesRes) Validate() error
- func (m *ChatgptChoicesRes) ValidateAll() error
- type ChatgptChoicesResMultiError
- type ChatgptChoicesResValidationError
- func (e ChatgptChoicesResValidationError) Cause() error
- func (e ChatgptChoicesResValidationError) Error() string
- func (e ChatgptChoicesResValidationError) ErrorName() string
- func (e ChatgptChoicesResValidationError) Field() string
- func (e ChatgptChoicesResValidationError) Key() bool
- func (e ChatgptChoicesResValidationError) Reason() string
- type ChatgptMessageReq
- func (*ChatgptMessageReq) Descriptor() ([]byte, []int)deprecated
- func (x *ChatgptMessageReq) GetContent() string
- func (x *ChatgptMessageReq) GetRole() string
- func (*ChatgptMessageReq) ProtoMessage()
- func (x *ChatgptMessageReq) ProtoReflect() protoreflect.Message
- func (x *ChatgptMessageReq) Reset()
- func (x *ChatgptMessageReq) String() string
- func (m *ChatgptMessageReq) Validate() error
- func (m *ChatgptMessageReq) ValidateAll() error
- type ChatgptMessageReqMultiError
- type ChatgptMessageReqValidationError
- func (e ChatgptMessageReqValidationError) Cause() error
- func (e ChatgptMessageReqValidationError) Error() string
- func (e ChatgptMessageReqValidationError) ErrorName() string
- func (e ChatgptMessageReqValidationError) Field() string
- func (e ChatgptMessageReqValidationError) Key() bool
- func (e ChatgptMessageReqValidationError) Reason() string
- type ChatgptUsageRes
- func (*ChatgptUsageRes) Descriptor() ([]byte, []int)deprecated
- func (x *ChatgptUsageRes) GetCompletionTokes() string
- func (x *ChatgptUsageRes) GetPromptTokes() string
- func (x *ChatgptUsageRes) GetTotalTokens() int64
- func (*ChatgptUsageRes) ProtoMessage()
- func (x *ChatgptUsageRes) ProtoReflect() protoreflect.Message
- func (x *ChatgptUsageRes) Reset()
- func (x *ChatgptUsageRes) String() string
- func (m *ChatgptUsageRes) Validate() error
- func (m *ChatgptUsageRes) ValidateAll() error
- type ChatgptUsageResMultiError
- type ChatgptUsageResValidationError
- func (e ChatgptUsageResValidationError) Cause() error
- func (e ChatgptUsageResValidationError) Error() string
- func (e ChatgptUsageResValidationError) ErrorName() string
- func (e ChatgptUsageResValidationError) Field() string
- func (e ChatgptUsageResValidationError) Key() bool
- func (e ChatgptUsageResValidationError) Reason() string
- type CreateGptMessageReq
- func (*CreateGptMessageReq) Descriptor() ([]byte, []int)deprecated
- func (x *CreateGptMessageReq) GetMessages() []*ChatgptMessageReq
- func (x *CreateGptMessageReq) GetModel() string
- func (*CreateGptMessageReq) ProtoMessage()
- func (x *CreateGptMessageReq) ProtoReflect() protoreflect.Message
- func (x *CreateGptMessageReq) Reset()
- func (x *CreateGptMessageReq) String() string
- func (m *CreateGptMessageReq) Validate() error
- func (m *CreateGptMessageReq) ValidateAll() error
- type CreateGptMessageReqMultiError
- type CreateGptMessageReqValidationError
- func (e CreateGptMessageReqValidationError) Cause() error
- func (e CreateGptMessageReqValidationError) Error() string
- func (e CreateGptMessageReqValidationError) ErrorName() string
- func (e CreateGptMessageReqValidationError) Field() string
- func (e CreateGptMessageReqValidationError) Key() bool
- func (e CreateGptMessageReqValidationError) Reason() string
- type CreateGptMessageRes
- func (*CreateGptMessageRes) Descriptor() ([]byte, []int)deprecated
- func (x *CreateGptMessageRes) GetChoices() []*ChatgptChoiceRes
- func (x *CreateGptMessageRes) GetCreated() int64
- func (x *CreateGptMessageRes) GetError() *ErrorMessageRes
- func (x *CreateGptMessageRes) GetId() string
- func (x *CreateGptMessageRes) GetModel() string
- func (x *CreateGptMessageRes) GetObject() string
- func (x *CreateGptMessageRes) GetUsage() *ChatgptUsageRes
- func (*CreateGptMessageRes) ProtoMessage()
- func (x *CreateGptMessageRes) ProtoReflect() protoreflect.Message
- func (x *CreateGptMessageRes) Reset()
- func (x *CreateGptMessageRes) String() string
- func (m *CreateGptMessageRes) Validate() error
- func (m *CreateGptMessageRes) ValidateAll() error
- type CreateGptMessageResMultiError
- type CreateGptMessageResValidationError
- func (e CreateGptMessageResValidationError) Cause() error
- func (e CreateGptMessageResValidationError) Error() string
- func (e CreateGptMessageResValidationError) ErrorName() string
- func (e CreateGptMessageResValidationError) Field() string
- func (e CreateGptMessageResValidationError) Key() bool
- func (e CreateGptMessageResValidationError) Reason() string
- type ErrorMessageRes
- func (*ErrorMessageRes) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorMessageRes) GetMessage() string
- func (*ErrorMessageRes) ProtoMessage()
- func (x *ErrorMessageRes) ProtoReflect() protoreflect.Message
- func (x *ErrorMessageRes) Reset()
- func (x *ErrorMessageRes) String() string
- func (m *ErrorMessageRes) Validate() error
- func (m *ErrorMessageRes) ValidateAll() error
- type ErrorMessageResMultiError
- type ErrorMessageResValidationError
- func (e ErrorMessageResValidationError) Cause() error
- func (e ErrorMessageResValidationError) Error() string
- func (e ErrorMessageResValidationError) ErrorName() string
- func (e ErrorMessageResValidationError) Field() string
- func (e ErrorMessageResValidationError) Key() bool
- func (e ErrorMessageResValidationError) Reason() string
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type UnimplementedAIServiceServer
- type UnsafeAIServiceServer
Constants ¶
const (
AIService_CreateGptMessage_FullMethodName = "/ai.v1.AIService/CreateGptMessage"
)
const OperationAIServiceCreateGptMessage = "/ai.v1.AIService/CreateGptMessage"
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "RECORD_NOT_FOUND", 1: "RECORD_ALREADY_EXISTS", 2: "BAD_REQUEST", 3: "SYSTEM_ERROR", } ErrorReason_value = map[string]int32{ "RECORD_NOT_FOUND": 0, "RECORD_ALREADY_EXISTS": 1, "BAD_REQUEST": 2, "SYSTEM_ERROR": 3, } )
Enum value maps for ErrorReason.
var AIService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ai.v1.AIService", HandlerType: (*AIServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateGptMessage", Handler: _AIService_CreateGptMessage_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ai/v1/ai.proto", }
AIService_ServiceDesc is the grpc.ServiceDesc for AIService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_ai_v1_ai_proto protoreflect.FileDescriptor
var File_ai_v1_error_reason_proto protoreflect.FileDescriptor
Functions ¶
func ErrorBadRequest ¶
func ErrorRecordNotFound ¶
func ErrorSystemError ¶
func IsBadRequest ¶
func IsRecordAlreadyExists ¶
func IsRecordNotFound ¶
func IsSystemError ¶
func RegisterAIServiceHTTPServer ¶
func RegisterAIServiceHTTPServer(s *http.Server, srv AIServiceHTTPServer)
func RegisterAIServiceServer ¶
func RegisterAIServiceServer(s grpc.ServiceRegistrar, srv AIServiceServer)
Types ¶
type AIServiceClient ¶
type AIServiceClient interface { // 创建 CreateGptMessage(ctx context.Context, in *CreateGptMessageReq, opts ...grpc.CallOption) (*CreateGptMessageRes, error) }
AIServiceClient is the client API for AIService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAIServiceClient ¶
func NewAIServiceClient(cc grpc.ClientConnInterface) AIServiceClient
type AIServiceHTTPClient ¶
type AIServiceHTTPClient interface {
CreateGptMessage(ctx context.Context, req *CreateGptMessageReq, opts ...http.CallOption) (rsp *CreateGptMessageRes, err error)
}
func NewAIServiceHTTPClient ¶
func NewAIServiceHTTPClient(client *http.Client) AIServiceHTTPClient
type AIServiceHTTPClientImpl ¶
type AIServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*AIServiceHTTPClientImpl) CreateGptMessage ¶
func (c *AIServiceHTTPClientImpl) CreateGptMessage(ctx context.Context, in *CreateGptMessageReq, opts ...http.CallOption) (*CreateGptMessageRes, error)
type AIServiceHTTPServer ¶
type AIServiceHTTPServer interface {
CreateGptMessage(context.Context, *CreateGptMessageReq) (*CreateGptMessageRes, error)
}
type AIServiceServer ¶
type AIServiceServer interface { // 创建 CreateGptMessage(context.Context, *CreateGptMessageReq) (*CreateGptMessageRes, error) // contains filtered or unexported methods }
AIServiceServer is the server API for AIService service. All implementations must embed UnimplementedAIServiceServer for forward compatibility
type ChatgptChoiceMessageRes ¶
type ChatgptChoiceMessageRes struct { Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*ChatgptChoiceMessageRes) Descriptor
deprecated
func (*ChatgptChoiceMessageRes) Descriptor() ([]byte, []int)
Deprecated: Use ChatgptChoiceMessageRes.ProtoReflect.Descriptor instead.
func (*ChatgptChoiceMessageRes) GetContent ¶
func (x *ChatgptChoiceMessageRes) GetContent() string
func (*ChatgptChoiceMessageRes) GetRole ¶
func (x *ChatgptChoiceMessageRes) GetRole() string
func (*ChatgptChoiceMessageRes) ProtoMessage ¶
func (*ChatgptChoiceMessageRes) ProtoMessage()
func (*ChatgptChoiceMessageRes) ProtoReflect ¶
func (x *ChatgptChoiceMessageRes) ProtoReflect() protoreflect.Message
func (*ChatgptChoiceMessageRes) Reset ¶
func (x *ChatgptChoiceMessageRes) Reset()
func (*ChatgptChoiceMessageRes) String ¶
func (x *ChatgptChoiceMessageRes) String() string
func (*ChatgptChoiceMessageRes) Validate ¶
func (m *ChatgptChoiceMessageRes) Validate() error
Validate checks the field values on ChatgptChoiceMessageRes 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 (*ChatgptChoiceMessageRes) ValidateAll ¶
func (m *ChatgptChoiceMessageRes) ValidateAll() error
ValidateAll checks the field values on ChatgptChoiceMessageRes 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 ChatgptChoiceMessageResMultiError, or nil if none found.
type ChatgptChoiceMessageResMultiError ¶
type ChatgptChoiceMessageResMultiError []error
ChatgptChoiceMessageResMultiError is an error wrapping multiple validation errors returned by ChatgptChoiceMessageRes.ValidateAll() if the designated constraints aren't met.
func (ChatgptChoiceMessageResMultiError) AllErrors ¶
func (m ChatgptChoiceMessageResMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ChatgptChoiceMessageResMultiError) Error ¶
func (m ChatgptChoiceMessageResMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ChatgptChoiceMessageResValidationError ¶
type ChatgptChoiceMessageResValidationError struct {
// contains filtered or unexported fields
}
ChatgptChoiceMessageResValidationError is the validation error returned by ChatgptChoiceMessageRes.Validate if the designated constraints aren't met.
func (ChatgptChoiceMessageResValidationError) Cause ¶
func (e ChatgptChoiceMessageResValidationError) Cause() error
Cause function returns cause value.
func (ChatgptChoiceMessageResValidationError) Error ¶
func (e ChatgptChoiceMessageResValidationError) Error() string
Error satisfies the builtin error interface
func (ChatgptChoiceMessageResValidationError) ErrorName ¶
func (e ChatgptChoiceMessageResValidationError) ErrorName() string
ErrorName returns error name.
func (ChatgptChoiceMessageResValidationError) Field ¶
func (e ChatgptChoiceMessageResValidationError) Field() string
Field function returns field value.
func (ChatgptChoiceMessageResValidationError) Key ¶
func (e ChatgptChoiceMessageResValidationError) Key() bool
Key function returns key value.
func (ChatgptChoiceMessageResValidationError) Reason ¶
func (e ChatgptChoiceMessageResValidationError) Reason() string
Reason function returns reason value.
type ChatgptChoiceRes ¶
type ChatgptChoiceRes struct { FinishReason string `protobuf:"bytes,1,opt,name=finish_reason,json=finishReason,proto3" json:"finish_reason,omitempty"` Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` Message *ChatgptChoiceMessageRes `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*ChatgptChoiceRes) Descriptor
deprecated
func (*ChatgptChoiceRes) Descriptor() ([]byte, []int)
Deprecated: Use ChatgptChoiceRes.ProtoReflect.Descriptor instead.
func (*ChatgptChoiceRes) GetFinishReason ¶
func (x *ChatgptChoiceRes) GetFinishReason() string
func (*ChatgptChoiceRes) GetIndex ¶
func (x *ChatgptChoiceRes) GetIndex() string
func (*ChatgptChoiceRes) GetMessage ¶
func (x *ChatgptChoiceRes) GetMessage() *ChatgptChoiceMessageRes
func (*ChatgptChoiceRes) ProtoMessage ¶
func (*ChatgptChoiceRes) ProtoMessage()
func (*ChatgptChoiceRes) ProtoReflect ¶
func (x *ChatgptChoiceRes) ProtoReflect() protoreflect.Message
func (*ChatgptChoiceRes) Reset ¶
func (x *ChatgptChoiceRes) Reset()
func (*ChatgptChoiceRes) String ¶
func (x *ChatgptChoiceRes) String() string
func (*ChatgptChoiceRes) Validate ¶
func (m *ChatgptChoiceRes) Validate() error
Validate checks the field values on ChatgptChoiceRes 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 (*ChatgptChoiceRes) ValidateAll ¶
func (m *ChatgptChoiceRes) ValidateAll() error
ValidateAll checks the field values on ChatgptChoiceRes 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 ChatgptChoiceResMultiError, or nil if none found.
type ChatgptChoiceResMultiError ¶
type ChatgptChoiceResMultiError []error
ChatgptChoiceResMultiError is an error wrapping multiple validation errors returned by ChatgptChoiceRes.ValidateAll() if the designated constraints aren't met.
func (ChatgptChoiceResMultiError) AllErrors ¶
func (m ChatgptChoiceResMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ChatgptChoiceResMultiError) Error ¶
func (m ChatgptChoiceResMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ChatgptChoiceResValidationError ¶
type ChatgptChoiceResValidationError struct {
// contains filtered or unexported fields
}
ChatgptChoiceResValidationError is the validation error returned by ChatgptChoiceRes.Validate if the designated constraints aren't met.
func (ChatgptChoiceResValidationError) Cause ¶
func (e ChatgptChoiceResValidationError) Cause() error
Cause function returns cause value.
func (ChatgptChoiceResValidationError) Error ¶
func (e ChatgptChoiceResValidationError) Error() string
Error satisfies the builtin error interface
func (ChatgptChoiceResValidationError) ErrorName ¶
func (e ChatgptChoiceResValidationError) ErrorName() string
ErrorName returns error name.
func (ChatgptChoiceResValidationError) Field ¶
func (e ChatgptChoiceResValidationError) Field() string
Field function returns field value.
func (ChatgptChoiceResValidationError) Key ¶
func (e ChatgptChoiceResValidationError) Key() bool
Key function returns key value.
func (ChatgptChoiceResValidationError) Reason ¶
func (e ChatgptChoiceResValidationError) Reason() string
Reason function returns reason value.
type ChatgptChoicesRes ¶
type ChatgptChoicesRes struct { Choices []*ChatgptChoiceRes `protobuf:"bytes,1,rep,name=choices,proto3" json:"choices,omitempty"` // contains filtered or unexported fields }
func (*ChatgptChoicesRes) Descriptor
deprecated
func (*ChatgptChoicesRes) Descriptor() ([]byte, []int)
Deprecated: Use ChatgptChoicesRes.ProtoReflect.Descriptor instead.
func (*ChatgptChoicesRes) GetChoices ¶
func (x *ChatgptChoicesRes) GetChoices() []*ChatgptChoiceRes
func (*ChatgptChoicesRes) ProtoMessage ¶
func (*ChatgptChoicesRes) ProtoMessage()
func (*ChatgptChoicesRes) ProtoReflect ¶
func (x *ChatgptChoicesRes) ProtoReflect() protoreflect.Message
func (*ChatgptChoicesRes) Reset ¶
func (x *ChatgptChoicesRes) Reset()
func (*ChatgptChoicesRes) String ¶
func (x *ChatgptChoicesRes) String() string
func (*ChatgptChoicesRes) Validate ¶
func (m *ChatgptChoicesRes) Validate() error
Validate checks the field values on ChatgptChoicesRes 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 (*ChatgptChoicesRes) ValidateAll ¶
func (m *ChatgptChoicesRes) ValidateAll() error
ValidateAll checks the field values on ChatgptChoicesRes 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 ChatgptChoicesResMultiError, or nil if none found.
type ChatgptChoicesResMultiError ¶
type ChatgptChoicesResMultiError []error
ChatgptChoicesResMultiError is an error wrapping multiple validation errors returned by ChatgptChoicesRes.ValidateAll() if the designated constraints aren't met.
func (ChatgptChoicesResMultiError) AllErrors ¶
func (m ChatgptChoicesResMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ChatgptChoicesResMultiError) Error ¶
func (m ChatgptChoicesResMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ChatgptChoicesResValidationError ¶
type ChatgptChoicesResValidationError struct {
// contains filtered or unexported fields
}
ChatgptChoicesResValidationError is the validation error returned by ChatgptChoicesRes.Validate if the designated constraints aren't met.
func (ChatgptChoicesResValidationError) Cause ¶
func (e ChatgptChoicesResValidationError) Cause() error
Cause function returns cause value.
func (ChatgptChoicesResValidationError) Error ¶
func (e ChatgptChoicesResValidationError) Error() string
Error satisfies the builtin error interface
func (ChatgptChoicesResValidationError) ErrorName ¶
func (e ChatgptChoicesResValidationError) ErrorName() string
ErrorName returns error name.
func (ChatgptChoicesResValidationError) Field ¶
func (e ChatgptChoicesResValidationError) Field() string
Field function returns field value.
func (ChatgptChoicesResValidationError) Key ¶
func (e ChatgptChoicesResValidationError) Key() bool
Key function returns key value.
func (ChatgptChoicesResValidationError) Reason ¶
func (e ChatgptChoicesResValidationError) Reason() string
Reason function returns reason value.
type ChatgptMessageReq ¶
type ChatgptMessageReq struct { Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*ChatgptMessageReq) Descriptor
deprecated
func (*ChatgptMessageReq) Descriptor() ([]byte, []int)
Deprecated: Use ChatgptMessageReq.ProtoReflect.Descriptor instead.
func (*ChatgptMessageReq) GetContent ¶
func (x *ChatgptMessageReq) GetContent() string
func (*ChatgptMessageReq) GetRole ¶
func (x *ChatgptMessageReq) GetRole() string
func (*ChatgptMessageReq) ProtoMessage ¶
func (*ChatgptMessageReq) ProtoMessage()
func (*ChatgptMessageReq) ProtoReflect ¶
func (x *ChatgptMessageReq) ProtoReflect() protoreflect.Message
func (*ChatgptMessageReq) Reset ¶
func (x *ChatgptMessageReq) Reset()
func (*ChatgptMessageReq) String ¶
func (x *ChatgptMessageReq) String() string
func (*ChatgptMessageReq) Validate ¶
func (m *ChatgptMessageReq) Validate() error
Validate checks the field values on ChatgptMessageReq 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 (*ChatgptMessageReq) ValidateAll ¶
func (m *ChatgptMessageReq) ValidateAll() error
ValidateAll checks the field values on ChatgptMessageReq 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 ChatgptMessageReqMultiError, or nil if none found.
type ChatgptMessageReqMultiError ¶
type ChatgptMessageReqMultiError []error
ChatgptMessageReqMultiError is an error wrapping multiple validation errors returned by ChatgptMessageReq.ValidateAll() if the designated constraints aren't met.
func (ChatgptMessageReqMultiError) AllErrors ¶
func (m ChatgptMessageReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ChatgptMessageReqMultiError) Error ¶
func (m ChatgptMessageReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ChatgptMessageReqValidationError ¶
type ChatgptMessageReqValidationError struct {
// contains filtered or unexported fields
}
ChatgptMessageReqValidationError is the validation error returned by ChatgptMessageReq.Validate if the designated constraints aren't met.
func (ChatgptMessageReqValidationError) Cause ¶
func (e ChatgptMessageReqValidationError) Cause() error
Cause function returns cause value.
func (ChatgptMessageReqValidationError) Error ¶
func (e ChatgptMessageReqValidationError) Error() string
Error satisfies the builtin error interface
func (ChatgptMessageReqValidationError) ErrorName ¶
func (e ChatgptMessageReqValidationError) ErrorName() string
ErrorName returns error name.
func (ChatgptMessageReqValidationError) Field ¶
func (e ChatgptMessageReqValidationError) Field() string
Field function returns field value.
func (ChatgptMessageReqValidationError) Key ¶
func (e ChatgptMessageReqValidationError) Key() bool
Key function returns key value.
func (ChatgptMessageReqValidationError) Reason ¶
func (e ChatgptMessageReqValidationError) Reason() string
Reason function returns reason value.
type ChatgptUsageRes ¶
type ChatgptUsageRes struct { PromptTokes string `protobuf:"bytes,1,opt,name=prompt_tokes,json=promptTokes,proto3" json:"prompt_tokes,omitempty"` CompletionTokes string `protobuf:"bytes,2,opt,name=completion_tokes,json=completionTokes,proto3" json:"completion_tokes,omitempty"` TotalTokens int64 `protobuf:"varint,3,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"` // contains filtered or unexported fields }
func (*ChatgptUsageRes) Descriptor
deprecated
func (*ChatgptUsageRes) Descriptor() ([]byte, []int)
Deprecated: Use ChatgptUsageRes.ProtoReflect.Descriptor instead.
func (*ChatgptUsageRes) GetCompletionTokes ¶
func (x *ChatgptUsageRes) GetCompletionTokes() string
func (*ChatgptUsageRes) GetPromptTokes ¶
func (x *ChatgptUsageRes) GetPromptTokes() string
func (*ChatgptUsageRes) GetTotalTokens ¶
func (x *ChatgptUsageRes) GetTotalTokens() int64
func (*ChatgptUsageRes) ProtoMessage ¶
func (*ChatgptUsageRes) ProtoMessage()
func (*ChatgptUsageRes) ProtoReflect ¶
func (x *ChatgptUsageRes) ProtoReflect() protoreflect.Message
func (*ChatgptUsageRes) Reset ¶
func (x *ChatgptUsageRes) Reset()
func (*ChatgptUsageRes) String ¶
func (x *ChatgptUsageRes) String() string
func (*ChatgptUsageRes) Validate ¶
func (m *ChatgptUsageRes) Validate() error
Validate checks the field values on ChatgptUsageRes 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 (*ChatgptUsageRes) ValidateAll ¶
func (m *ChatgptUsageRes) ValidateAll() error
ValidateAll checks the field values on ChatgptUsageRes 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 ChatgptUsageResMultiError, or nil if none found.
type ChatgptUsageResMultiError ¶
type ChatgptUsageResMultiError []error
ChatgptUsageResMultiError is an error wrapping multiple validation errors returned by ChatgptUsageRes.ValidateAll() if the designated constraints aren't met.
func (ChatgptUsageResMultiError) AllErrors ¶
func (m ChatgptUsageResMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ChatgptUsageResMultiError) Error ¶
func (m ChatgptUsageResMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ChatgptUsageResValidationError ¶
type ChatgptUsageResValidationError struct {
// contains filtered or unexported fields
}
ChatgptUsageResValidationError is the validation error returned by ChatgptUsageRes.Validate if the designated constraints aren't met.
func (ChatgptUsageResValidationError) Cause ¶
func (e ChatgptUsageResValidationError) Cause() error
Cause function returns cause value.
func (ChatgptUsageResValidationError) Error ¶
func (e ChatgptUsageResValidationError) Error() string
Error satisfies the builtin error interface
func (ChatgptUsageResValidationError) ErrorName ¶
func (e ChatgptUsageResValidationError) ErrorName() string
ErrorName returns error name.
func (ChatgptUsageResValidationError) Field ¶
func (e ChatgptUsageResValidationError) Field() string
Field function returns field value.
func (ChatgptUsageResValidationError) Key ¶
func (e ChatgptUsageResValidationError) Key() bool
Key function returns key value.
func (ChatgptUsageResValidationError) Reason ¶
func (e ChatgptUsageResValidationError) Reason() string
Reason function returns reason value.
type CreateGptMessageReq ¶
type CreateGptMessageReq struct { // 模型 Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` Messages []*ChatgptMessageReq `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` // contains filtered or unexported fields }
请求 - chathpt请求查询
func (*CreateGptMessageReq) Descriptor
deprecated
func (*CreateGptMessageReq) Descriptor() ([]byte, []int)
Deprecated: Use CreateGptMessageReq.ProtoReflect.Descriptor instead.
func (*CreateGptMessageReq) GetMessages ¶
func (x *CreateGptMessageReq) GetMessages() []*ChatgptMessageReq
func (*CreateGptMessageReq) GetModel ¶
func (x *CreateGptMessageReq) GetModel() string
func (*CreateGptMessageReq) ProtoMessage ¶
func (*CreateGptMessageReq) ProtoMessage()
func (*CreateGptMessageReq) ProtoReflect ¶
func (x *CreateGptMessageReq) ProtoReflect() protoreflect.Message
func (*CreateGptMessageReq) Reset ¶
func (x *CreateGptMessageReq) Reset()
func (*CreateGptMessageReq) String ¶
func (x *CreateGptMessageReq) String() string
func (*CreateGptMessageReq) Validate ¶
func (m *CreateGptMessageReq) Validate() error
Validate checks the field values on CreateGptMessageReq 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 (*CreateGptMessageReq) ValidateAll ¶
func (m *CreateGptMessageReq) ValidateAll() error
ValidateAll checks the field values on CreateGptMessageReq 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 CreateGptMessageReqMultiError, or nil if none found.
type CreateGptMessageReqMultiError ¶
type CreateGptMessageReqMultiError []error
CreateGptMessageReqMultiError is an error wrapping multiple validation errors returned by CreateGptMessageReq.ValidateAll() if the designated constraints aren't met.
func (CreateGptMessageReqMultiError) AllErrors ¶
func (m CreateGptMessageReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateGptMessageReqMultiError) Error ¶
func (m CreateGptMessageReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateGptMessageReqValidationError ¶
type CreateGptMessageReqValidationError struct {
// contains filtered or unexported fields
}
CreateGptMessageReqValidationError is the validation error returned by CreateGptMessageReq.Validate if the designated constraints aren't met.
func (CreateGptMessageReqValidationError) Cause ¶
func (e CreateGptMessageReqValidationError) Cause() error
Cause function returns cause value.
func (CreateGptMessageReqValidationError) Error ¶
func (e CreateGptMessageReqValidationError) Error() string
Error satisfies the builtin error interface
func (CreateGptMessageReqValidationError) ErrorName ¶
func (e CreateGptMessageReqValidationError) ErrorName() string
ErrorName returns error name.
func (CreateGptMessageReqValidationError) Field ¶
func (e CreateGptMessageReqValidationError) Field() string
Field function returns field value.
func (CreateGptMessageReqValidationError) Key ¶
func (e CreateGptMessageReqValidationError) Key() bool
Key function returns key value.
func (CreateGptMessageReqValidationError) Reason ¶
func (e CreateGptMessageReqValidationError) Reason() string
Reason function returns reason value.
type CreateGptMessageRes ¶
type CreateGptMessageRes struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` Created int64 `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"` Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` Usage *ChatgptUsageRes `protobuf:"bytes,5,opt,name=usage,proto3" json:"usage,omitempty"` Choices []*ChatgptChoiceRes `protobuf:"bytes,6,rep,name=choices,proto3" json:"choices,omitempty"` Error *ErrorMessageRes `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
响应 - chathpt请求查询
func (*CreateGptMessageRes) Descriptor
deprecated
func (*CreateGptMessageRes) Descriptor() ([]byte, []int)
Deprecated: Use CreateGptMessageRes.ProtoReflect.Descriptor instead.
func (*CreateGptMessageRes) GetChoices ¶
func (x *CreateGptMessageRes) GetChoices() []*ChatgptChoiceRes
func (*CreateGptMessageRes) GetCreated ¶
func (x *CreateGptMessageRes) GetCreated() int64
func (*CreateGptMessageRes) GetError ¶
func (x *CreateGptMessageRes) GetError() *ErrorMessageRes
func (*CreateGptMessageRes) GetId ¶
func (x *CreateGptMessageRes) GetId() string
func (*CreateGptMessageRes) GetModel ¶
func (x *CreateGptMessageRes) GetModel() string
func (*CreateGptMessageRes) GetObject ¶
func (x *CreateGptMessageRes) GetObject() string
func (*CreateGptMessageRes) GetUsage ¶
func (x *CreateGptMessageRes) GetUsage() *ChatgptUsageRes
func (*CreateGptMessageRes) ProtoMessage ¶
func (*CreateGptMessageRes) ProtoMessage()
func (*CreateGptMessageRes) ProtoReflect ¶
func (x *CreateGptMessageRes) ProtoReflect() protoreflect.Message
func (*CreateGptMessageRes) Reset ¶
func (x *CreateGptMessageRes) Reset()
func (*CreateGptMessageRes) String ¶
func (x *CreateGptMessageRes) String() string
func (*CreateGptMessageRes) Validate ¶
func (m *CreateGptMessageRes) Validate() error
Validate checks the field values on CreateGptMessageRes 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 (*CreateGptMessageRes) ValidateAll ¶
func (m *CreateGptMessageRes) ValidateAll() error
ValidateAll checks the field values on CreateGptMessageRes 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 CreateGptMessageResMultiError, or nil if none found.
type CreateGptMessageResMultiError ¶
type CreateGptMessageResMultiError []error
CreateGptMessageResMultiError is an error wrapping multiple validation errors returned by CreateGptMessageRes.ValidateAll() if the designated constraints aren't met.
func (CreateGptMessageResMultiError) AllErrors ¶
func (m CreateGptMessageResMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateGptMessageResMultiError) Error ¶
func (m CreateGptMessageResMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateGptMessageResValidationError ¶
type CreateGptMessageResValidationError struct {
// contains filtered or unexported fields
}
CreateGptMessageResValidationError is the validation error returned by CreateGptMessageRes.Validate if the designated constraints aren't met.
func (CreateGptMessageResValidationError) Cause ¶
func (e CreateGptMessageResValidationError) Cause() error
Cause function returns cause value.
func (CreateGptMessageResValidationError) Error ¶
func (e CreateGptMessageResValidationError) Error() string
Error satisfies the builtin error interface
func (CreateGptMessageResValidationError) ErrorName ¶
func (e CreateGptMessageResValidationError) ErrorName() string
ErrorName returns error name.
func (CreateGptMessageResValidationError) Field ¶
func (e CreateGptMessageResValidationError) Field() string
Field function returns field value.
func (CreateGptMessageResValidationError) Key ¶
func (e CreateGptMessageResValidationError) Key() bool
Key function returns key value.
func (CreateGptMessageResValidationError) Reason ¶
func (e CreateGptMessageResValidationError) Reason() string
Reason function returns reason value.
type ErrorMessageRes ¶
type ErrorMessageRes struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*ErrorMessageRes) Descriptor
deprecated
func (*ErrorMessageRes) Descriptor() ([]byte, []int)
Deprecated: Use ErrorMessageRes.ProtoReflect.Descriptor instead.
func (*ErrorMessageRes) GetMessage ¶
func (x *ErrorMessageRes) GetMessage() string
func (*ErrorMessageRes) ProtoMessage ¶
func (*ErrorMessageRes) ProtoMessage()
func (*ErrorMessageRes) ProtoReflect ¶
func (x *ErrorMessageRes) ProtoReflect() protoreflect.Message
func (*ErrorMessageRes) Reset ¶
func (x *ErrorMessageRes) Reset()
func (*ErrorMessageRes) String ¶
func (x *ErrorMessageRes) String() string
func (*ErrorMessageRes) Validate ¶
func (m *ErrorMessageRes) Validate() error
Validate checks the field values on ErrorMessageRes 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 (*ErrorMessageRes) ValidateAll ¶
func (m *ErrorMessageRes) ValidateAll() error
ValidateAll checks the field values on ErrorMessageRes 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 ErrorMessageResMultiError, or nil if none found.
type ErrorMessageResMultiError ¶
type ErrorMessageResMultiError []error
ErrorMessageResMultiError is an error wrapping multiple validation errors returned by ErrorMessageRes.ValidateAll() if the designated constraints aren't met.
func (ErrorMessageResMultiError) AllErrors ¶
func (m ErrorMessageResMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ErrorMessageResMultiError) Error ¶
func (m ErrorMessageResMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ErrorMessageResValidationError ¶
type ErrorMessageResValidationError struct {
// contains filtered or unexported fields
}
ErrorMessageResValidationError is the validation error returned by ErrorMessageRes.Validate if the designated constraints aren't met.
func (ErrorMessageResValidationError) Cause ¶
func (e ErrorMessageResValidationError) Cause() error
Cause function returns cause value.
func (ErrorMessageResValidationError) Error ¶
func (e ErrorMessageResValidationError) Error() string
Error satisfies the builtin error interface
func (ErrorMessageResValidationError) ErrorName ¶
func (e ErrorMessageResValidationError) ErrorName() string
ErrorName returns error name.
func (ErrorMessageResValidationError) Field ¶
func (e ErrorMessageResValidationError) Field() string
Field function returns field value.
func (ErrorMessageResValidationError) Key ¶
func (e ErrorMessageResValidationError) Key() bool
Key function returns key value.
func (ErrorMessageResValidationError) Reason ¶
func (e ErrorMessageResValidationError) Reason() string
Reason function returns reason value.
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_RECORD_NOT_FOUND ErrorReason = 0 ErrorReason_RECORD_ALREADY_EXISTS ErrorReason = 1 ErrorReason_BAD_REQUEST ErrorReason = 2 ErrorReason_SYSTEM_ERROR ErrorReason = 3 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type UnimplementedAIServiceServer ¶
type UnimplementedAIServiceServer struct { }
UnimplementedAIServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAIServiceServer) CreateGptMessage ¶
func (UnimplementedAIServiceServer) CreateGptMessage(context.Context, *CreateGptMessageReq) (*CreateGptMessageRes, error)
type UnsafeAIServiceServer ¶
type UnsafeAIServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAIServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AIServiceServer will result in compilation errors.