Documentation
¶
Overview ¶
Base API definition
Embeddings definition ¶
Extractor definition ¶
Labels definition ¶
Segmentation definition ¶
Similarity definition ¶
Summary definition ¶
Textractor definition ¶
Transcription definition ¶
Translation definition ¶
Workflow definition
Index ¶
- type API
- type Answer
- type Document
- type EmbeddingsAPI
- func (embeddings *EmbeddingsAPI) Add(documents interface{})
- func (embeddings *EmbeddingsAPI) BatchSearch(queries []string, limit int, weights float64, index string) [][]SearchResult
- func (embeddings *EmbeddingsAPI) BatchSimilarity(queries []string, texts []string) [][]IndexResult
- func (embeddings *EmbeddingsAPI) BatchTransform(texts []string) [][]float64
- func (embeddings *EmbeddingsAPI) Count() int
- func (embeddings *EmbeddingsAPI) Delete(ids []string) []string
- func (embeddings *EmbeddingsAPI) Explain(query string, texts []string) []ExplainResult
- func (embeddings *EmbeddingsAPI) Index()
- func (embeddings *EmbeddingsAPI) Reindex(config interface{}, function string)
- func (embeddings *EmbeddingsAPI) Search(query string, limit int, weights float64, index string) []SearchResult
- func (embeddings *EmbeddingsAPI) Similarity(query string, texts []string) []IndexResult
- func (embeddings *EmbeddingsAPI) Transform(text string) []float64
- func (embeddings *EmbeddingsAPI) Upsert()
- type ExplainResult
- type ExtractorAPI
- type IndexResult
- type LabelsAPI
- type Question
- type SearchResult
- type SegmentationAPI
- type SimilarityAPI
- type SummaryAPI
- type TextractorAPI
- type Tokens
- type TranscriptionAPI
- type TranslationAPI
- type WorkflowAPI
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
}
Base API definition
type EmbeddingsAPI ¶
type EmbeddingsAPI struct {
// contains filtered or unexported fields
}
Embeddings definition
func (*EmbeddingsAPI) Add ¶
func (embeddings *EmbeddingsAPI) Add(documents interface{})
Adds a batch of documents for indexing.
func (*EmbeddingsAPI) BatchSearch ¶
func (embeddings *EmbeddingsAPI) BatchSearch(queries []string, limit int, weights float64, index string) [][]SearchResult
Finds documents in the embeddings model most similar to the input queries.
func (*EmbeddingsAPI) BatchSimilarity ¶
func (embeddings *EmbeddingsAPI) BatchSimilarity(queries []string, texts []string) [][]IndexResult
Computes the similarity between list of queries and list of text.
func (*EmbeddingsAPI) BatchTransform ¶
func (embeddings *EmbeddingsAPI) BatchTransform(texts []string) [][]float64
Transforms list of text into embeddings array.
func (*EmbeddingsAPI) Count ¶
func (embeddings *EmbeddingsAPI) Count() int
Total number of elements in this embeddings index.
func (*EmbeddingsAPI) Delete ¶
func (embeddings *EmbeddingsAPI) Delete(ids []string) []string
Deletes from an embeddings index. Returns list of ids deleted.
func (*EmbeddingsAPI) Explain ¶
func (embeddings *EmbeddingsAPI) Explain(query string, texts []string) []ExplainResult
func (*EmbeddingsAPI) Index ¶
func (embeddings *EmbeddingsAPI) Index()
Builds an embeddings index for previously batched documents.
func (*EmbeddingsAPI) Reindex ¶
func (embeddings *EmbeddingsAPI) Reindex(config interface{}, function string)
Reindex with new configuration
func (*EmbeddingsAPI) Search ¶
func (embeddings *EmbeddingsAPI) Search(query string, limit int, weights float64, index string) []SearchResult
Finds documents in the embeddings model most similar to the input query.
func (*EmbeddingsAPI) Similarity ¶
func (embeddings *EmbeddingsAPI) Similarity(query string, texts []string) []IndexResult
Computes the similarity between query and list of text.
func (*EmbeddingsAPI) Transform ¶
func (embeddings *EmbeddingsAPI) Transform(text string) []float64
Transforms text into an embeddings array.
func (*EmbeddingsAPI) Upsert ¶
func (embeddings *EmbeddingsAPI) Upsert()
Runs an embeddings upsert operation for previously batched documents.
type ExplainResult ¶
type ExtractorAPI ¶
type ExtractorAPI struct {
// contains filtered or unexported fields
}
Extractor definition
type IndexResult ¶
Index result
type LabelsAPI ¶
type LabelsAPI struct {
// contains filtered or unexported fields
}
Labels definition
func (*LabelsAPI) BatchLabel ¶
func (label *LabelsAPI) BatchLabel(texts []string, labels []string) []IndexResult
Applies a zero shot classifier to list of text using a list of labels.
type Question ¶
type Question struct { Name string `json:"name"` Query string `json:"query"` Question string `json:"question"` Snippet bool `json:"snippet"` }
Question parameters
type SearchResult ¶
type SearchResult struct { Id string `json:"id"` Text string `json:"text"` Score float64 `json:"score"` }
Search result
type SegmentationAPI ¶
type SegmentationAPI struct {
// contains filtered or unexported fields
}
Segmentation definition
func Segmentation ¶
func Segmentation(params ...string) SegmentationAPI
Creates a Segmentation instance.
func (*SegmentationAPI) BatchSegment ¶
func (segmentation *SegmentationAPI) BatchSegment(texts []string) []interface{}
Segments text into semantic units.
func (*SegmentationAPI) Segment ¶
func (segmentation *SegmentationAPI) Segment(text string) interface{}
Segments text into semantic units.
type SimilarityAPI ¶
type SimilarityAPI struct {
// contains filtered or unexported fields
}
Similarity definition
func (*SimilarityAPI) BatchSimilarity ¶
func (similarity *SimilarityAPI) BatchSimilarity(queries []string, texts []string) [][]IndexResult
Computes the similarity between list of queries and list of text.
func (*SimilarityAPI) Similarity ¶
func (similarity *SimilarityAPI) Similarity(query string, texts []string) []IndexResult
Computes the similarity between query and list of text.
type SummaryAPI ¶
type SummaryAPI struct {
// contains filtered or unexported fields
}
Summary definition
func (*SummaryAPI) BatchSummary ¶
func (summary *SummaryAPI) BatchSummary(texts []string, minlength int, maxlength int) []string
Runs a summarization model against a block of text.
type TextractorAPI ¶
type TextractorAPI struct {
// contains filtered or unexported fields
}
Textractor definition
func (*TextractorAPI) BatchTextract ¶
func (textractor *TextractorAPI) BatchTextract(files []string) []interface{}
Extracts text from a file at path.
func (*TextractorAPI) Textract ¶
func (textractor *TextractorAPI) Textract(file string) interface{}
Extracts text from a file at path.
type Tokens ¶
func (*Tokens) UnmarshalJSON ¶
type TranscriptionAPI ¶
type TranscriptionAPI struct {
// contains filtered or unexported fields
}
Transcription definition
func Transcription ¶
func Transcription(params ...string) TranscriptionAPI
Creates a Transcription instance.
func (*TranscriptionAPI) BatchTranscribe ¶
func (transcription *TranscriptionAPI) BatchTranscribe(files []string) []string
Transcribes audio files to text.
func (*TranscriptionAPI) Transcribe ¶
func (transcription *TranscriptionAPI) Transcribe(file string) string
Transcribes audio files to text.
type TranslationAPI ¶
type TranslationAPI struct {
// contains filtered or unexported fields
}
Translation definition
func Translation ¶
func Translation(params ...string) TranslationAPI
Creates a Translation instance.
func (*TranslationAPI) BatchTranslate ¶
func (translation *TranslationAPI) BatchTranslate(texts []string, target string, source string) []string
Translates text from source language into target language.
type WorkflowAPI ¶
type WorkflowAPI struct {
// contains filtered or unexported fields
}
Workflow definition
func (*WorkflowAPI) Workflow ¶
func (workflow *WorkflowAPI) Workflow(name string, elements []string) []interface{}
Segments text into semantic units.