schema

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedding

type Embedding struct {
	Embedding []float64 `json:"embedding"`
	Index     int       `json:"index"`
}

An embedding object

func (Embedding) CosineDistance

func (e Embedding) CosineDistance(other Embedding) float64

type Embeddings

type Embeddings struct {
	Id    string      `json:"id"`
	Data  []Embedding `json:"data"`
	Model string      `json:"model"`
	Usage struct {
		PromptTokerns int `json:"prompt_tokens"`
		TotalTokens   int `json:"total_tokens"`
	} `json:"usage"`
}

An set of created embeddings

type Message

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

A chat completion message

type MessageChoice

type MessageChoice struct {
	Message      `json:"message"`
	Index        int    `json:"index"`
	FinishReason string `json:"finish_reason"`
}

One choice of chat completion messages

type Model

type Model struct {
	Id      string `json:"id"`
	Created int64  `json:"created,omitempty"`
	Owner   string `json:"owned_by,omitempty"`
}

A model object

Jump to

Keyboard shortcuts

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