playground

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 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"`
	Tokens  int    `json:"tokens"`
}

type Playground

type Playground struct {
	// contains filtered or unexported fields
}

func NewPlayground

func NewPlayground() *Playground

func (*Playground) AddMessage

func (p *Playground) AddMessage(sessionID, role, content string, tokens int)

func (*Playground) CreateSession

func (p *Playground) CreateSession(id, model string) *PlaygroundSession

func (*Playground) EstimateCost

func (p *Playground) EstimateCost(sessionID string) float64

func (*Playground) GetSession

func (p *Playground) GetSession(id string) *PlaygroundSession

func (*Playground) ListSessions

func (p *Playground) ListSessions() []*PlaygroundSession

type PlaygroundEngine

type PlaygroundEngine struct {
	// contains filtered or unexported fields
}

func NewPlaygroundEngine

func NewPlaygroundEngine() *PlaygroundEngine

func (*PlaygroundEngine) AddMessage

func (e *PlaygroundEngine) AddMessage(sessionID, role, content string) *Message

func (*PlaygroundEngine) CompareModels

func (e *PlaygroundEngine) CompareModels(sessionID string, models []string) map[string]float64

func (*PlaygroundEngine) CreateSession

func (e *PlaygroundEngine) CreateSession(model string) *Session

func (*PlaygroundEngine) EstimateCost

func (e *PlaygroundEngine) EstimateCost(sessionID string, inputCost, outputCost float64) float64

func (*PlaygroundEngine) ExportSession

func (e *PlaygroundEngine) ExportSession(sessionID string) string

func (*PlaygroundEngine) GetSession

func (e *PlaygroundEngine) GetSession(sessionID string) *Session

func (*PlaygroundEngine) ListSessions

func (e *PlaygroundEngine) ListSessions() []*Session

type PlaygroundMessage

type PlaygroundMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
	Tokens  int    `json:"tokens"`
}

type PlaygroundSession

type PlaygroundSession struct {
	ID           string              `json:"id"`
	Model        string              `json:"model"`
	Temperature  float64             `json:"temperature"`
	MaxTokens    int                 `json:"max_tokens"`
	History      []PlaygroundMessage `json:"history"`
	CostEstimate float64             `json:"cost_estimate"`
	Source       string              `json:"source"`
}

type Session

type Session struct {
	ID          string    `json:"id"`
	Model       string    `json:"model"`
	Temperature float64   `json:"temperature"`
	MaxTokens   int       `json:"max_tokens"`
	History     []Message `json:"history"`
	Source      string    `json:"source"`
}

Jump to

Keyboard shortcuts

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