- Introduced new endpoints for retrieving chat details and mentions, enhancing the API's functionality. - Implemented handleChatDetail method to fetch details of a specific chat by ID, including error handling for missing parameters. - Added handleMentions method to retrieve mentions based on keywords, improving user interaction with chat content. - Updated existing GetChats method to support keyword filtering, allowing for more refined chat list retrieval. - Enhanced the DSL structure to include new methods for managing mentions and chat details, improving overall code organization and maintainability.
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package conversation
|
|
|
|
// Mongo conversation
|
|
type Mongo struct{}
|
|
|
|
// NewMongo create a new conversation
|
|
func NewMongo() *Mongo {
|
|
return &Mongo{}
|
|
}
|
|
|
|
// UpdateChatTitle update the chat title
|
|
func (conv *Mongo) UpdateChatTitle(sid string, cid string, title string) error {
|
|
return nil
|
|
}
|
|
|
|
// GetChats get the chat list
|
|
func (conv *Mongo) GetChats(sid string, keywords ...string) ([]map[string]interface{}, error) {
|
|
return []map[string]interface{}{}, nil
|
|
}
|
|
|
|
// GetHistory get the history
|
|
func (conv *Mongo) GetHistory(sid string, cid string) ([]map[string]interface{}, error) {
|
|
return []map[string]interface{}{}, nil
|
|
}
|
|
|
|
// SaveHistory save the history
|
|
func (conv *Mongo) SaveHistory(sid string, messages []map[string]interface{}, cid string) error {
|
|
return nil
|
|
}
|
|
|
|
// GetRequest get the request
|
|
func (conv *Mongo) GetRequest(sid string, rid string) ([]map[string]interface{}, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
// SaveRequest save the request
|
|
func (conv *Mongo) SaveRequest(sid string, rid string, cid string, messages []map[string]interface{}) error {
|
|
return nil
|
|
}
|
|
|
|
// GetChat get the chat info and its history
|
|
func (conv *Mongo) GetChat(sid string, cid string) (*ChatInfo, error) {
|
|
return nil, nil
|
|
}
|