Documentation ¶
Index ¶
- type BorderColors
- type MessagePosition
- type Model
- func (m Model) Conversation() conversation.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 StepMetadata
- 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 conversation.Manager) Model
func (Model) Conversation ¶
func (m Model) Conversation() conversation.Conversation
func (*Model) SelectedIdx ¶
func (*Model) SetSelectedIdx ¶
func (Model) ViewAndSelectedPosition ¶
func (m Model) ViewAndSelectedPosition() (string, MessagePosition)
type StepMetadata ¶
type StepMetadata struct { StepID uuid.UUID `json:"step_id"` Type string `json:"type"` InputType string `json:"input_type"` OutputType string `json:"output_type"` Metadata map[string]interface{} `json:"meta"` }
StepMetadata represents metadata about the step that issues the streaming messages. There is not a real definition of what a streaming message right now, this will need to be cleaned up as the agent framework is built out. NOTE(manuel, 2024-01-17) This is a copy of the StepMetadata in geppetto, and we might want to extract this out into a separate steps package.
func (*StepMetadata) ToMap ¶
func (sm *StepMetadata) ToMap() map[string]interface{}
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 string 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 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 conversation.NodeID `json:"id" yaml:"id"` ParentID conversation.NodeID `json:"parent_id" yaml:"parent_id"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` Step *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.