Documentation
¶
Index ¶
- type BorderColors
- type MessagePosition
- type Model
- func (m Model) Conversation() conversation2.Conversation
- func (m Model) Init() tea.Cmd
- func (m *Model) SelectedIdx() int
- func (m *Model) SetActive(active bool)
- func (m *Model) SetSelectedIdx(idx int)
- func (m *Model) SetWidth(width int)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- func (m Model) ViewAndSelectedPosition() (string, MessagePosition)
- type StreamCompletionError
- type StreamCompletionMsg
- type StreamDoneMsg
- type StreamMetadata
- type StreamStartMsg
- type StreamStatusMsg
- type Style
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BorderColors ¶
type MessagePosition ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModel ¶
func NewModel(manager conversation2.Manager) Model
func (Model) Conversation ¶
func (m Model) Conversation() conversation2.Conversation
func (*Model) SelectedIdx ¶
func (*Model) SetSelectedIdx ¶
func (Model) ViewAndSelectedPosition ¶
func (m Model) ViewAndSelectedPosition() (string, MessagePosition)
type StreamCompletionError ¶
type StreamCompletionError struct { StreamMetadata Err error }
StreamCompletionError is sent by the backend when an error occurs during the streaming operation.
The UI uses this message to display an error state or message to the user.
type StreamCompletionMsg ¶
type StreamCompletionMsg struct { StreamMetadata // Delta is the delta that was added to the message Delta string // Completion is the full completion text Completion string }
StreamCompletionMsg is sent by the backend when new data, such as a message completion, is available.
The UI uses this message to update the text content of the respective message in the conversation. The conversation manager updates the message content and the last update timestamp.
type StreamDoneMsg ¶
type StreamDoneMsg struct { StreamMetadata // Completion is the full completion text Completion string }
StreamDoneMsg is sent by the backend to signal the successful completion of the streaming operation.
The UI uses this message to finalize the content of the message in the conversation. The conversation manager updates the message content and the last update timestamp to reflect the final text.
type StreamMetadata ¶
type StreamMetadata struct { ID conversation2.NodeID `json:"id" yaml:"id"` ParentID conversation2.NodeID `json:"parent_id" yaml:"parent_id"` EventMetadata *chat.EventMetadata `json:"metadata" yaml:"metadata"` StepMetadata *steps.StepMetadata `json:"step_metadata,omitempty"` }
type StreamStartMsg ¶
type StreamStartMsg struct {
StreamMetadata
}
StreamStartMsg is sent by the backend when a streaming operation begins. The UI uses this message to append a new message to the conversation, indicating that the assistant has started processing. The conversation manager is responsible for adding this message to the conversation tree.
type StreamStatusMsg ¶
type StreamStatusMsg struct { StreamMetadata Text string }
StreamStatusMsg is sent by the backend to provide status updates during a streaming operation. It includes the current text of the stream along with the stream metadata.
The UI typically does not need to update the conversation view in response to this message, but it could be used to show a loading indicator or similar temporary status.