server

package
v0.175.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelClient added in v0.44.0

type ModelClient interface {
	GetModel(ctx context.Context, in *mv1.GetModelRequest, opts ...grpc.CallOption) (*mv1.Model, error)
}

ModelClient is an interface for a model client.

type NoopModelClient added in v0.44.0

type NoopModelClient struct {
}

NoopModelClient is a no-op model client.

func (*NoopModelClient) GetModel added in v0.44.0

func (c *NoopModelClient) GetModel(ctx context.Context, in *mv1.GetModelRequest, opts ...grpc.CallOption) (*mv1.Model, error)

GetModel is a no-op implementation of GetModel.

type NoopRewriter added in v0.139.0

type NoopRewriter struct {
}

NoopRewriter is a no-op rewriter.

func (*NoopRewriter) ProcessMessages added in v0.139.0

ProcessMessages is a no-op implementation of ProcessMessages.

type NoopVectorStoreClient added in v0.142.0

type NoopVectorStoreClient struct {
}

NoopVectorStoreClient is a no-op vector store client.

func (*NoopVectorStoreClient) GetVectorStoreByName added in v0.142.0

GetVectorStoreByName is a no-op implementation of GetVectorStoreByName.

type Rewriter added in v0.139.0

type Rewriter interface {
	ProcessMessages(
		ctx context.Context,
		vstore *vsv1.VectorStore,
		messages []*v1.CreateChatCompletionRequest_Message,
	) ([]*v1.CreateChatCompletionRequest_Message, error)
}

Rewriter is an interface for rag.

type S

type S struct {
	v1.UnimplementedChatServiceServer
	// contains filtered or unexported fields
}

S is a server.

func New

func New(
	m monitoring.MetricsMonitoring,
	modelClient ModelClient,
	vsClient VectorStoreClient,
	r Rewriter,
	taskQueue *infprocessor.TaskQueue,
) *S

New creates a server.

func (*S) CreateChatCompletion

func (s *S) CreateChatCompletion(
	w http.ResponseWriter,
	req *http.Request,
	pathParams map[string]string,
)

CreateChatCompletion creates a chat completion.

func (*S) Run

func (s *S) Run(ctx context.Context, port int, authConfig config.AuthConfig) error

Run starts the gRPC server.

func (*S) Stop

func (s *S) Stop()

Stop stops the gRPC server.

type VectorStoreClient added in v0.142.0

type VectorStoreClient interface {
	GetVectorStoreByName(ctx context.Context, req *vsv1.GetVectorStoreByNameRequest, opts ...grpc.CallOption) (*vsv1.VectorStore, error)
}

VectorStoreClient is an interface for a vector store client.

type WS added in v0.112.0

type WS struct {
	v1.UnimplementedInferenceWorkerServiceServer
	// contains filtered or unexported fields
}

WS is a server for worker services.

func NewWorkerServiceServer added in v0.112.0

func NewWorkerServiceServer(infProcessor *infprocessor.P) *WS

NewWorkerServiceServer creates a new worker service server.

func (*WS) ProcessTasks added in v0.115.0

func (ws *WS) ProcessTasks(srv v1.InferenceWorkerService_ProcessTasksServer) error

ProcessTasks processes tasks.

func (*WS) Run added in v0.112.0

func (ws *WS) Run(ctx context.Context, port int, authConfig config.AuthConfig, tlsConfig *config.TLS) error

Run runs the worker service server.

func (*WS) Stop added in v0.112.0

func (ws *WS) Stop()

Stop stops the worker service server.

Jump to

Keyboard shortcuts

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