api

package
v0.0.0-...-d39df66 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Content string `json:"content,omitempty"`

	Segments []Segment `json:"segments,omitempty"`
}

type Handler

type Handler struct {
	*config.Config
	http.Handler
}

func New

func New(cfg *config.Config) (*Handler, error)

func (*Handler) Attach

func (h *Handler) Attach(r chi.Router)

type RerankRequest

type RerankRequest struct {
	Model string `json:"model"`

	Query     string   `json:"query"`
	Documents []string `json:"documents"`

	Limit *int `json:"limit,omitempty"`
}

type RerankResponse

type RerankResponse struct {
	Model string `json:"model"`

	Results []Result `json:"results"`
}

type Result

type Result struct {
	Index    int     `json:"index,omitempty"`
	Score    float64 `json:"score,omitempty"`
	Document `json:",inline"`
}

type Segment

type Segment struct {
	Text string `json:"text"`
}

type SegmentRequest

type SegmentRequest struct {
	Content string `json:"content"`

	SegmentLength  *int `json:"segment_length"`
	SegmentOverlap *int `json:"segment_overlap"`
}

type SummarizeRequest

type SummarizeRequest struct {
	Model string `json:"model"`

	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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