llmv1connect

package
v0.0.0-...-2442c6d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LLMServiceChatCompletionsProcedure is the fully-qualified name of the LLMService's
	// ChatCompletions RPC.
	LLMServiceChatCompletionsProcedure = "/llm.v1.LLMService/ChatCompletions"
	// LLMServiceStreamChatCompletionsProcedure is the fully-qualified name of the LLMService's
	// StreamChatCompletions RPC.
	LLMServiceStreamChatCompletionsProcedure = "/llm.v1.LLMService/StreamChatCompletions"
	// LLMServiceListModelsProcedure is the fully-qualified name of the LLMService's ListModels RPC.
	LLMServiceListModelsProcedure = "/llm.v1.LLMService/ListModels"
	// LLMServiceListProvidersProcedure is the fully-qualified name of the LLMService's ListProviders
	// RPC.
	LLMServiceListProvidersProcedure = "/llm.v1.LLMService/ListProviders"
	// LLMServiceCreateProviderProcedure is the fully-qualified name of the LLMService's CreateProvider
	// RPC.
	LLMServiceCreateProviderProcedure = "/llm.v1.LLMService/CreateProvider"
	// LLMServiceGetProviderProcedure is the fully-qualified name of the LLMService's GetProvider RPC.
	LLMServiceGetProviderProcedure = "/llm.v1.LLMService/GetProvider"
	// LLMServiceUpsertProviderProcedure is the fully-qualified name of the LLMService's UpsertProvider
	// RPC.
	LLMServiceUpsertProviderProcedure = "/llm.v1.LLMService/UpsertProvider"
	// LLMServiceDeleteProviderProcedure is the fully-qualified name of the LLMService's DeleteProvider
	// RPC.
	LLMServiceDeleteProviderProcedure = "/llm.v1.LLMService/DeleteProvider"
	// LLMServiceGetProviderConfigProcedure is the fully-qualified name of the LLMService's
	// GetProviderConfig RPC.
	LLMServiceGetProviderConfigProcedure = "/llm.v1.LLMService/GetProviderConfig"
	// LLMServiceListAPIKeysProcedure is the fully-qualified name of the LLMService's ListAPIKeys RPC.
	LLMServiceListAPIKeysProcedure = "/llm.v1.LLMService/ListAPIKeys"
	// LLMServiceCreateAPIKeyProcedure is the fully-qualified name of the LLMService's CreateAPIKey RPC.
	LLMServiceCreateAPIKeyProcedure = "/llm.v1.LLMService/CreateAPIKey"
	// LLMServiceGetAPIKeyProcedure is the fully-qualified name of the LLMService's GetAPIKey RPC.
	LLMServiceGetAPIKeyProcedure = "/llm.v1.LLMService/GetAPIKey"
	// LLMServiceUpdateAPIKeyProcedure is the fully-qualified name of the LLMService's UpdateAPIKey RPC.
	LLMServiceUpdateAPIKeyProcedure = "/llm.v1.LLMService/UpdateAPIKey"
	// LLMServiceDeleteAPIKeyProcedure is the fully-qualified name of the LLMService's DeleteAPIKey RPC.
	LLMServiceDeleteAPIKeyProcedure = "/llm.v1.LLMService/DeleteAPIKey"
	// LLMServiceListTrackingLogsProcedure is the fully-qualified name of the LLMService's
	// ListTrackingLogs RPC.
	LLMServiceListTrackingLogsProcedure = "/llm.v1.LLMService/ListTrackingLogs"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// LLMServiceName is the fully-qualified name of the LLMService service.
	LLMServiceName = "llm.v1.LLMService"
)

Variables

This section is empty.

Functions

func NewLLMServiceHandler

