tui: Error handling tweak
Moved errors to bottom of screen, fix infinite loop by typing errors properly
This commit is contained in:
@@ -25,11 +25,13 @@ type (
|
||||
}
|
||||
// sent when a conversation's messages are laoded
|
||||
msgConversationMessagesLoaded struct {
|
||||
messages []api.Message
|
||||
messages []api.Message
|
||||
rootMessages []api.Message
|
||||
}
|
||||
// a special case of common.MsgError that stops the response waiting animation
|
||||
msgChatResponseError error
|
||||
msgChatResponseError struct {
|
||||
Err error
|
||||
}
|
||||
// sent on each chunk received from LLM
|
||||
msgChatResponseChunk api.Chunk
|
||||
// sent on each completed reply
|
||||
@@ -72,9 +74,9 @@ const (
|
||||
|
||||
type Model struct {
|
||||
// App state
|
||||
App *model.AppModel
|
||||
App *model.AppModel
|
||||
Height int
|
||||
Width int
|
||||
Width int
|
||||
|
||||
// Chat view state
|
||||
state state // current overall status of the view
|
||||
@@ -108,8 +110,8 @@ func Chat(app *model.AppModel) *Model {
|
||||
m := Model{
|
||||
App: app,
|
||||
|
||||
state: idle,
|
||||
persistence: true,
|
||||
state: idle,
|
||||
persistence: true,
|
||||
|
||||
stopSignal: make(chan struct{}),
|
||||
replyChan: make(chan api.Message),
|
||||
|
||||
Reference in New Issue
Block a user