Documentation
¶
Index ¶
- type API
- func (a *API) DeleteDocument(url, context string) error
- func (a *API) GetContexts() ([]string, error)
- func (a *API) GetDocument(url string, context string) (*storage.Document, error)
- func (a *API) ListDocuments(context string, limit int) ([]*storage.Document, error)
- func (a *API) Llm() *llm.Embeddings
- func (a *API) Search(query string, numResults int, context string) ([]SearchResult, error)
- func (a *API) UpsertDirect(doc *storage.Document) error
- func (a *API) UpsertDocument(...) error
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API provides methods to interact with the document storage.
func NewAPI ¶
func NewAPI(storage *storage.Storage, llm *llm.Embeddings) *API
NewAPI creates a new API instance.
func (*API) DeleteDocument ¶
DeleteDocument deletes a document by URL.
func (*API) GetContexts ¶ added in v1.0.18
GetContexts retrieves a list of unique contexts.
func (*API) GetDocument ¶
GetDocument retrieves a document by URL.
func (*API) ListDocuments ¶
ListDocuments lists all documents, optionally filtered by context.
func (*API) Search ¶
Search finds the most similar documents to a query, up to numResults, optionally filtered by context.
func (*API) UpsertDirect ¶
UpsertDirect upserts a document directly.
type SearchResult ¶
Click to show internal directories.
Click to hide internal directories.