- Added a new endpoint to retrieve all assistant tags, improving data accessibility for clients. - Updated the assistant list handling to support filtering by built-in status and assistant ID, enhancing the filtering capabilities. - Introduced a method to load built-in assistants, streamlining the assistant initialization process. - Enhanced the Assistant struct with new fields for path, built-in status, and sorting, improving data organization. - Implemented validation and cloning methods for the Assistant struct, ensuring data integrity and ease of use. - Updated tests to cover new functionalities, including validation, cloning, and tag retrieval, ensuring robust functionality across the assistant management operations.
74 lines
2.1 KiB
Go
74 lines
2.1 KiB
Go
package store
|
|
|
|
// Redis represents a Redis-based conversation storage
|
|
type Redis struct{}
|
|
|
|
// NewRedis create a new redis store
|
|
func NewRedis() Store {
|
|
return &Redis{}
|
|
}
|
|
|
|
// GetChats retrieves a list of chats
|
|
func (r *Redis) GetChats(sid string, filter ChatFilter) (*ChatGroupResponse, error) {
|
|
return &ChatGroupResponse{}, nil
|
|
}
|
|
|
|
// GetChat retrieves a single chat's information
|
|
func (r *Redis) GetChat(sid string, cid string) (*ChatInfo, error) {
|
|
return &ChatInfo{}, nil
|
|
}
|
|
|
|
// GetHistory retrieves chat history
|
|
func (r *Redis) GetHistory(sid string, cid string) ([]map[string]interface{}, error) {
|
|
return []map[string]interface{}{}, nil
|
|
}
|
|
|
|
// SaveHistory saves chat history
|
|
func (r *Redis) SaveHistory(sid string, messages []map[string]interface{}, cid string, context map[string]interface{}) error {
|
|
return nil
|
|
}
|
|
|
|
// DeleteChat deletes a single chat
|
|
func (r *Redis) DeleteChat(sid string, cid string) error {
|
|
return nil
|
|
}
|
|
|
|
// DeleteAllChats deletes all chats
|
|
func (r *Redis) DeleteAllChats(sid string) error {
|
|
return nil
|
|
}
|
|
|
|
// UpdateChatTitle updates chat title
|
|
func (r *Redis) UpdateChatTitle(sid string, cid string, title string) error {
|
|
return nil
|
|
}
|
|
|
|
// SaveAssistant saves assistant information
|
|
func (r *Redis) SaveAssistant(assistant map[string]interface{}) (interface{}, error) {
|
|
return assistant["assistant_id"], nil
|
|
}
|
|
|
|
// DeleteAssistant deletes an assistant
|
|
func (r *Redis) DeleteAssistant(assistantID string) error {
|
|
return nil
|
|
}
|
|
|
|
// GetAssistants retrieves a list of assistants
|
|
func (r *Redis) GetAssistants(filter AssistantFilter) (*AssistantResponse, error) {
|
|
return &AssistantResponse{}, nil
|
|
}
|
|
|
|
// GetAssistant retrieves a single assistant by ID
|
|
func (r *Redis) GetAssistant(assistantID string) (map[string]interface{}, error) {
|
|
return map[string]interface{}{}, nil
|
|
}
|
|
|
|
// DeleteAssistants deletes assistants based on filter conditions (not implemented)
|
|
func (redis *Redis) DeleteAssistants(filter AssistantFilter) (int64, error) {
|
|
return 0, nil
|
|
}
|
|
|
|
// GetAssistantTags retrieves all unique tags from assistants
|
|
func (conv *Redis) GetAssistantTags() ([]string, error) {
|
|
return []string{}, nil
|
|
}
|