fun

package
v0.0.0-...-83357a8 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

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

type PMessage

type PMessage struct {
	Role    string           `json:"role"`
	Content []map[string]any `json:"content"`
}

type Payload

type Payload struct {
	Model            string     `json:"model"`
	Messages         []PMessage `json:"messages"`
	Temperature      int        `json:"temperature"`
	MaxTokens        int        `json:"max_tokens"`
	TopP             int        `json:"top_p"`
	FrequencyPenalty int        `json:"frequency_penalty"`
	PresencePenalty  int        `json:"presence_penalty"`
}

type Response

type Response struct {
	ID        string `json:"id"`
	Type      string `json:"object"`
	Timestamp int    `json:"created"`
	Model     string `json:"model"`
	Choices   []struct {
		Index        int     `json:"index"`
		Message      Message `json:"message"`
		FinishReason string  `json:"finish_reason"`
	} `json:"choices"`
	Usage struct {
		PromptTokens     int `json:"prompt_tokens"`
		CompletionTokens int `json:"completion_tokens"`
		TotalTokens      int `json:"total_tokens"`
	} `json:"usage"`
	Fingerprint string `json:"system_fingerprint"`
}

Jump to

Keyboard shortcuts

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