diff --git a/gateway/internal/api/v1/chatcompletions.go b/gateway/internal/api/v1/chatcompletions.go index 844866a..801f4d5 100644 --- a/gateway/internal/api/v1/chatcompletions.go +++ b/gateway/internal/api/v1/chatcompletions.go @@ -40,10 +40,10 @@ func (s *V1Handler) GetChatCompletions( } providerName := req.Header().Get(constants.XMSProvider) - connectionObj := models.Connection{} - connectionObj.Name = providerName - connectionObj.Headers = headerConfig - + connectionObj := models.Connection{ + Name: providerName, + Headers: headerConfig, + } provider, err := s.providerService.GetProvider(connectionObj) if err != nil { return nil, errors.New(err) @@ -74,7 +74,9 @@ func (s *V1Handler) GetChatCompletions( } ingesterdata := make(map[string]interface{}) - ingesterdata["provider"] = provider.Name() + providerInfo := provider.Info() + + ingesterdata["provider"] = providerInfo.Name ingesterdata["model"] = data.Model ingesterdata["latency"] = latency ingesterdata["total_tokens"] = *data.Usage.TotalTokens diff --git a/gateway/internal/api/v1/models.go b/gateway/internal/api/v1/models.go index 55509a3..0835354 100644 --- a/gateway/internal/api/v1/models.go +++ b/gateway/internal/api/v1/models.go @@ -17,8 +17,9 @@ func (s *V1Handler) ListModels(ctx context.Context, req *connect.Request[llmv1.M continue } - providerName := provider.Name() + providerInfo := provider.Info() providerModels := provider.Models() + providerName := providerInfo.Name var models []*llmv1.Model for _, val := range providerModels { diff --git a/gateway/internal/api/v1/providers.go b/gateway/internal/api/v1/providers.go index a7465ed..edfab43 100644 --- a/gateway/internal/api/v1/providers.go +++ b/gateway/internal/api/v1/providers.go @@ -2,19 +2,26 @@ package v1 import ( "context" + "encoding/json" "connectrpc.com/connect" + "github.com/missingstudio/studio/backend/models" + "github.com/missingstudio/studio/common/errors" llmv1 "github.com/missingstudio/studio/protos/pkg/llm" "google.golang.org/protobuf/types/known/emptypb" + "google.golang.org/protobuf/types/known/structpb" ) func (s *V1Handler) ListProviders(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[llmv1.ProvidersResponse], error) { providers := s.providerService.GetProviders() data := []*llmv1.Provider{} - for name := range providers { + for _, provider := range providers { + providerInfo := provider.Info() data = append(data, &llmv1.Provider{ - Name: name, + Title: providerInfo.Title, + Name: providerInfo.Name, + Description: providerInfo.Description, }) } @@ -22,3 +29,42 @@ func (s *V1Handler) ListProviders(ctx context.Context, req *connect.Request[empt Providers: data, }), nil } + +func (s *V1Handler) GetProviderById(ctx context.Context, req *connect.Request[llmv1.GetProviderRequest]) (*connect.Response[llmv1.GetProviderResponse], error) { + provider, err := s.providerService.GetProvider(models.Connection{Name: req.Msg.Id}) + if err != nil { + return nil, errors.NewNotFound(err.Error()) + } + + info := provider.Info() + p := &llmv1.Provider{ + Title: info.Title, + Name: info.Name, + Description: info.Description, + } + + return connect.NewResponse(&llmv1.GetProviderResponse{ + Provider: p, + }), nil +} + +func (s *V1Handler) GetProviderConfig(ctx context.Context, req *connect.Request[llmv1.GetProviderConfigRequest]) (*connect.Response[llmv1.GetProviderConfigResponse], error) { + provider, err := s.providerService.GetProvider(models.Connection{Name: req.Msg.Id}) + if err != nil { + return nil, errors.NewNotFound(err.Error()) + } + + configs := map[string]any{} + if err := json.Unmarshal(provider.Schema(), &configs); err != nil { + return nil, errors.NewInternalError(err.Error()) + } + + stConfigs, err := structpb.NewStruct(configs) + if err != nil { + return nil, errors.NewInternalError(err.Error()) + } + + return connect.NewResponse(&llmv1.GetProviderConfigResponse{ + Config: stConfigs, + }), nil +} diff --git a/gateway/internal/mock/mock_provider.go b/gateway/internal/mock/mock_provider.go index 1f5299a..d51174d 100644 --- a/gateway/internal/mock/mock_provider.go +++ b/gateway/internal/mock/mock_provider.go @@ -5,17 +5,22 @@ import "github.com/missingstudio/studio/backend/internal/providers/base" var _ base.IProvider = &providerMock{} type providerMock struct { - name string + info base.ProviderInfo + config base.ProviderConfig } func NewProviderMock(name string) base.IProvider { return &providerMock{ - name: name, + info: base.ProviderInfo{Name: name}, } } -func (p providerMock) Name() string { - return p.name +func (p providerMock) Info() base.ProviderInfo { + return p.info +} + +func (p providerMock) Config() base.ProviderConfig { + return p.config } func (p providerMock) Schema() []byte { diff --git a/gateway/internal/providers/anyscale/base.go b/gateway/internal/providers/anyscale/base.go index f6eceb8..2c55226 100644 --- a/gateway/internal/providers/anyscale/base.go +++ b/gateway/internal/providers/anyscale/base.go @@ -13,19 +13,32 @@ var schema []byte var _ base.IProvider = &anyscaleProvider{} type anyscaleProvider struct { - name string + info base.ProviderInfo config base.ProviderConfig conn models.Connection } -func (anyscale anyscaleProvider) Name() string { - return anyscale.name +func (anyscale anyscaleProvider) Info() base.ProviderInfo { + return anyscale.info +} + +func (anyscale anyscaleProvider) Config() base.ProviderConfig { + return anyscale.config } func (anyscale anyscaleProvider) Schema() []byte { return schema } +func getAnyscaleInfo() base.ProviderInfo { + return base.ProviderInfo{ + Title: "Anyscale", + Name: "anyscale", + Description: `Anyscale Endpoints is a fast and scalable API to integrate OSS LLMs into your app. + Use our growing list of high performance models or deploy your own.`, + } +} + func getAnyscaleConfig(baseURL string) base.ProviderConfig { return base.ProviderConfig{ BaseURL: baseURL, @@ -37,7 +50,7 @@ func init() { models.ProviderRegistry["anyscale"] = func(connection models.Connection) base.IProvider { config := getAnyscaleConfig("https://api.endpoints.anyscale.com") return &anyscaleProvider{ - name: "Anyscale", + info: getAnyscaleInfo(), config: config, conn: connection, } diff --git a/gateway/internal/providers/azure/base.go b/gateway/internal/providers/azure/base.go index 96ff832..cd9ef3a 100644 --- a/gateway/internal/providers/azure/base.go +++ b/gateway/internal/providers/azure/base.go @@ -13,19 +13,31 @@ var schema []byte var _ base.IProvider = &azureProvider{} type azureProvider struct { - name string + info base.ProviderInfo config base.ProviderConfig conn models.Connection } -func (az azureProvider) Name() string { - return az.name +func (anyscale azureProvider) Info() base.ProviderInfo { + return anyscale.info +} + +func (az azureProvider) Config() base.ProviderConfig { + return az.config } func (az azureProvider) Schema() []byte { return schema } +func getAzureInfo() base.ProviderInfo { + return base.ProviderInfo{ + Title: "Azure", + Name: "azure", + Description: "Azure OpenAI Service offers industry-leading coding and language AI models that you can fine-tune to your specific needs for a variety of use cases.", + } +} + func getAzureConfig() base.ProviderConfig { return base.ProviderConfig{ BaseURL: "", @@ -33,13 +45,4 @@ func getAzureConfig() base.ProviderConfig { } } -func init() { - models.ProviderRegistry["azure"] = func(connection models.Connection) base.IProvider { - config := getAzureConfig() - return &azureProvider{ - name: "Azure", - config: config, - conn: connection, - } - } -} +func init() {} diff --git a/gateway/internal/providers/base/base.go b/gateway/internal/providers/base/base.go index ae6805a..94a2f3b 100644 --- a/gateway/internal/providers/base/base.go +++ b/gateway/internal/providers/base/base.go @@ -9,9 +9,15 @@ type ProviderConfig struct { BaseURL string ChatCompletions string } +type ProviderInfo struct { + Title string + Name string + Description string +} type IProvider interface { - Name() string + Info() ProviderInfo + Config() ProviderConfig Models() []string Schema() []byte } diff --git a/gateway/internal/providers/deepinfra/base.go b/gateway/internal/providers/deepinfra/base.go index 7155914..36198b8 100644 --- a/gateway/internal/providers/deepinfra/base.go +++ b/gateway/internal/providers/deepinfra/base.go @@ -13,19 +13,32 @@ var schema []byte var _ base.IProvider = &deepinfraProvider{} type deepinfraProvider struct { - name string + info base.ProviderInfo config base.ProviderConfig conn models.Connection } -func (deepinfra deepinfraProvider) Name() string { - return deepinfra.name +func (anyscale deepinfraProvider) Info() base.ProviderInfo { + return anyscale.info +} + +func (deepinfra deepinfraProvider) Config() base.ProviderConfig { + return deepinfra.config } func (deepinfra deepinfraProvider) Schema() []byte { return schema } +func getDeepinfraInfo() base.ProviderInfo { + return base.ProviderInfo{ + Title: "Deepinfra", + Name: "deepinfra", + Description: `Deep Infra offers 100+ machine learning models from Text-to-Image, Object-Detection, + Automatic-Speech-Recognition, Text-to-Text Generation, and more!`, + } +} + func getDeepinfraConfig(baseURL string) base.ProviderConfig { return base.ProviderConfig{ BaseURL: baseURL, @@ -37,7 +50,7 @@ func init() { models.ProviderRegistry["deepinfra"] = func(connection models.Connection) base.IProvider { config := getDeepinfraConfig("https://api.deepinfra.com/v1/openai") return &deepinfraProvider{ - name: "Deepinfra", + info: getDeepinfraInfo(), config: config, conn: connection, } diff --git a/gateway/internal/providers/openai/base.go b/gateway/internal/providers/openai/base.go index 4a063bb..41f266b 100644 --- a/gateway/internal/providers/openai/base.go +++ b/gateway/internal/providers/openai/base.go @@ -13,19 +13,31 @@ var schema []byte var _ base.IProvider = &openAIProvider{} type openAIProvider struct { - name string + info base.ProviderInfo config base.ProviderConfig conn models.Connection } -func (oai openAIProvider) Name() string { - return oai.name +func (anyscale openAIProvider) Info() base.ProviderInfo { + return anyscale.info +} + +func (oai openAIProvider) Config() base.ProviderConfig { + return oai.config } func (oai openAIProvider) Schema() []byte { return schema } +func getOpenAIInfo() base.ProviderInfo { + return base.ProviderInfo{ + Title: "OpenAI", + Name: "openai", + Description: `OpenAI API platform offers latest models and guides for safety best practices.`, + } +} + func getOpenAIConfig(baseURL string) base.ProviderConfig { return base.ProviderConfig{ BaseURL: baseURL, @@ -37,7 +49,7 @@ func init() { models.ProviderRegistry["openai"] = func(connection models.Connection) base.IProvider { config := getOpenAIConfig("https://api.openai.com") return &openAIProvider{ - name: "OpenAI", + info: getOpenAIInfo(), config: config, conn: connection, } diff --git a/gateway/internal/providers/togetherai/base.go b/gateway/internal/providers/togetherai/base.go index 9f31032..504071b 100644 --- a/gateway/internal/providers/togetherai/base.go +++ b/gateway/internal/providers/togetherai/base.go @@ -13,19 +13,31 @@ var schema []byte var _ base.IProvider = &togetherAIProvider{} type togetherAIProvider struct { - name string + info base.ProviderInfo config base.ProviderConfig conn models.Connection } -func (togetherAI togetherAIProvider) Name() string { - return togetherAI.name +func (anyscale togetherAIProvider) Info() base.ProviderInfo { + return anyscale.info +} + +func (togetherAI togetherAIProvider) Config() base.ProviderConfig { + return togetherAI.config } func (togetherAI togetherAIProvider) Schema() []byte { return schema } +func getTogetherAIInfo() base.ProviderInfo { + return base.ProviderInfo{ + Title: "Together AI", + Name: "togetherai", + Description: `Build gen AI models with Together AI. Benefit from the fastest and most cost-efficient tools and infra.`, + } +} + func getTogetherAIConfig(baseURL string) base.ProviderConfig { return base.ProviderConfig{ BaseURL: baseURL, @@ -37,7 +49,7 @@ func init() { models.ProviderRegistry["togetherai"] = func(connection models.Connection) base.IProvider { config := getTogetherAIConfig("https://api.together.xyz") return &togetherAIProvider{ - name: "Together AI", + info: getTogetherAIInfo(), config: config, conn: connection, } diff --git a/gateway/internal/router/priority_test.go b/gateway/internal/router/priority_test.go index 321c2b7..9c09f21 100644 --- a/gateway/internal/router/priority_test.go +++ b/gateway/internal/router/priority_test.go @@ -11,16 +11,20 @@ import ( func TestPriorityRouter(t *testing.T) { type Provider struct { - Name string + info base.ProviderInfo } type TestCase struct { - providers []Provider - expectedModelIDs []string + providers []Provider + expectedProviderIDs []string } tests := map[string]TestCase{ - "openai": {[]Provider{{"openai"}, {"anyscale"}, {"azure"}}, []string{"openai", "anyscale", "azure"}}, + "openai": {[]Provider{ + {info: base.ProviderInfo{Name: "openai"}}, + {info: base.ProviderInfo{Name: "anyscale"}}, + {info: base.ProviderInfo{Name: "azure"}}, + }, []string{"openai", "anyscale", "azure"}}, } for name, tc := range tests { @@ -28,16 +32,17 @@ func TestPriorityRouter(t *testing.T) { providers := make([]base.IProvider, 0, len(tc.providers)) for _, provider := range tc.providers { - providers = append(providers, mock.NewProviderMock(provider.Name)) + providers = append(providers, mock.NewProviderMock(provider.info.Name)) } routing := router.NewPriorityRouter(providers) iterator := routing.Iterator() - for _, modelID := range tc.expectedModelIDs { - model, err := iterator.Next() + for _, providerID := range tc.expectedProviderIDs { + provider, err := iterator.Next() + config := provider.Info() require.NoError(t, err) - require.Equal(t, modelID, model.Name()) + require.Equal(t, providerID, config.Name) } }) } diff --git a/gateway/internal/router/round_robin_test.go b/gateway/internal/router/round_robin_test.go index c2005e3..96b0b4f 100644 --- a/gateway/internal/router/round_robin_test.go +++ b/gateway/internal/router/round_robin_test.go @@ -11,7 +11,7 @@ import ( func TestRoundRobinRouter(t *testing.T) { type Provider struct { - Name string + info base.ProviderInfo } type TestCase struct { @@ -20,7 +20,11 @@ func TestRoundRobinRouter(t *testing.T) { } tests := map[string]TestCase{ - "public llms": {[]Provider{{"openai"}, {"anyscale"}, {"azure"}}, []string{"openai", "anyscale", "azure"}}, + "public llms": {[]Provider{ + {info: base.ProviderInfo{Name: "openai"}}, + {info: base.ProviderInfo{Name: "anyscale"}}, + {info: base.ProviderInfo{Name: "azure"}}, + }, []string{"openai", "anyscale", "azure"}}, } for name, tc := range tests { @@ -28,7 +32,7 @@ func TestRoundRobinRouter(t *testing.T) { providers := make([]base.IProvider, 0, len(tc.providers)) for _, provider := range tc.providers { - providers = append(providers, mock.NewProviderMock(provider.Name)) + providers = append(providers, mock.NewProviderMock(provider.info.Name)) } routing := router.NewRoundRobinRouter(providers) @@ -37,8 +41,9 @@ func TestRoundRobinRouter(t *testing.T) { // loop three times over the whole pool to check if we return back to the begging of the list for _, providerName := range tc.expectedModelIDs { provider, err := iterator.Next() + config := provider.Info() require.NoError(t, err) - require.Equal(t, providerName, provider.Name()) + require.Equal(t, providerName, config.Name) } }) } diff --git a/protos/pkg/llm/llmv1connect/service.connect.go b/protos/pkg/llm/llmv1connect/service.connect.go index f4a9960..663af62 100644 --- a/protos/pkg/llm/llmv1connect/service.connect.go +++ b/protos/pkg/llm/llmv1connect/service.connect.go @@ -45,6 +45,12 @@ const ( // LLMServiceListProvidersProcedure is the fully-qualified name of the LLMService's ListProviders // RPC. LLMServiceListProvidersProcedure = "/llm.v1.LLMService/ListProviders" + // LLMServiceGetProviderByIdProcedure is the fully-qualified name of the LLMService's + // GetProviderById RPC. + LLMServiceGetProviderByIdProcedure = "/llm.v1.LLMService/GetProviderById" + // LLMServiceGetProviderConfigProcedure is the fully-qualified name of the LLMService's + // GetProviderConfig RPC. + LLMServiceGetProviderConfigProcedure = "/llm.v1.LLMService/GetProviderConfig" // LLMServiceListTrackingLogsProcedure is the fully-qualified name of the LLMService's // ListTrackingLogs RPC. LLMServiceListTrackingLogsProcedure = "/llm.v1.LLMService/ListTrackingLogs" @@ -57,6 +63,8 @@ var ( lLMServiceGetStreamChatCompletionsMethodDescriptor = lLMServiceServiceDescriptor.Methods().ByName("GetStreamChatCompletions") lLMServiceListModelsMethodDescriptor = lLMServiceServiceDescriptor.Methods().ByName("ListModels") lLMServiceListProvidersMethodDescriptor = lLMServiceServiceDescriptor.Methods().ByName("ListProviders") + lLMServiceGetProviderByIdMethodDescriptor = lLMServiceServiceDescriptor.Methods().ByName("GetProviderById") + lLMServiceGetProviderConfigMethodDescriptor = lLMServiceServiceDescriptor.Methods().ByName("GetProviderConfig") lLMServiceListTrackingLogsMethodDescriptor = lLMServiceServiceDescriptor.Methods().ByName("ListTrackingLogs") ) @@ -66,6 +74,8 @@ type LLMServiceClient interface { GetStreamChatCompletions(context.Context, *connect.Request[llm.ChatCompletionRequest]) (*connect.ServerStreamForClient[llm.ChatCompletionResponse], error) ListModels(context.Context, *connect.Request[llm.ModelRequest]) (*connect.Response[llm.ModelResponse], error) ListProviders(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[llm.ProvidersResponse], error) + GetProviderById(context.Context, *connect.Request[llm.GetProviderRequest]) (*connect.Response[llm.GetProviderResponse], error) + GetProviderConfig(context.Context, *connect.Request[llm.GetProviderConfigRequest]) (*connect.Response[llm.GetProviderConfigResponse], error) ListTrackingLogs(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[llm.LogResponse], error) } @@ -103,6 +113,18 @@ func NewLLMServiceClient(httpClient connect.HTTPClient, baseURL string, opts ... connect.WithSchema(lLMServiceListProvidersMethodDescriptor), connect.WithClientOptions(opts...), ), + getProviderById: connect.NewClient[llm.GetProviderRequest, llm.GetProviderResponse]( + httpClient, + baseURL+LLMServiceGetProviderByIdProcedure, + connect.WithSchema(lLMServiceGetProviderByIdMethodDescriptor), + connect.WithClientOptions(opts...), + ), + getProviderConfig: connect.NewClient[llm.GetProviderConfigRequest, llm.GetProviderConfigResponse]( + httpClient, + baseURL+LLMServiceGetProviderConfigProcedure, + connect.WithSchema(lLMServiceGetProviderConfigMethodDescriptor), + connect.WithClientOptions(opts...), + ), listTrackingLogs: connect.NewClient[emptypb.Empty, llm.LogResponse]( httpClient, baseURL+LLMServiceListTrackingLogsProcedure, @@ -118,6 +140,8 @@ type lLMServiceClient struct { getStreamChatCompletions *connect.Client[llm.ChatCompletionRequest, llm.ChatCompletionResponse] listModels *connect.Client[llm.ModelRequest, llm.ModelResponse] listProviders *connect.Client[emptypb.Empty, llm.ProvidersResponse] + getProviderById *connect.Client[llm.GetProviderRequest, llm.GetProviderResponse] + getProviderConfig *connect.Client[llm.GetProviderConfigRequest, llm.GetProviderConfigResponse] listTrackingLogs *connect.Client[emptypb.Empty, llm.LogResponse] } @@ -141,6 +165,16 @@ func (c *lLMServiceClient) ListProviders(ctx context.Context, req *connect.Reque return c.listProviders.CallUnary(ctx, req) } +// GetProviderById calls llm.v1.LLMService.GetProviderById. +func (c *lLMServiceClient) GetProviderById(ctx context.Context, req *connect.Request[llm.GetProviderRequest]) (*connect.Response[llm.GetProviderResponse], error) { + return c.getProviderById.CallUnary(ctx, req) +} + +// GetProviderConfig calls llm.v1.LLMService.GetProviderConfig. +func (c *lLMServiceClient) GetProviderConfig(ctx context.Context, req *connect.Request[llm.GetProviderConfigRequest]) (*connect.Response[llm.GetProviderConfigResponse], error) { + return c.getProviderConfig.CallUnary(ctx, req) +} + // ListTrackingLogs calls llm.v1.LLMService.ListTrackingLogs. func (c *lLMServiceClient) ListTrackingLogs(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[llm.LogResponse], error) { return c.listTrackingLogs.CallUnary(ctx, req) @@ -152,6 +186,8 @@ type LLMServiceHandler interface { GetStreamChatCompletions(context.Context, *connect.Request[llm.ChatCompletionRequest], *connect.ServerStream[llm.ChatCompletionResponse]) error ListModels(context.Context, *connect.Request[llm.ModelRequest]) (*connect.Response[llm.ModelResponse], error) ListProviders(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[llm.ProvidersResponse], error) + GetProviderById(context.Context, *connect.Request[llm.GetProviderRequest]) (*connect.Response[llm.GetProviderResponse], error) + GetProviderConfig(context.Context, *connect.Request[llm.GetProviderConfigRequest]) (*connect.Response[llm.GetProviderConfigResponse], error) ListTrackingLogs(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[llm.LogResponse], error) } @@ -185,6 +221,18 @@ func NewLLMServiceHandler(svc LLMServiceHandler, opts ...connect.HandlerOption) connect.WithSchema(lLMServiceListProvidersMethodDescriptor), connect.WithHandlerOptions(opts...), ) + lLMServiceGetProviderByIdHandler := connect.NewUnaryHandler( + LLMServiceGetProviderByIdProcedure, + svc.GetProviderById, + connect.WithSchema(lLMServiceGetProviderByIdMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + lLMServiceGetProviderConfigHandler := connect.NewUnaryHandler( + LLMServiceGetProviderConfigProcedure, + svc.GetProviderConfig, + connect.WithSchema(lLMServiceGetProviderConfigMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) lLMServiceListTrackingLogsHandler := connect.NewUnaryHandler( LLMServiceListTrackingLogsProcedure, svc.ListTrackingLogs, @@ -201,6 +249,10 @@ func NewLLMServiceHandler(svc LLMServiceHandler, opts ...connect.HandlerOption) lLMServiceListModelsHandler.ServeHTTP(w, r) case LLMServiceListProvidersProcedure: lLMServiceListProvidersHandler.ServeHTTP(w, r) + case LLMServiceGetProviderByIdProcedure: + lLMServiceGetProviderByIdHandler.ServeHTTP(w, r) + case LLMServiceGetProviderConfigProcedure: + lLMServiceGetProviderConfigHandler.ServeHTTP(w, r) case LLMServiceListTrackingLogsProcedure: lLMServiceListTrackingLogsHandler.ServeHTTP(w, r) default: @@ -228,6 +280,14 @@ func (UnimplementedLLMServiceHandler) ListProviders(context.Context, *connect.Re return nil, connect.NewError(connect.CodeUnimplemented, errors.New("llm.v1.LLMService.ListProviders is not implemented")) } +func (UnimplementedLLMServiceHandler) GetProviderById(context.Context, *connect.Request[llm.GetProviderRequest]) (*connect.Response[llm.GetProviderResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("llm.v1.LLMService.GetProviderById is not implemented")) +} + +func (UnimplementedLLMServiceHandler) GetProviderConfig(context.Context, *connect.Request[llm.GetProviderConfigRequest]) (*connect.Response[llm.GetProviderConfigResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("llm.v1.LLMService.GetProviderConfig is not implemented")) +} + func (UnimplementedLLMServiceHandler) ListTrackingLogs(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[llm.LogResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("llm.v1.LLMService.ListTrackingLogs is not implemented")) } diff --git a/protos/pkg/llm/service.pb.go b/protos/pkg/llm/service.pb.go index 1548685..6e8857f 100644 --- a/protos/pkg/llm/service.pb.go +++ b/protos/pkg/llm/service.pb.go @@ -966,8 +966,10 @@ type Provider struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Config *structpb.Struct `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` } func (x *Provider) Reset() { @@ -1002,6 +1004,13 @@ func (*Provider) Descriptor() ([]byte, []int) { return file_llm_service_proto_rawDescGZIP(), []int{12} } +func (x *Provider) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + func (x *Provider) GetName() string { if x != nil { return x.Name @@ -1009,13 +1018,20 @@ func (x *Provider) GetName() string { return "" } -func (x *Provider) GetValue() string { +func (x *Provider) GetDescription() string { if x != nil { - return x.Value + return x.Description } return "" } +func (x *Provider) GetConfig() *structpb.Struct { + if x != nil { + return x.Config + } + return nil +} + type ProvidersResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1063,6 +1079,194 @@ func (x *ProvidersResponse) GetProviders() []*Provider { return nil } +type GetProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetProviderRequest) Reset() { + *x = GetProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_llm_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProviderRequest) ProtoMessage() {} + +func (x *GetProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_llm_service_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProviderRequest.ProtoReflect.Descriptor instead. +func (*GetProviderRequest) Descriptor() ([]byte, []int) { + return file_llm_service_proto_rawDescGZIP(), []int{14} +} + +func (x *GetProviderRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Provider *Provider `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` +} + +func (x *GetProviderResponse) Reset() { + *x = GetProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_llm_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProviderResponse) ProtoMessage() {} + +func (x *GetProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_llm_service_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProviderResponse.ProtoReflect.Descriptor instead. +func (*GetProviderResponse) Descriptor() ([]byte, []int) { + return file_llm_service_proto_rawDescGZIP(), []int{15} +} + +func (x *GetProviderResponse) GetProvider() *Provider { + if x != nil { + return x.Provider + } + return nil +} + +type GetProviderConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetProviderConfigRequest) Reset() { + *x = GetProviderConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_llm_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProviderConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProviderConfigRequest) ProtoMessage() {} + +func (x *GetProviderConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_llm_service_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProviderConfigRequest.ProtoReflect.Descriptor instead. +func (*GetProviderConfigRequest) Descriptor() ([]byte, []int) { + return file_llm_service_proto_rawDescGZIP(), []int{16} +} + +func (x *GetProviderConfigRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetProviderConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config *structpb.Struct `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *GetProviderConfigResponse) Reset() { + *x = GetProviderConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_llm_service_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProviderConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProviderConfigResponse) ProtoMessage() {} + +func (x *GetProviderConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_llm_service_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProviderConfigResponse.ProtoReflect.Descriptor instead. +func (*GetProviderConfigResponse) Descriptor() ([]byte, []int) { + return file_llm_service_proto_rawDescGZIP(), []int{17} +} + +func (x *GetProviderConfigResponse) GetConfig() *structpb.Struct { + if x != nil { + return x.Config + } + return nil +} + var File_llm_service_proto protoreflect.FileDescriptor var file_llm_service_proto_rawDesc = []byte{ @@ -1218,61 +1422,95 @@ var file_llm_service_proto_rawDesc = []byte{ 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, - 0x34, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x43, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x87, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x43, 0x0a, 0x11, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, + 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, 0x24, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x43, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2a, 0x39, 0x0a, 0x0c, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x55, - 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x10, 0x01, - 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x10, 0x03, 0x32, 0x97, 0x04, 0x0a, 0x0a, 0x4c, 0x4c, 0x4d, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x6c, 0x6c, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x18, 0x47, - 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, - 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x30, 0x01, - 0x12, 0x50, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x14, - 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0f, 0x3a, 0x01, 0x2a, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x73, 0x12, 0x5c, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x6c, 0x6c, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, - 0x2a, 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, - 0x12, 0x5d, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, - 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x6c, - 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x12, 0x11, 0x2f, 0x76, - 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x42, - 0x89, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6e, 0x67, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x6c, 0x6d, 0x3b, 0x6c, - 0x6c, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4c, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x4c, 0x6c, 0x6d, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x4c, 0x6c, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x4c, - 0x6c, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x07, 0x4c, 0x6c, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x2a, 0x0a, 0x18, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4c, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2a, 0x39, 0x0a, 0x0c, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, + 0x50, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x32, 0xfd, + 0x05, 0x0a, 0x0a, 0x4c, 0x4c, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, + 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x1d, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1e, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x3a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x30, 0x01, 0x12, 0x50, 0x0a, 0x0a, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x14, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x3a, 0x01, 0x2a, 0x12, + 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x5c, 0x0a, 0x0d, 0x4c, + 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x66, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x1a, 0x2e, 0x6c, + 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x7c, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, + 0x5d, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x4c, + 0x6f, 0x67, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x6c, 0x6c, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x12, 0x11, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x89, + 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x6c, 0x6c, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x6c, 0x6d, 0x3b, 0x6c, 0x6c, + 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4c, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x4c, 0x6c, 0x6d, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x06, 0x4c, 0x6c, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x4c, 0x6c, + 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x07, 0x4c, 0x6c, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1288,57 +1526,68 @@ func file_llm_service_proto_rawDescGZIP() []byte { } var file_llm_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_llm_service_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_llm_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_llm_service_proto_goTypes = []interface{}{ - (FinishReason)(0), // 0: llm.v1.FinishReason - (*Role)(nil), // 1: llm.v1.Role - (*ResponseFormat)(nil), // 2: llm.v1.ResponseFormat - (*ChatCompletionMessage)(nil), // 3: llm.v1.ChatCompletionMessage - (*ChatCompletionRequest)(nil), // 4: llm.v1.ChatCompletionRequest - (*CompletionChoice)(nil), // 5: llm.v1.CompletionChoice - (*Usage)(nil), // 6: llm.v1.Usage - (*ChatCompletionResponse)(nil), // 7: llm.v1.ChatCompletionResponse - (*ModelRequest)(nil), // 8: llm.v1.ModelRequest - (*ModelResponse)(nil), // 9: llm.v1.ModelResponse - (*ProviderModels)(nil), // 10: llm.v1.ProviderModels - (*Model)(nil), // 11: llm.v1.Model - (*LogResponse)(nil), // 12: llm.v1.LogResponse - (*Provider)(nil), // 13: llm.v1.Provider - (*ProvidersResponse)(nil), // 14: llm.v1.ProvidersResponse - nil, // 15: llm.v1.ModelResponse.ModelsEntry - (*structpb.Struct)(nil), // 16: google.protobuf.Struct - (*emptypb.Empty)(nil), // 17: google.protobuf.Empty + (FinishReason)(0), // 0: llm.v1.FinishReason + (*Role)(nil), // 1: llm.v1.Role + (*ResponseFormat)(nil), // 2: llm.v1.ResponseFormat + (*ChatCompletionMessage)(nil), // 3: llm.v1.ChatCompletionMessage + (*ChatCompletionRequest)(nil), // 4: llm.v1.ChatCompletionRequest + (*CompletionChoice)(nil), // 5: llm.v1.CompletionChoice + (*Usage)(nil), // 6: llm.v1.Usage + (*ChatCompletionResponse)(nil), // 7: llm.v1.ChatCompletionResponse + (*ModelRequest)(nil), // 8: llm.v1.ModelRequest + (*ModelResponse)(nil), // 9: llm.v1.ModelResponse + (*ProviderModels)(nil), // 10: llm.v1.ProviderModels + (*Model)(nil), // 11: llm.v1.Model + (*LogResponse)(nil), // 12: llm.v1.LogResponse + (*Provider)(nil), // 13: llm.v1.Provider + (*ProvidersResponse)(nil), // 14: llm.v1.ProvidersResponse + (*GetProviderRequest)(nil), // 15: llm.v1.GetProviderRequest + (*GetProviderResponse)(nil), // 16: llm.v1.GetProviderResponse + (*GetProviderConfigRequest)(nil), // 17: llm.v1.GetProviderConfigRequest + (*GetProviderConfigResponse)(nil), // 18: llm.v1.GetProviderConfigResponse + nil, // 19: llm.v1.ModelResponse.ModelsEntry + (*structpb.Struct)(nil), // 20: google.protobuf.Struct + (*emptypb.Empty)(nil), // 21: google.protobuf.Empty } var file_llm_service_proto_depIdxs = []int32{ - 16, // 0: llm.v1.ChatCompletionMessage.logprobs:type_name -> google.protobuf.Struct + 20, // 0: llm.v1.ChatCompletionMessage.logprobs:type_name -> google.protobuf.Struct 3, // 1: llm.v1.ChatCompletionRequest.messages:type_name -> llm.v1.ChatCompletionMessage - 16, // 2: llm.v1.ChatCompletionRequest.logit_bias:type_name -> google.protobuf.Struct + 20, // 2: llm.v1.ChatCompletionRequest.logit_bias:type_name -> google.protobuf.Struct 2, // 3: llm.v1.ChatCompletionRequest.response_format:type_name -> llm.v1.ResponseFormat - 16, // 4: llm.v1.ChatCompletionRequest.tool_choice:type_name -> google.protobuf.Struct + 20, // 4: llm.v1.ChatCompletionRequest.tool_choice:type_name -> google.protobuf.Struct 3, // 5: llm.v1.CompletionChoice.message:type_name -> llm.v1.ChatCompletionMessage - 16, // 6: llm.v1.CompletionChoice.logprobs:type_name -> google.protobuf.Struct + 20, // 6: llm.v1.CompletionChoice.logprobs:type_name -> google.protobuf.Struct 5, // 7: llm.v1.ChatCompletionResponse.choices:type_name -> llm.v1.CompletionChoice 6, // 8: llm.v1.ChatCompletionResponse.usage:type_name -> llm.v1.Usage - 15, // 9: llm.v1.ModelResponse.models:type_name -> llm.v1.ModelResponse.ModelsEntry + 19, // 9: llm.v1.ModelResponse.models:type_name -> llm.v1.ModelResponse.ModelsEntry 11, // 10: llm.v1.ProviderModels.models:type_name -> llm.v1.Model - 16, // 11: llm.v1.LogResponse.logs:type_name -> google.protobuf.Struct - 13, // 12: llm.v1.ProvidersResponse.providers:type_name -> llm.v1.Provider - 10, // 13: llm.v1.ModelResponse.ModelsEntry.value:type_name -> llm.v1.ProviderModels - 4, // 14: llm.v1.LLMService.GetChatCompletions:input_type -> llm.v1.ChatCompletionRequest - 4, // 15: llm.v1.LLMService.GetStreamChatCompletions:input_type -> llm.v1.ChatCompletionRequest - 8, // 16: llm.v1.LLMService.ListModels:input_type -> llm.v1.ModelRequest - 17, // 17: llm.v1.LLMService.ListProviders:input_type -> google.protobuf.Empty - 17, // 18: llm.v1.LLMService.ListTrackingLogs:input_type -> google.protobuf.Empty - 7, // 19: llm.v1.LLMService.GetChatCompletions:output_type -> llm.v1.ChatCompletionResponse - 7, // 20: llm.v1.LLMService.GetStreamChatCompletions:output_type -> llm.v1.ChatCompletionResponse - 9, // 21: llm.v1.LLMService.ListModels:output_type -> llm.v1.ModelResponse - 14, // 22: llm.v1.LLMService.ListProviders:output_type -> llm.v1.ProvidersResponse - 12, // 23: llm.v1.LLMService.ListTrackingLogs:output_type -> llm.v1.LogResponse - 19, // [19:24] is the sub-list for method output_type - 14, // [14:19] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 20, // 11: llm.v1.LogResponse.logs:type_name -> google.protobuf.Struct + 20, // 12: llm.v1.Provider.config:type_name -> google.protobuf.Struct + 13, // 13: llm.v1.ProvidersResponse.providers:type_name -> llm.v1.Provider + 13, // 14: llm.v1.GetProviderResponse.provider:type_name -> llm.v1.Provider + 20, // 15: llm.v1.GetProviderConfigResponse.config:type_name -> google.protobuf.Struct + 10, // 16: llm.v1.ModelResponse.ModelsEntry.value:type_name -> llm.v1.ProviderModels + 4, // 17: llm.v1.LLMService.GetChatCompletions:input_type -> llm.v1.ChatCompletionRequest + 4, // 18: llm.v1.LLMService.GetStreamChatCompletions:input_type -> llm.v1.ChatCompletionRequest + 8, // 19: llm.v1.LLMService.ListModels:input_type -> llm.v1.ModelRequest + 21, // 20: llm.v1.LLMService.ListProviders:input_type -> google.protobuf.Empty + 15, // 21: llm.v1.LLMService.GetProviderById:input_type -> llm.v1.GetProviderRequest + 17, // 22: llm.v1.LLMService.GetProviderConfig:input_type -> llm.v1.GetProviderConfigRequest + 21, // 23: llm.v1.LLMService.ListTrackingLogs:input_type -> google.protobuf.Empty + 7, // 24: llm.v1.LLMService.GetChatCompletions:output_type -> llm.v1.ChatCompletionResponse + 7, // 25: llm.v1.LLMService.GetStreamChatCompletions:output_type -> llm.v1.ChatCompletionResponse + 9, // 26: llm.v1.LLMService.ListModels:output_type -> llm.v1.ModelResponse + 14, // 27: llm.v1.LLMService.ListProviders:output_type -> llm.v1.ProvidersResponse + 16, // 28: llm.v1.LLMService.GetProviderById:output_type -> llm.v1.GetProviderResponse + 18, // 29: llm.v1.LLMService.GetProviderConfig:output_type -> llm.v1.GetProviderConfigResponse + 12, // 30: llm.v1.LLMService.ListTrackingLogs:output_type -> llm.v1.LogResponse + 24, // [24:31] is the sub-list for method output_type + 17, // [17:24] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_llm_service_proto_init() } @@ -1515,6 +1764,54 @@ func file_llm_service_proto_init() { return nil } } + file_llm_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_llm_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_llm_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProviderConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_llm_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProviderConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_llm_service_proto_msgTypes[0].OneofWrappers = []interface{}{ (*Role_System)(nil), @@ -1529,7 +1826,7 @@ func file_llm_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_llm_service_proto_rawDesc, NumEnums: 1, - NumMessages: 15, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, diff --git a/protos/proto/llm/service.proto b/protos/proto/llm/service.proto index bbfa7b1..9d59eb9 100644 --- a/protos/proto/llm/service.proto +++ b/protos/proto/llm/service.proto @@ -27,6 +27,14 @@ service LLMService { option (google.api.http).body = "*"; } + rpc GetProviderById(GetProviderRequest) returns (GetProviderResponse) { + option (google.api.http) = {get: "/v1/providers/{id}"}; + } + + rpc GetProviderConfig(GetProviderConfigRequest) returns (GetProviderConfigResponse) { + option (google.api.http) = {get: "/v1/providers/{id}/configs"}; + } + rpc ListTrackingLogs(google.protobuf.Empty) returns (LogResponse) { option (google.api.http).get = "/v1/tracking/logs"; option (google.api.http).body = "*"; @@ -147,10 +155,28 @@ message LogResponse { } message Provider { - string name = 1; - string value = 2; + string title = 1; + string name = 2; + string description = 3; + google.protobuf.Struct config = 4; } message ProvidersResponse { repeated Provider providers = 1; } + +message GetProviderRequest { + string id = 1; +} + +message GetProviderResponse { + Provider provider = 1; +} + +message GetProviderConfigRequest { + string id = 1; +} + +message GetProviderConfigResponse { + google.protobuf.Struct config = 1; +} \ No newline at end of file diff --git a/protos/src/llm/service_connect.ts b/protos/src/llm/service_connect.ts index c54568f..0de873f 100644 --- a/protos/src/llm/service_connect.ts +++ b/protos/src/llm/service_connect.ts @@ -3,7 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import { ChatCompletionRequest, ChatCompletionResponse, LogResponse, ModelRequest, ModelResponse, ProvidersResponse } from "./service_pb"; +import { ChatCompletionRequest, ChatCompletionResponse, GetProviderConfigRequest, GetProviderConfigResponse, GetProviderRequest, GetProviderResponse, LogResponse, ModelRequest, ModelResponse, ProvidersResponse } from "./service_pb"; import { Empty, MethodKind } from "@bufbuild/protobuf"; /** @@ -48,6 +48,24 @@ export const LLMService = { O: ProvidersResponse, kind: MethodKind.Unary, }, + /** + * @generated from rpc llm.v1.LLMService.GetProviderById + */ + getProviderById: { + name: "GetProviderById", + I: GetProviderRequest, + O: GetProviderResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc llm.v1.LLMService.GetProviderConfig + */ + getProviderConfig: { + name: "GetProviderConfig", + I: GetProviderConfigRequest, + O: GetProviderConfigResponse, + kind: MethodKind.Unary, + }, /** * @generated from rpc llm.v1.LLMService.ListTrackingLogs */ diff --git a/protos/src/llm/service_pb.ts b/protos/src/llm/service_pb.ts index 8f9294b..e3aab2b 100644 --- a/protos/src/llm/service_pb.ts +++ b/protos/src/llm/service_pb.ts @@ -733,14 +733,24 @@ export class LogResponse extends Message { */ export class Provider extends Message { /** - * @generated from field: string name = 1; + * @generated from field: string title = 1; + */ + title = ""; + + /** + * @generated from field: string name = 2; */ name = ""; /** - * @generated from field: string value = 2; + * @generated from field: string description = 3; */ - value = ""; + description = ""; + + /** + * @generated from field: google.protobuf.Struct config = 4; + */ + config?: Struct; constructor(data?: PartialMessage) { super(); @@ -750,8 +760,10 @@ export class Provider extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "llm.v1.Provider"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "config", kind: "message", T: Struct }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Provider { @@ -808,3 +820,151 @@ export class ProvidersResponse extends Message { } } +/** + * @generated from message llm.v1.GetProviderRequest + */ +export class GetProviderRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "llm.v1.GetProviderRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProviderRequest { + return new GetProviderRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProviderRequest { + return new GetProviderRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProviderRequest { + return new GetProviderRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetProviderRequest | PlainMessage | undefined, b: GetProviderRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProviderRequest, a, b); + } +} + +/** + * @generated from message llm.v1.GetProviderResponse + */ +export class GetProviderResponse extends Message { + /** + * @generated from field: llm.v1.Provider provider = 1; + */ + provider?: Provider; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "llm.v1.GetProviderResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "provider", kind: "message", T: Provider }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProviderResponse { + return new GetProviderResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProviderResponse { + return new GetProviderResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProviderResponse { + return new GetProviderResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetProviderResponse | PlainMessage | undefined, b: GetProviderResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProviderResponse, a, b); + } +} + +/** + * @generated from message llm.v1.GetProviderConfigRequest + */ +export class GetProviderConfigRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "llm.v1.GetProviderConfigRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProviderConfigRequest { + return new GetProviderConfigRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProviderConfigRequest { + return new GetProviderConfigRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProviderConfigRequest { + return new GetProviderConfigRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetProviderConfigRequest | PlainMessage | undefined, b: GetProviderConfigRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProviderConfigRequest, a, b); + } +} + +/** + * @generated from message llm.v1.GetProviderConfigResponse + */ +export class GetProviderConfigResponse extends Message { + /** + * @generated from field: google.protobuf.Struct config = 1; + */ + config?: Struct; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "llm.v1.GetProviderConfigResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "config", kind: "message", T: Struct }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProviderConfigResponse { + return new GetProviderConfigResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProviderConfigResponse { + return new GetProviderConfigResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProviderConfigResponse { + return new GetProviderConfigResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetProviderConfigResponse | PlainMessage | undefined, b: GetProviderConfigResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProviderConfigResponse, a, b); + } +} +