func NewLLMServiceHandler(svc LLMServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewLLMServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type LLMServiceClient

type LLMServiceClient interface {
	ChatCompletions(context.Context, *connect.Request[v1.ChatCompletionRequest]) (*connect.Response[v1.ChatCompletionResponse], error)
	StreamChatCompletions(context.Context, *connect.Request[v1.ChatCompletionRequest]) (*connect.ServerStreamForClient[v1.ChatCompletionResponse], error)
	ListModels(context.Context, *connect.Request[v1.ModelRequest]) (*connect.Response[v1.ModelResponse], error)
	ListProviders(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListProvidersResponse], error)
	CreateProvider(context.Context, *connect.Request[v1.CreateProviderRequest]) (*connect.Response[v1.CreateProviderResponse], error)
	GetProvider(context.Context, *connect.Request[v1.GetProviderRequest]) (*connect.Response[v1.GetProviderResponse], error)
	UpsertProvider(context.Context, *connect.Request[v1.UpdateProviderRequest]) (*connect.Response[v1.UpdateProviderResponse], error)
	DeleteProvider(context.Context, *connect.Request[v1.DeleteProviderRequest]) (*connect.Response[emptypb.Empty], error)
	GetProviderConfig(context.Context, *connect.Request[v1.GetProviderConfigRequest]) (*connect.Response[v1.GetProviderConfigResponse], error)
	ListAPIKeys(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListAPIKeysResponse], error)
	CreateAPIKey(context.Context, *connect.Request[v1.CreateAPIKeyRequest]) (*connect.Response[v1.CreateAPIKeyResponse], error)
	GetAPIKey(context.Context, *connect.Request[v1.GetAPIKeyRequest]) (*connect.Response[v1.GetAPIKeyResponse], error)
	UpdateAPIKey(context.Context, *connect.Request[v1.UpdateAPIKeyRequest]) (*connect.Response[v1.UpdateAPIKeyResponse], error)
	DeleteAPIKey(context.Context, *connect.Request[v1.DeleteAPIKeyRequest]) (*connect.Response[emptypb.Empty], error)
	ListTrackingLogs(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.LogResponse], error)
}

LLMServiceClient is a client for the llm.v1.LLMService service.

func NewLLMServiceClient

func NewLLMServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) LLMServiceClient

NewLLMServiceClient constructs a client for the llm.v1.LLMService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type LLMServiceHandler

type LLMServiceHandler interface {
	ChatCompletions(context.Context, *connect.Request[v1.ChatCompletionRequest]) (*connect.Response[v1.ChatCompletionResponse], error)
	StreamChatCompletions(context.Context, *connect.Request[v1.ChatCompletionRequest], *connect.ServerStream[v1.ChatCompletionResponse]) error
	ListModels(context.Context, *connect.Request[v1.ModelRequest]) (*connect.Response[v1.ModelResponse], error)
	ListProviders(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListProvidersResponse], error)
	CreateProvider(context.Context, *connect.Request[v1.CreateProviderRequest]) (*connect.Response[v1.CreateProviderResponse], error)
	GetProvider(context.Context, *connect.Request[v1.GetProviderRequest]) (*connect.Response[v1.GetProviderResponse], error)
	UpsertProvider(context.Context, *connect.Request[v1.UpdateProviderRequest]) (*connect.Response[v1.UpdateProviderResponse], error)
	DeleteProvider(context.Context, *connect.Request[v1.DeleteProviderRequest]) (*connect.Response[emptypb.Empty], error)
	GetProviderConfig(context.Context, *connect.Request[v1.GetProviderConfigRequest]) (*connect.Response[v1.GetProviderConfigResponse], error)
	ListAPIKeys(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListAPIKeysResponse], error)
	CreateAPIKey(context.Context, *connect.Request[v1.CreateAPIKeyRequest]) (*connect.Response[v1.CreateAPIKeyResponse], error)
	GetAPIKey(context.Context, *connect.Request[v1.GetAPIKeyRequest]) (*connect.Response[v1.GetAPIKeyResponse], error)
	UpdateAPIKey(context.Context, *connect.Request[v1.UpdateAPIKeyRequest]) (*connect.Response[v1.UpdateAPIKeyResponse], error)
	DeleteAPIKey(context.Context, *connect.Request[v1.DeleteAPIKeyRequest]) (*connect.Response[emptypb.Empty], error)
	ListTrackingLogs(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.LogResponse], error)
}

LLMServiceHandler is an implementation of the llm.v1.LLMService service.

type UnimplementedLLMServiceHandler

type UnimplementedLLMServiceHandler struct{}

UnimplementedLLMServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedLLMServiceHandler) ListModels

func (UnimplementedLLMServiceHandler) ListTrackingLogs

Jump to

Keyboard shortcuts

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