transformer

package
v0.0.10-beta1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CohereRerank added in v0.0.10

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

func NewCohereRerank added in v0.0.10

func NewCohereRerank() *CohereRerank

func (*CohereRerank) Rerank added in v0.0.10

func (c *CohereRerank) Rerank(ctx context.Context, query string, documents []document.Document) ([]document.Document, error)

func (*CohereRerank) WithAPIKey added in v0.0.10

func (c *CohereRerank) WithAPIKey(apiKey string) *CohereRerank

func (*CohereRerank) WithMaxChunksPerDoc added in v0.0.10

func (c *CohereRerank) WithMaxChunksPerDoc(maxChunksPerDoc int) *CohereRerank

func (*CohereRerank) WithModel added in v0.0.10

func (c *CohereRerank) WithModel(model CohereRerankModel) *CohereRerank

func (*CohereRerank) WithTopN added in v0.0.10

func (c *CohereRerank) WithTopN(topN int) *CohereRerank

type CohereRerankModel added in v0.0.10

type CohereRerankModel = model.RerankModel
const (
	CohereRerankScoreMetdataKey = "cohere-rerank-score"

	CohereRerankModelEnglishV20      CohereRerankModel = model.RerankModelEnglishV20
	CohereRerankModelMultilingualV20 CohereRerankModel = model.RerankModelMultilingualV20
)

type DallE

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

func NewDallE

func NewDallE() *DallE

func (*DallE) AsFile

func (d *DallE) AsFile(path string) *DallE

func (*DallE) AsImage

func (d *DallE) AsImage() *DallE

func (*DallE) AsURL

func (d *DallE) AsURL() *DallE

func (*DallE) Transform

func (d *DallE) Transform(ctx context.Context, input string) (any, error)

func (*DallE) WithClient

func (d *DallE) WithClient(client *openai.Client) *DallE

func (*DallE) WithImageSize

func (d *DallE) WithImageSize(imageSize DallEImageSize) *DallE

type DallEImageFormat

type DallEImageFormat string
const (
	DallEImageFormatURL   DallEImageFormat = "url"
	DallEImageFormatFile  DallEImageFormat = "file"
	DallEImageFormatImage DallEImageFormat = "image"
)

type DallEImageOutput

type DallEImageOutput any

type DallEImageSize

type DallEImageSize string
const (
	DallEImageSize256  DallEImageSize = openai.CreateImageSize256x256
	DallEImageSize512  DallEImageSize = openai.CreateImageSize512x512
	DallEImageSize1024 DallEImageSize = openai.CreateImageSize1024x1024
)

type VisualQuestionAnswering added in v0.0.9

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

func NewHFVisualQuestionAnswering added in v0.0.9

func NewHFVisualQuestionAnswering(mediaFile string) *VisualQuestionAnswering

func (*VisualQuestionAnswering) Transform added in v0.0.9

func (v *VisualQuestionAnswering) Transform(ctx context.Context, input string, all bool) (any, error)

func (*VisualQuestionAnswering) WithImage added in v0.0.9

func (v *VisualQuestionAnswering) WithImage(mediaFile string) *VisualQuestionAnswering

func (*VisualQuestionAnswering) WithModel added in v0.0.9

func (*VisualQuestionAnswering) WithToken added in v0.0.9

type VisualQuestionAnsweringRequest added in v0.0.9

type VisualQuestionAnsweringRequest struct {
	Inputs VisualQuestionAnsweringRequestInputs `json:"inputs"`
}

type VisualQuestionAnsweringRequestInputs added in v0.0.9

type VisualQuestionAnsweringRequestInputs struct {
	Image    string `json:"image"`
	Question string `json:"question"`
}

type VisualQuestionAnsweringResponse added in v0.0.9

type VisualQuestionAnsweringResponse struct {
	Score  float64 `json:"score"`
	Answer string  `json:"answer"`
}

Jump to

Keyboard shortcuts

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