openai

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Choice

type Choice struct {
	FinishReason string      `json:"finish_reason"`
	Message      RespMessage `json:"message"`
}

type ImagePayload

type ImagePayload struct {
	URL string `json:"url"`
}

type Message

type Message struct {
	Role    string           `json:"role"`
	Content []MessageContent `json:"content"`
}

type MessageContent

type MessageContent struct {
	Type     string       `json:"type"`
	Text     string       `json:"text,omitempty"`
	ImageURL ImagePayload `json:"image_url,omitempty"`
}

type OpenAIOCR

type OpenAIOCR struct {
	openai.OpenAIConfig `mapstructure:",squash"`
	Prompt              string
	MaxTokens           *int
	Concurrency         int
}

func (*OpenAIOCR) Load

func (o *OpenAIOCR) Load(ctx context.Context, reader io.Reader) ([]vs.Document, error)

type Payload

type Payload struct {
	Model     string    `json:"model"`
	Messages  []Message `json:"messages"`
	MaxTokens int       `json:"max_tokens"`
}

type RespMessage

type RespMessage struct {
	Content string `json:"content"`
}

type Response

type Response struct {
	Choices []Choice `json:"choices"`
}

Jump to

Keyboard shortcuts

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