Documentation ¶
Index ¶
- Constants
- type CohereRerank
- func (c *CohereRerank) Rerank(ctx context.Context, query string, documents []document.Document) ([]document.Document, error)
- func (c *CohereRerank) WithAPIKey(apiKey string) *CohereRerank
- func (c *CohereRerank) WithMaxChunksPerDoc(maxChunksPerDoc int) *CohereRerank
- func (c *CohereRerank) WithModel(model CohereRerankModel) *CohereRerank
- func (c *CohereRerank) WithTopN(topN int) *CohereRerank
- type CohereRerankModel
- type DallE
- func (d *DallE) Transform(ctx context.Context, input string) (any, error)
- func (d *DallE) TransformAsFile(ctx context.Context, input string, file *os.File) (string, error)
- func (d *DallE) TransformAsURL(ctx context.Context, input string) (string, error)
- func (d *DallE) TransformToImage(ctx context.Context, input string) (image.Image, error)
- func (d *DallE) WithClient(client *openai.Client) *DallE
- func (d *DallE) WithImageFormat(imageFormat DallEImageFormat) *DallE
- func (d *DallE) WithImageQuality(imageQuality DallEImageQuality) *DallE
- func (d *DallE) WithImageSize(imageSize DallEImageSize) *DallE
- func (d *DallE) WithImageStyle(imageStyle DallEImageStyle) *DallE
- func (d *DallE) WithModel(model DallEModel) *DallE
- type DallEImageFormat
- type DallEImageOutput
- type DallEImageQuality
- type DallEImageSize
- type DallEImageStyle
- type DallEModel
- type HFTextToImage
- type HFTextToImageRequest
- type HFTextToImageResponse
- type VisualQuestionAnswering
- func (v *VisualQuestionAnswering) Transform(ctx context.Context, input string, all bool) (any, error)
- func (v *VisualQuestionAnswering) WithImage(mediaFile string) *VisualQuestionAnswering
- func (v *VisualQuestionAnswering) WithModel(model string) *VisualQuestionAnswering
- func (v *VisualQuestionAnswering) WithToken(token string) *VisualQuestionAnswering
- type VisualQuestionAnsweringRequest
- type VisualQuestionAnsweringRequestInputs
- type VisualQuestionAnsweringResponse
- type VoyageRerank
Constants ¶
View Source
const (
VoyageRerankScoreMetdataKey = "voyage-rerank-score"
)
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) 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 (*DallE) TransformAsFile ¶ added in v0.2.0
func (*DallE) TransformAsURL ¶ added in v0.2.0
func (*DallE) TransformToImage ¶ added in v0.2.0
func (*DallE) WithClient ¶
func (*DallE) WithImageFormat ¶ added in v0.2.0
func (d *DallE) WithImageFormat(imageFormat DallEImageFormat) *DallE
func (*DallE) WithImageQuality ¶ added in v0.2.0
func (d *DallE) WithImageQuality(imageQuality DallEImageQuality) *DallE
func (*DallE) WithImageSize ¶
func (d *DallE) WithImageSize(imageSize DallEImageSize) *DallE
func (*DallE) WithImageStyle ¶ added in v0.2.0
func (d *DallE) WithImageStyle(imageStyle DallEImageStyle) *DallE
func (*DallE) WithModel ¶ added in v0.2.0
func (d *DallE) WithModel(model DallEModel) *DallE
type DallEImageFormat ¶
type DallEImageFormat string
const ( DallEImageFormatURL DallEImageFormat = "url" DallEImageFormatFile DallEImageFormat = "file" DallEImageFormatImage DallEImageFormat = "image" )
type DallEImageOutput ¶
type DallEImageOutput any
type DallEImageQuality ¶ added in v0.2.0
type DallEImageQuality string
const ( DallEImageQualityHD DallEImageQuality = openai.CreateImageQualityHD DallEImageQualityStandard DallEImageQuality = openai.CreateImageQualityStandard )
type DallEImageSize ¶
type DallEImageSize string
const ( DallEImageSize256x256 DallEImageSize = openai.CreateImageSize256x256 DallEImageSize512x512 DallEImageSize = openai.CreateImageSize512x512 DallEImageSize1024x1024 DallEImageSize = openai.CreateImageSize1024x1024 DallEImageSize1792x104 DallEImageSize = openai.CreateImageSize1792x1024 DallEImageSize1024x1792 DallEImageSize = openai.CreateImageSize1024x1792 )
type DallEImageStyle ¶ added in v0.2.0
type DallEImageStyle string
const ( DallEImageStyleVivid DallEImageStyle = openai.CreateImageStyleVivid DallEImageStyleNatural DallEImageStyle = openai.CreateImageStyleNatural )
type DallEModel ¶ added in v0.2.0
type DallEModel string
const ( DallEModel2 DallEModel = openai.CreateImageModelDallE2 DallEModel3 DallEModel = openai.CreateImageModelDallE3 )
type HFTextToImage ¶ added in v0.1.0
type HFTextToImage struct {
// contains filtered or unexported fields
}
func NewHFTextToImage ¶ added in v0.1.0
func NewHFTextToImage() *HFTextToImage
func (*HFTextToImage) WithModel ¶ added in v0.1.0
func (h *HFTextToImage) WithModel(model string) *HFTextToImage
func (*HFTextToImage) WithPersistImage ¶ added in v0.1.0
func (h *HFTextToImage) WithPersistImage(mediaFile string) *HFTextToImage
func (*HFTextToImage) WithToken ¶ added in v0.1.0
func (h *HFTextToImage) WithToken(token string) *HFTextToImage
type HFTextToImageRequest ¶ added in v0.1.0
type HFTextToImageRequest struct {
Input string `json:"inputs"`
}
type HFTextToImageResponse ¶ added in v0.1.0
type HFTextToImageResponse struct {
Output []byte
}
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) WithImage ¶ added in v0.0.9
func (v *VisualQuestionAnswering) WithImage(mediaFile string) *VisualQuestionAnswering
func (*VisualQuestionAnswering) WithModel ¶ added in v0.0.9
func (v *VisualQuestionAnswering) WithModel(model string) *VisualQuestionAnswering
func (*VisualQuestionAnswering) WithToken ¶ added in v0.0.9
func (v *VisualQuestionAnswering) WithToken(token string) *VisualQuestionAnswering
type VisualQuestionAnsweringRequest ¶ added in v0.0.9
type VisualQuestionAnsweringRequest struct {
Inputs VisualQuestionAnsweringRequestInputs `json:"inputs"`
}
type VisualQuestionAnsweringRequestInputs ¶ added in v0.0.9
type VisualQuestionAnsweringResponse ¶ added in v0.0.9
type VoyageRerank ¶ added in v0.1.2
type VoyageRerank struct {
// contains filtered or unexported fields
}
func NewVoyageRerank ¶ added in v0.1.2
func NewVoyageRerank() *VoyageRerank
func (*VoyageRerank) WithModel ¶ added in v0.1.2
func (v *VoyageRerank) WithModel(model string) *VoyageRerank
Click to show internal directories.
Click to hide internal directories.