Documentation
¶
Index ¶
- func ChatCompletionsStream(actionSub chan ChatAction, profile config.Profile, messages []ChatMessage) tea.Cmd
- func NewAzureChatClient(config config.AzureConfig) (*azopenai.Client, error)
- func NewOpenAIChatClient(config config.OpenAIConfig) (*azopenai.Client, error)
- func SendMessage(actionSub chan ChatAction, newMessage string) tea.Cmd
- func WaitForChatAction(actionSub chan ChatAction) tea.Cmd
- type ActionStatus
- type ChatAction
- type ChatMessage
- type ChatModel
- func (m ChatModel) Divider(topMargin bool, bottomMargin bool) string
- func (m ChatModel) Help() string
- func (m ChatModel) Init() tea.Cmd
- func (m ChatModel) MainViewContent() string
- func (m ChatModel) Message(message ChatMessage) string
- func (m ChatModel) MessagesHistory() string
- func (m ChatModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m ChatModel) View() string
- type HelpKeyMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChatCompletionsStream ¶
func ChatCompletionsStream(actionSub chan ChatAction, profile config.Profile, messages []ChatMessage) tea.Cmd
func NewAzureChatClient ¶
func NewAzureChatClient(config config.AzureConfig) (*azopenai.Client, error)
func NewOpenAIChatClient ¶
func NewOpenAIChatClient(config config.OpenAIConfig) (*azopenai.Client, error)
func SendMessage ¶
func SendMessage(actionSub chan ChatAction, newMessage string) tea.Cmd
func WaitForChatAction ¶
func WaitForChatAction(actionSub chan ChatAction) tea.Cmd
Types ¶
type ActionStatus ¶
type ActionStatus = string
const ( SentMessage ActionStatus = "sendMessage" StreamStarted ActionStatus = "streamStarted" Streaming ActionStatus = "streaming" StreamFinished ActionStatus = "streamFinished" Error ActionStatus = "error" )
type ChatAction ¶
type ChatAction struct {
// contains filtered or unexported fields
}
type ChatMessage ¶
type ChatMessage struct { Role essentials.ChatRole CreatedAt time.Time Message string }
type ChatModel ¶
type ChatModel struct { Profile config.Profile MainView viewport.Model InputTextarea textarea.Model HelpView help.Model MarkdownRender glamour.TermRenderer Messages []ChatMessage ActionSub chan ChatAction Streaming bool StreamingMessage string StreamingStartedAt time.Time }
func (ChatModel) MainViewContent ¶
func (ChatModel) Message ¶
func (m ChatModel) Message(message ChatMessage) string
func (ChatModel) MessagesHistory ¶
Click to show internal directories.
Click to hide internal directories.