server

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionHandler

type CompletionHandler struct {
	// contains filtered or unexported fields
}

CompletionHandler handles completion requests

func NewCompletionHandler

func NewCompletionHandler(llm gollm.LLM) *CompletionHandler

NewCompletionHandler creates a new completion handler

func (*CompletionHandler) ServeHTTP

func (h *CompletionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

type CompletionRequest

type CompletionRequest struct {
	Prompt string `json:"prompt"`
}

CompletionRequest represents an incoming completion request

type CompletionResponse

type CompletionResponse struct {
	Completion string `json:"completion"`
}

CompletionResponse represents the response to a completion request

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router handles HTTP routing

func NewRouter

func NewRouter(completion http.Handler) *Router

NewRouter creates a new router

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the HTTP server

func NewServer

func NewServer(cfg config.ServerConfig, handler http.Handler) *Server

NewServer creates a new server instance

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the server and blocks until shutdown

Directories

Path Synopsis
Package routing provides dynamic routing capabilities for the Hapax server.
Package routing provides dynamic routing capabilities for the Hapax server.

Jump to

Keyboard shortcuts

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