mockbot

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotV2

type BotV2 struct {
	// contains filtered or unexported fields
}

BotV2 implements a mock chat bot with conversation management

func NewBotV2

func NewBotV2(eventBus *sse.EventBus) *BotV2

NewBotV2 creates a new mock bot instance with conversation management

func (*BotV2) GetConversation

func (b *BotV2) GetConversation(clientID string) (conversation.Conversation, bool)

GetConversation returns the conversation for a client

func (*BotV2) HandleMessage

func (b *BotV2) HandleMessage(client *sse.Client, req ChatRequest)

HandleMessage processes a chat message and streams the response

func (*BotV2) LoadConversation

func (b *BotV2) LoadConversation(clientID string, filename string) error

LoadConversation loads a conversation from a file for a client

func (*BotV2) SaveConversation

func (b *BotV2) SaveConversation(clientID string, filename string) error

SaveConversation saves the conversation for a client to a file

type ChatMessage

type ChatMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

ChatMessage represents a message in the chat

type ChatRequest

type ChatRequest struct {
	Messages []ChatMessage `json:"messages"`
}

ChatRequest represents an incoming chat request

type MockBot

type MockBot struct {
	// contains filtered or unexported fields
}

MockBot implements a simple mock chat bot that reverses messages

func NewMockBot

func NewMockBot(eventBus *sse.EventBus) *MockBot

NewMockBot creates a new mock bot instance

func (*MockBot) HandleMessage

func (b *MockBot) HandleMessage(client *sse.Client, req ChatRequest)

HandleMessage processes a chat message and streams the response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL