server

package
v0.4.12-gateway.dev4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerURL, Port, APIBase string
}

type Server

type Server struct {
	*datastore.Datastore
}

func NewServer

func NewServer(d *datastore.Datastore) *Server

func (*Server) CreateDS

func (s *Server) CreateDS(c *gin.Context)

CreateDS creates a new dataset. @Summary Create a new dataset @Description Create a new dataset @Tags datasets @Accept json @Produce json @Param dataset body types.Dataset true "Dataset object" @Router /datasets/create [post] @Success 200 {object} types.Dataset

func (*Server) DeleteDS

func (s *Server) DeleteDS(c *gin.Context)

DeleteDS deletes a dataset by ID. @Summary Delete a dataset @Description Delete a dataset by ID @Tags datasets @Produce json @Param id path string true "Dataset ID" @Router /datasets/{id} [delete] @Success 200 {object} gin.H

func (*Server) GetDS

func (s *Server) GetDS(c *gin.Context)

GetDS gets a dataset by ID. @Summary Get a dataset @Description Get a dataset by ID @Tags datasets @Produce json @Param id path string true "Dataset ID" @Router /datasets/{id} [get] @Success 200 {object} types.Dataset

func (*Server) IngestIntoDS

func (s *Server) IngestIntoDS(c *gin.Context)

IngestIntoDS ingests content into a dataset by ID. @Summary Ingest content into a dataset @Description Ingest content into a dataset by ID @Tags datasets @Accept json @Produce json @Param id path string true "Dataset ID" @Router /datasets/{id}/ingest [post] @Success 200 {object} types.IngestResponse

func (*Server) ListDS

func (s *Server) ListDS(c *gin.Context)

ListDS lists all datasets. @Summary List all datasets @Description List all datasets @Tags datasets @Produce json @Router /datasets [get] @Success 200 {object} []types.Dataset

func (*Server) RemoveDocFromDS

func (s *Server) RemoveDocFromDS(c *gin.Context)

RemoveDocFromDS removes a document from a dataset by ID. If the owning file context is now empty, the FileIndex is removed. @Summary Remove a document from a dataset @Description Remove a document from a dataset by ID @Tags datasets @Accept json @Produce json @Param id path string true "Dataset ID" @Param doc_id path string true "Document ID" @Router /datasets/{id}/documents/{doc_id} [delete] @Success 200 {object} gin.H

func (*Server) RemoveFileFromDS

func (s *Server) RemoveFileFromDS(c *gin.Context)

RemoveFileFromDS removes a file from a dataset by ID. @Summary Remove a file from a dataset @Description Remove a file from a dataset by ID @Tags datasets @Accept json @Produce json @Param id path string true "Dataset ID" @Param file_id path string true "File ID" @Router /datasets/{id}/files/{file_id} [delete] @Success 200 {object} gin.H

func (*Server) RetrieveFromDS

func (s *Server) RetrieveFromDS(c *gin.Context)

RetrieveFromDS retrieves content from a dataset by ID. @Summary Retrieve content from a dataset @Description Retrieve content from a dataset by ID @Tags datasets @Accept json @Produce json @Param id path string true "Dataset ID" @Router /datasets/{id}/retrieve [post] @Success 200 {object} []vectorstore.Document

func (*Server) Start

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

Start starts the server with the given configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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