commands

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const MaxImageSizeBytes int64 = 100 * 1024 * 1024

MaxImageSizeBytes is the maximum allowed size for image files (100MB)

Variables

This section is empty.

Functions

func ExtractFileInclusions added in v0.1.46

func ExtractFileInclusions(prompt string) []string

ExtractFileInclusions extracts file inclusions from a prompt for testing purposes.

func NewRootCmd

func NewRootCmd(cli *command.DockerCli) *cobra.Command

func ProcessFileInclusions added in v0.1.46

func ProcessFileInclusions(prompt string) (string, error)

Types

type BenchmarkResult added in v1.0.3

type BenchmarkResult struct {
	Concurrency int
	MeanRPS     float64
	TotalTokens int
	TPS         float64
	TotalTime   time.Duration
	Requests    int
	TokenCounts []int
}

type ChatResponse added in v1.0.3

type ChatResponse struct {
	Choices []struct {
		FinishReason string `json:"finish_reason"`
		Message      struct {
			Content string `json:"content"`
		} `json:"message"`
	} `json:"choices"`
	Usage struct {
		PromptTokens     int `json:"prompt_tokens"`
		CompletionTokens int `json:"completion_tokens"`
		TotalTokens      int `json:"total_tokens"`
	} `json:"usage"`
}

type CommandMetadata

type CommandMetadata struct {
	Parameters []ParameterMetadata `json:"parameters"`
}

type ParameterMetadata

type ParameterMetadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
	Type        string `json:"type"`
	Default     string `json:"default,omitempty"`
}

type ProviderMetadata

type ProviderMetadata struct {
	Description string          `json:"description"`
	Up          CommandMetadata `json:"up"`
	Down        CommandMetadata `json:"down"`
}

type StreamingMarkdownBuffer

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

StreamingMarkdownBuffer handles partial content and renders complete markdown blocks

func NewStreamingMarkdownBuffer

func NewStreamingMarkdownBuffer() *StreamingMarkdownBuffer

NewStreamingMarkdownBuffer creates a new streaming markdown buffer

func (*StreamingMarkdownBuffer) AddContent

func (smb *StreamingMarkdownBuffer) AddContent(content string, shouldUseMarkdown bool) (string, error)

AddContent adds new content to the buffer and returns any content that should be displayed

func (*StreamingMarkdownBuffer) Flush

func (smb *StreamingMarkdownBuffer) Flush(shouldUseMarkdown bool) (string, error)

Flush renders and returns any remaining content in the buffer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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