ai

package
v0.29.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 0 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"`
	Index        int           `json:"index"`
	Message      OutputMessage `json:"message"`
	// The Unix timestamp (in seconds) of when the chat completion was created.
	Created int `json:"created"`
}

type Content

type Content struct {
	Type        string `json:"type"`
	Text        string `json:"text,omitempty"`
	ImageURL    string `json:"image-url,omitempty"`
	ImageBase64 string `json:"image-base64,omitempty"`
}

type InputData

type InputData struct {
	Model    string         `json:"model"`
	Messages []InputMessage `json:"messages"`
}

type InputMessage

type InputMessage struct {
	Contents []Content `json:"content"`
	Role     string    `json:"role"`
	Name     string    `json:"name,omitempty"`
}

type Metadata

type Metadata struct {
	Usage Usage `json:"usage"`
}

type OutputData

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

type OutputMessage

type OutputMessage struct {
	Content string `json:"content"`
	Role    string `json:"role"`
}

type Parameter

type Parameter struct {
	MaxTokens   *int     `json:"max-tokens,omitempty"`
	Seed        *int     `json:"seed,omitempty"`
	N           *int     `json:"n,omitempty"`
	Temperature *float32 `json:"temperature,omitempty"`
	TopP        *float32 `json:"top-p,omitempty"`
	Stream      bool     `json:"stream,omitempty"`
}

type TextChatInput

type TextChatInput struct {
	Data      InputData `json:"data"`
	Parameter Parameter `json:"parameter,omitempty"`
}

type TextChatOutput

type TextChatOutput struct {
	Data     OutputData `json:"data"`
	Metadata Metadata   `json:"metadata"`
}

type Usage

type Usage struct {
	CompletionTokens int `json:"completion-tokens"`
	PromptTokens     int `json:"prompt-tokens"`
	TotalTokens      int `json:"total-tokens"`
}

Directories

Path Synopsis
anthropic
v0
archetypeai
v0
cohere
v0
fireworksai
v0
groq
v0
huggingface
v0
instill
v0
mistralai
v0
ollama
v0
openai
v0
v1
stabilityai
v0
universalai
v0

Jump to

Keyboard shortcuts

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