models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2026 Teradata

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package models provides a model selection dialog for Loom. Model selection in Loom is handled via the server's looms.yaml configuration.

Index

Constants

View Source
const ModelSelectorID = "models"

ModelSelectorID is the dialog ID.

View Source
const ModelsDialogID = ModelSelectorID

ModelsDialogID is an alias for ModelSelectorID.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyInput

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

APIKeyInput is a stub API key input component.

func NewAPIKeyInput

func NewAPIKeyInput() *APIKeyInput

NewAPIKeyInput creates a new API key input.

func (*APIKeyInput) Blur

func (a *APIKeyInput) Blur() tea.Cmd

Blur blurs the component.

func (*APIKeyInput) Cursor

func (a *APIKeyInput) Cursor() *tea.Cursor

Cursor returns the cursor position.

func (*APIKeyInput) Focus

func (a *APIKeyInput) Focus() tea.Cmd

Focus focuses the component.

func (*APIKeyInput) GetSize

func (a *APIKeyInput) GetSize() (int, int)

GetSize returns the component size.

func (*APIKeyInput) Init

func (a *APIKeyInput) Init() tea.Cmd

Init initializes the component.

func (*APIKeyInput) IsFocused

func (a *APIKeyInput) IsFocused() bool

IsFocused returns whether the component is focused.

func (*APIKeyInput) SetSize

func (a *APIKeyInput) SetSize(width, height int) tea.Cmd

SetSize sets the component width.

func (*APIKeyInput) SetWidth

func (a *APIKeyInput) SetWidth(width int)

SetWidth sets the component width.

func (*APIKeyInput) Update

func (a *APIKeyInput) Update(msg tea.Msg) (util.Model, tea.Cmd)

Update handles messages.

func (*APIKeyInput) Value

func (a *APIKeyInput) Value() string

Value returns the current input value.

func (*APIKeyInput) View

func (a *APIKeyInput) View() string

View renders the component.

type APIKeyInputState

type APIKeyInputState int

APIKeyInputState represents API key input state.

const (
	APIKeyInputStateEmpty APIKeyInputState = iota
	APIKeyInputStateVerifying
	APIKeyInputStateVerified
	APIKeyInputStateInvalid
	APIKeyInputStateError
)

type APIKeyStateChangeMsg

type APIKeyStateChangeMsg struct {
	State APIKeyInputState
}

APIKeyStateChangeMsg is sent when API key state changes.

type Model

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

Model is the model selector dialog.

func New

func New() *Model

New creates a new model selector.

func NewModelDialogCmp

func NewModelDialogCmp() *Model

NewModelDialogCmp creates a new model dialog component.

func (*Model) ID

func (m *Model) ID() dialogs.DialogID

ID returns the dialog ID.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the model.

func (*Model) Position

func (m *Model) Position() (int, int)

Position returns the dialog position.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the dialog size.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (util.Model, tea.Cmd)

Update handles messages.

func (*Model) View

func (m *Model) View() string

View renders the model.

type ModelChangedMsg

type ModelChangedMsg struct {
	Model config.Model
}

ModelChangedMsg is sent when the model is changed.

type ModelListComponent

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

ModelListComponent is a stub list component for model selection.

func NewModelListComponent

func NewModelListComponent(keyMap list.KeyMap, placeholder string, showProvider bool) *ModelListComponent

NewModelListComponent creates a new model list component.

func (*ModelListComponent) Blur

func (m *ModelListComponent) Blur() tea.Cmd

Blur blurs the component.

func (*ModelListComponent) Focus

func (m *ModelListComponent) Focus() tea.Cmd

Focus focuses the component.

func (*ModelListComponent) GetSize

func (m *ModelListComponent) GetSize() (int, int)

GetSize returns the component size.

func (*ModelListComponent) Init

func (m *ModelListComponent) Init() tea.Cmd

Init initializes the component.

func (*ModelListComponent) IsFocused

func (m *ModelListComponent) IsFocused() bool

IsFocused returns whether the component is focused.

func (*ModelListComponent) SelectedModel

func (m *ModelListComponent) SelectedModel() *ModelOption

SelectedModel returns the currently selected model.

func (*ModelListComponent) SetSize

func (m *ModelListComponent) SetSize(width, height int) tea.Cmd

SetSize sets the component size.

func (*ModelListComponent) Update

func (m *ModelListComponent) Update(msg tea.Msg) (util.Model, tea.Cmd)

Update handles messages.

func (*ModelListComponent) View

func (m *ModelListComponent) View() string

View renders the component.

type ModelOption

type ModelOption struct {
	Name        string
	Provider    string
	Description string
}

ModelOption represents a model selection option.

type ModelSelectedMsg

type ModelSelectedMsg struct {
	Model     config.Model
	ModelType config.SelectedModelType
}

ModelSelectedMsg is sent when a model is selected.

Jump to

Keyboard shortcuts

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