Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatClient ¶
type ChatClient struct { ID string MessageChan chan string DisconnectCh chan struct{} // contains filtered or unexported fields }
ChatClient represents a connected SSE client
func NewChatClient ¶
func NewChatClient(id string, router *events.EventRouter, options ...ChatClientOption) *ChatClient
NewChatClient creates a new SSE client
func (*ChatClient) EventToHTML ¶
func (c *ChatClient) EventToHTML(e chat.Event) (string, error)
EventToHTML converts a chat event to HTML
func (*ChatClient) GetConversation ¶
func (c *ChatClient) GetConversation() []*conversation.Message
GetConversation returns the current conversation
func (*ChatClient) SendUserMessage ¶
func (c *ChatClient) SendUserMessage(ctx context.Context, message string) error
SendUserMessage sends a user message to the conversation and starts a chat step
type ChatClientOption ¶
type ChatClientOption func(*ChatClient) error
func WithStep ¶
func WithStep(step chat.Step) ChatClientOption
Click to show internal directories.
Click to hide internal directories.