Documentation
¶
Index ¶
- func ExecuteToolCallRequest(tc util.ToolCall) tea.Cmd
- func ExportSessionToMarkdown(session Session, exportDir string) error
- func FinalizeResponse(response util.LocalStoreMessage, isToolCall bool) tea.Cmd
- func SendFinalProcessMessage(msg string) tea.Cmd
- func SendRefreshSessionsListMsg() tea.Cmd
- func SendResponseChunkProcessedMsg(msg string, previousMsgs []util.LocalStoreMessage, isComplete bool) tea.Cmd
- func SendSaveQuickChatMsg() tea.Cmd
- func SendUpdateCurrentSessionMsg(session Session) tea.Cmd
- type FinalProcessMessage
- type InferenceFinalized
- type LoadDataFromDB
- type MessageProcessor
- type Orchestrator
- func (m *Orchestrator) Cancel()
- func (m *Orchestrator) FinalizeResponseOnCancel() tea.Cmd
- func (m *Orchestrator) GetCompletion(ctx context.Context, resp chan util.ProcessApiCompletionResponse) tea.Cmd
- func (m Orchestrator) GetCurrentSessionId() int
- func (m Orchestrator) GetLatestBotMessage() (string, error)
- func (m Orchestrator) GetMessagesAsString() string
- func (m Orchestrator) Init() tea.Cmd
- func (m Orchestrator) IsIdle() bool
- func (m Orchestrator) IsProcessing() bool
- func (m *Orchestrator) ResumeCompletion(ctx context.Context, resp chan util.ProcessApiCompletionResponse) tea.Cmd
- func (m Orchestrator) Update(msg tea.Msg) (Orchestrator, tea.Cmd)
- type ProcessingResult
- type RefreshSessionsList
- type ResponseChunkProcessed
- type SaveQuickChat
- type Session
- type SessionService
- func (ss *SessionService) AddSessionTokensStats(id int, promptTokens, completionTokens int) error
- func (ss *SessionService) DeleteSession(id int) error
- func (ss *SessionService) GetAllSessions() ([]Session, error)
- func (ss *SessionService) GetMostRecessionSessionOrCreateOne() (Session, error)
- func (ss *SessionService) GetSession(id int) (Session, error)
- func (ss *SessionService) InsertNewSession(name string, messages []util.LocalStoreMessage, isTemporary bool) (Session, error)
- func (ss *SessionService) SaveQuickChat(id int) error
- func (ss *SessionService) SweepTemporarySessions() error
- func (ss *SessionService) UpdateSessionMessages(id int, messages []util.LocalStoreMessage) error
- func (ss *SessionService) UpdateSessionName(id int, name string) error
- type ToolCallComplete
- type ToolCallRequest
- type UpdateCurrentSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportSessionToMarkdown ¶ added in v0.8.1
func FinalizeResponse ¶ added in v0.8.0
func FinalizeResponse(response util.LocalStoreMessage, isToolCall bool) tea.Cmd
func SendFinalProcessMessage ¶
func SendSaveQuickChatMsg ¶
Types ¶
type FinalProcessMessage ¶
type FinalProcessMessage struct {
FinalMessage string
}
Final Message is the concatenated string from the chat gpt stream
type InferenceFinalized ¶ added in v0.8.0
type InferenceFinalized struct {
Response util.LocalStoreMessage
IsToolCall bool
}
type LoadDataFromDB ¶
type MessageProcessor ¶ added in v0.7.7
type MessageProcessor struct {
CurrentState util.ProcessingState
Settings util.Settings
CurrentResponseBuffer string
ResponseDataChunks []util.ProcessApiCompletionResponse
}
func NewMessageProcessor ¶ added in v0.7.7
func NewMessageProcessor( chunks []util.ProcessApiCompletionResponse, currentResponse string, processingState util.ProcessingState, settings util.Settings, ) MessageProcessor
func (MessageProcessor) Process ¶ added in v0.7.7
func (p MessageProcessor) Process( chunk util.ProcessApiCompletionResponse, ) (ProcessingResult, error)
type Orchestrator ¶
type Orchestrator struct {
InferenceClient util.LlmClient
Settings util.Settings
CurrentSessionID int
CurrentSessionName string
CurrentSessionIsTemporary bool
ArrayOfProcessResult []util.ProcessApiCompletionResponse
ArrayOfMessages []util.LocalStoreMessage
CurrentAnswer string
ResponseBuffer string
ResponseProcessingState util.ProcessingState
AllSessions []Session
ProcessingMode string
// contains filtered or unexported fields
}
func NewOrchestrator ¶
func NewOrchestrator(db *sql.DB, ctx context.Context) Orchestrator
func (*Orchestrator) Cancel ¶ added in v0.8.0
func (m *Orchestrator) Cancel()
func (*Orchestrator) FinalizeResponseOnCancel ¶ added in v0.8.0
func (m *Orchestrator) FinalizeResponseOnCancel() tea.Cmd
func (*Orchestrator) GetCompletion ¶
func (m *Orchestrator) GetCompletion( ctx context.Context, resp chan util.ProcessApiCompletionResponse, ) tea.Cmd
func (Orchestrator) GetCurrentSessionId ¶ added in v0.8.0
func (m Orchestrator) GetCurrentSessionId() int
func (Orchestrator) GetLatestBotMessage ¶
func (m Orchestrator) GetLatestBotMessage() (string, error)
func (Orchestrator) GetMessagesAsString ¶
func (m Orchestrator) GetMessagesAsString() string
func (Orchestrator) Init ¶
func (m Orchestrator) Init() tea.Cmd
func (Orchestrator) IsIdle ¶ added in v0.7.7
func (m Orchestrator) IsIdle() bool
func (Orchestrator) IsProcessing ¶ added in v0.7.7
func (m Orchestrator) IsProcessing() bool
func (*Orchestrator) ResumeCompletion ¶ added in v0.8.0
func (m *Orchestrator) ResumeCompletion( ctx context.Context, resp chan util.ProcessApiCompletionResponse, ) tea.Cmd
func (Orchestrator) Update ¶
func (m Orchestrator) Update(msg tea.Msg) (Orchestrator, tea.Cmd)
type ProcessingResult ¶ added in v0.7.7
type ProcessingResult struct {
IsSkipped bool
IsCancelled bool
HasError bool
PromptTokens int
CompletionTokens int
CurrentResponse string
CurrentResponseDataChunks []util.ProcessApiCompletionResponse
ToolCalls []util.ToolCall
JSONResponse util.LocalStoreMessage
State util.ProcessingState
}
type RefreshSessionsList ¶
type RefreshSessionsList struct{}
type ResponseChunkProcessed ¶
type ResponseChunkProcessed struct {
PreviousMsgArray []util.LocalStoreMessage
ChunkMessage string
IsComplete bool
}
type SaveQuickChat ¶
type SaveQuickChat struct{}
type SessionService ¶
func NewSessionService ¶
func NewSessionService(db *sql.DB) *SessionService
func (*SessionService) AddSessionTokensStats ¶ added in v0.8.1
func (ss *SessionService) AddSessionTokensStats(id int, promptTokens, completionTokens int) error
func (*SessionService) DeleteSession ¶
func (ss *SessionService) DeleteSession(id int) error
func (*SessionService) GetAllSessions ¶
func (ss *SessionService) GetAllSessions() ([]Session, error)
get me all the sessions
func (*SessionService) GetMostRecessionSessionOrCreateOne ¶
func (ss *SessionService) GetMostRecessionSessionOrCreateOne() (Session, error)
func (*SessionService) GetSession ¶
func (ss *SessionService) GetSession(id int) (Session, error)
func (*SessionService) InsertNewSession ¶
func (ss *SessionService) InsertNewSession( name string, messages []util.LocalStoreMessage, isTemporary bool, ) (Session, error)
func (*SessionService) SaveQuickChat ¶
func (ss *SessionService) SaveQuickChat(id int) error
func (*SessionService) SweepTemporarySessions ¶
func (ss *SessionService) SweepTemporarySessions() error
func (*SessionService) UpdateSessionMessages ¶
func (ss *SessionService) UpdateSessionMessages(id int, messages []util.LocalStoreMessage) error
func (*SessionService) UpdateSessionName ¶
func (ss *SessionService) UpdateSessionName(id int, name string) error
type ToolCallComplete ¶ added in v0.8.0
type ToolCallRequest ¶ added in v0.8.0
type UpdateCurrentSession ¶
type UpdateCurrentSession struct {
Session Session
}
Click to show internal directories.
Click to hide internal directories.