commands

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 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 BoolPtrValue added in v1.0.4

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

BoolPtrValue implements pflag.Value interface for *bool pointers This allows flags to have a nil default value to detect if explicitly set

func NewBoolPtrValue added in v1.0.4

func NewBoolPtrValue(p **bool) *BoolPtrValue

NewBoolPtrValue creates a new BoolPtrValue for the given pointer

func (*BoolPtrValue) IsBoolFlag added in v1.0.4

func (v *BoolPtrValue) IsBoolFlag() bool

func (*BoolPtrValue) Set added in v1.0.4

func (v *BoolPtrValue) Set(s string) error

func (*BoolPtrValue) String added in v1.0.4

func (v *BoolPtrValue) String() string

func (*BoolPtrValue) Type added in v1.0.4

func (v *BoolPtrValue) Type() string

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 ConfigureFlags added in v1.0.4

type ConfigureFlags struct {
	// Backend mode (completion, embedding, reranking)
	Mode string
	// ContextSize is the context size in tokens
	ContextSize *int32
	// Speculative decoding flags
	DraftModel        string
	NumTokens         int
	MinAcceptanceRate float64
	// vLLM-specific flags
	HFOverrides          string
	GPUMemoryUtilization *float64
	// Think parameter for reasoning models
	Think *bool
}

ConfigureFlags holds all the flags for configuring a model backend

func (*ConfigureFlags) BuildConfigureRequest added in v1.0.4

func (f *ConfigureFlags) BuildConfigureRequest(model string) (scheduling.ConfigureRequest, error)

BuildConfigureRequest builds a scheduling.ConfigureRequest from the flags. The model parameter is the model name to configure.

func (*ConfigureFlags) RegisterFlags added in v1.0.4

func (f *ConfigureFlags) RegisterFlags(cmd *cobra.Command)

RegisterFlags registers all configuration flags on the given cobra command.

type Float64PtrValue added in v1.0.4

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

Float64PtrValue implements pflag.Value interface for *float64 pointers This allows flags to have a nil default value instead of 0.0

func NewFloat64PtrValue added in v1.0.4

func NewFloat64PtrValue(p **float64) *Float64PtrValue

NewFloat64PtrValue creates a new Float64PtrValue for the given pointer

func (*Float64PtrValue) Set added in v1.0.4

func (v *Float64PtrValue) Set(s string) error

func (*Float64PtrValue) String added in v1.0.4

func (v *Float64PtrValue) String() string

func (*Float64PtrValue) Type added in v1.0.4

func (v *Float64PtrValue) Type() string

type Int32PtrValue added in v1.0.4

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

Int32PtrValue implements pflag.Value interface for *int32 pointers This allows flags to have a nil default value instead of 0

func NewInt32PtrValue added in v1.0.4

func NewInt32PtrValue(p **int32) *Int32PtrValue

NewInt32PtrValue creates a new Int32PtrValue for the given pointer

func (*Int32PtrValue) Set added in v1.0.4

func (v *Int32PtrValue) Set(s string) error

func (*Int32PtrValue) String added in v1.0.4

func (v *Int32PtrValue) String() string

func (*Int32PtrValue) Type added in v1.0.4

func (v *Int32PtrValue) Type() string

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