- Implement silent flag in chat and history storage - Add filter options to retrieve chats and messages with silent mode - Update store interfaces to support silent message filtering - Enhance GetChats, GetHistory, and related methods to handle silent messages - Add comprehensive test cases for silent mode functionality
84 lines
2.5 KiB
Go
84 lines
2.5 KiB
Go
package store
|
|
|
|
// Mongo represents a MongoDB-based conversation storage
|
|
type Mongo struct{}
|
|
|
|
// NewMongo create a new mongo store
|
|
func NewMongo() Store {
|
|
return &Mongo{}
|
|
}
|
|
|
|
// GetChats retrieves a list of chats
|
|
func (m *Mongo) GetChats(sid string, filter ChatFilter) (*ChatGroupResponse, error) {
|
|
return &ChatGroupResponse{}, nil
|
|
}
|
|
|
|
// GetChat retrieves a single chat's information
|
|
func (m *Mongo) GetChat(sid string, cid string) (*ChatInfo, error) {
|
|
return &ChatInfo{}, nil
|
|
}
|
|
|
|
// GetChatWithFilter retrieves a single chat's information with filter options
|
|
func (m *Mongo) GetChatWithFilter(sid string, cid string, filter ChatFilter) (*ChatInfo, error) {
|
|
return &ChatInfo{}, nil
|
|
}
|
|
|
|
// GetHistory retrieves chat history
|
|
func (m *Mongo) GetHistory(sid string, cid string) ([]map[string]interface{}, error) {
|
|
return []map[string]interface{}{}, nil
|
|
}
|
|
|
|
// GetHistoryWithFilter retrieves chat history with filter options
|
|
func (m *Mongo) GetHistoryWithFilter(sid string, cid string, filter ChatFilter) ([]map[string]interface{}, error) {
|
|
return []map[string]interface{}{}, nil
|
|
}
|
|
|
|
// SaveHistory saves chat history
|
|
func (m *Mongo) SaveHistory(sid string, messages []map[string]interface{}, cid string, context map[string]interface{}) error {
|
|
return nil
|
|
}
|
|
|
|
// DeleteChat deletes a single chat
|
|
func (m *Mongo) DeleteChat(sid string, cid string) error {
|
|
return nil
|
|
}
|
|
|
|
// DeleteAllChats deletes all chats
|
|
func (m *Mongo) DeleteAllChats(sid string) error {
|
|
return nil
|
|
}
|
|
|
|
// UpdateChatTitle updates chat title
|
|
func (m *Mongo) UpdateChatTitle(sid string, cid string, title string) error {
|
|
return nil
|
|
}
|
|
|
|
// SaveAssistant saves assistant information
|
|
func (m *Mongo) SaveAssistant(assistant map[string]interface{}) (interface{}, error) {
|
|
return assistant["assistant_id"], nil
|
|
}
|
|
|
|
// DeleteAssistant deletes an assistant
|
|
func (m *Mongo) DeleteAssistant(assistantID string) error {
|
|
return nil
|
|
}
|
|
|
|
// GetAssistants retrieves a list of assistants
|
|
func (m *Mongo) GetAssistants(filter AssistantFilter) (*AssistantResponse, error) {
|
|
return &AssistantResponse{}, nil
|
|
}
|
|
|
|
// GetAssistant retrieves a single assistant by ID
|
|
func (m *Mongo) GetAssistant(assistantID string) (map[string]interface{}, error) {
|
|
return map[string]interface{}{}, nil
|
|
}
|
|
|
|
// DeleteAssistants deletes assistants based on filter conditions (not implemented)
|
|
func (mongo *Mongo) DeleteAssistants(filter AssistantFilter) (int64, error) {
|
|
return 0, nil
|
|
}
|
|
|
|
// GetAssistantTags retrieves all unique tags from assistants
|
|
func (conv *Mongo) GetAssistantTags() ([]string, error) {
|
|
return []string{}, nil
|
|
}
|