- Updated LLMClient interface to support model-specific generation and model listing. - Integrated model store and validator into the command application for managing AI models. - Implemented commands for setting, getting, and listing active AI models in Discord. - Enhanced AI query handling to utilize the selected model and return model information in responses. - Added caching mechanism for model validation to improve performance. - Introduced gRPC methods for listing available AI models in the ai-gateway. - Updated protobuf definitions to include model-related fields and messages. - Added tests for model store and validator functionalities.
309 lines
8.8 KiB
Go
309 lines
8.8 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// protoc (unknown)
|
|
// source: ai/v1/ai.proto
|
|
|
|
package aiv1
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
type QueryRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
|
|
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
|
|
Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *QueryRequest) Reset() {
|
|
*x = QueryRequest{}
|
|
mi := &file_ai_v1_ai_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *QueryRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*QueryRequest) ProtoMessage() {}
|
|
|
|
func (x *QueryRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_ai_v1_ai_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
|
|
func (*QueryRequest) Descriptor() ([]byte, []int) {
|
|
return file_ai_v1_ai_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *QueryRequest) GetText() string {
|
|
if x != nil {
|
|
return x.Text
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *QueryRequest) GetSource() string {
|
|
if x != nil {
|
|
return x.Source
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *QueryRequest) GetModel() string {
|
|
if x != nil {
|
|
return x.Model
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type QueryResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Reply string `protobuf:"bytes,1,opt,name=reply,proto3" json:"reply,omitempty"`
|
|
Intent string `protobuf:"bytes,2,opt,name=intent,proto3" json:"intent,omitempty"`
|
|
ActionTaken bool `protobuf:"varint,3,opt,name=action_taken,json=actionTaken,proto3" json:"action_taken,omitempty"`
|
|
ModelUsed string `protobuf:"bytes,4,opt,name=model_used,json=modelUsed,proto3" json:"model_used,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *QueryResponse) Reset() {
|
|
*x = QueryResponse{}
|
|
mi := &file_ai_v1_ai_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *QueryResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*QueryResponse) ProtoMessage() {}
|
|
|
|
func (x *QueryResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_ai_v1_ai_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
|
|
func (*QueryResponse) Descriptor() ([]byte, []int) {
|
|
return file_ai_v1_ai_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *QueryResponse) GetReply() string {
|
|
if x != nil {
|
|
return x.Reply
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *QueryResponse) GetIntent() string {
|
|
if x != nil {
|
|
return x.Intent
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *QueryResponse) GetActionTaken() bool {
|
|
if x != nil {
|
|
return x.ActionTaken
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *QueryResponse) GetModelUsed() string {
|
|
if x != nil {
|
|
return x.ModelUsed
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ListModelsRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ListModelsRequest) Reset() {
|
|
*x = ListModelsRequest{}
|
|
mi := &file_ai_v1_ai_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ListModelsRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListModelsRequest) ProtoMessage() {}
|
|
|
|
func (x *ListModelsRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_ai_v1_ai_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListModelsRequest.ProtoReflect.Descriptor instead.
|
|
func (*ListModelsRequest) Descriptor() ([]byte, []int) {
|
|
return file_ai_v1_ai_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
type ListModelsResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ListModelsResponse) Reset() {
|
|
*x = ListModelsResponse{}
|
|
mi := &file_ai_v1_ai_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ListModelsResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListModelsResponse) ProtoMessage() {}
|
|
|
|
func (x *ListModelsResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_ai_v1_ai_proto_msgTypes[3]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListModelsResponse.ProtoReflect.Descriptor instead.
|
|
func (*ListModelsResponse) Descriptor() ([]byte, []int) {
|
|
return file_ai_v1_ai_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *ListModelsResponse) GetNames() []string {
|
|
if x != nil {
|
|
return x.Names
|
|
}
|
|
return nil
|
|
}
|
|
|
|
var File_ai_v1_ai_proto protoreflect.FileDescriptor
|
|
|
|
const file_ai_v1_ai_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\x0eai/v1/ai.proto\x12\x05ai.v1\"P\n" +
|
|
"\fQueryRequest\x12\x12\n" +
|
|
"\x04text\x18\x01 \x01(\tR\x04text\x12\x16\n" +
|
|
"\x06source\x18\x02 \x01(\tR\x06source\x12\x14\n" +
|
|
"\x05model\x18\x03 \x01(\tR\x05model\"\x7f\n" +
|
|
"\rQueryResponse\x12\x14\n" +
|
|
"\x05reply\x18\x01 \x01(\tR\x05reply\x12\x16\n" +
|
|
"\x06intent\x18\x02 \x01(\tR\x06intent\x12!\n" +
|
|
"\faction_taken\x18\x03 \x01(\bR\vactionTaken\x12\x1d\n" +
|
|
"\n" +
|
|
"model_used\x18\x04 \x01(\tR\tmodelUsed\"\x13\n" +
|
|
"\x11ListModelsRequest\"*\n" +
|
|
"\x12ListModelsResponse\x12\x14\n" +
|
|
"\x05names\x18\x01 \x03(\tR\x05names2\x82\x01\n" +
|
|
"\tAIService\x122\n" +
|
|
"\x05Query\x12\x13.ai.v1.QueryRequest\x1a\x14.ai.v1.QueryResponse\x12A\n" +
|
|
"\n" +
|
|
"ListModels\x12\x18.ai.v1.ListModelsRequest\x1a\x19.ai.v1.ListModelsResponseB4Z2gitea.nik4nao.com/nik/home-services/gen/ai/v1;aiv1b\x06proto3"
|
|
|
|
var (
|
|
file_ai_v1_ai_proto_rawDescOnce sync.Once
|
|
file_ai_v1_ai_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_ai_v1_ai_proto_rawDescGZIP() []byte {
|
|
file_ai_v1_ai_proto_rawDescOnce.Do(func() {
|
|
file_ai_v1_ai_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ai_v1_ai_proto_rawDesc), len(file_ai_v1_ai_proto_rawDesc)))
|
|
})
|
|
return file_ai_v1_ai_proto_rawDescData
|
|
}
|
|
|
|
var file_ai_v1_ai_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
|
var file_ai_v1_ai_proto_goTypes = []any{
|
|
(*QueryRequest)(nil), // 0: ai.v1.QueryRequest
|
|
(*QueryResponse)(nil), // 1: ai.v1.QueryResponse
|
|
(*ListModelsRequest)(nil), // 2: ai.v1.ListModelsRequest
|
|
(*ListModelsResponse)(nil), // 3: ai.v1.ListModelsResponse
|
|
}
|
|
var file_ai_v1_ai_proto_depIdxs = []int32{
|
|
0, // 0: ai.v1.AIService.Query:input_type -> ai.v1.QueryRequest
|
|
2, // 1: ai.v1.AIService.ListModels:input_type -> ai.v1.ListModelsRequest
|
|
1, // 2: ai.v1.AIService.Query:output_type -> ai.v1.QueryResponse
|
|
3, // 3: ai.v1.AIService.ListModels:output_type -> ai.v1.ListModelsResponse
|
|
2, // [2:4] is the sub-list for method output_type
|
|
0, // [0:2] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_ai_v1_ai_proto_init() }
|
|
func file_ai_v1_ai_proto_init() {
|
|
if File_ai_v1_ai_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ai_v1_ai_proto_rawDesc), len(file_ai_v1_ai_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 4,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_ai_v1_ai_proto_goTypes,
|
|
DependencyIndexes: file_ai_v1_ai_proto_depIdxs,
|
|
MessageInfos: file_ai_v1_ai_proto_msgTypes,
|
|
}.Build()
|
|
File_ai_v1_ai_proto = out.File
|
|
file_ai_v1_ai_proto_goTypes = nil
|
|
file_ai_v1_ai_proto_depIdxs = nil
|
|
}
|