feat(prompt): enhance context and intent classification in templates
- Updated context template to include runtime metadata such as current time and week, improving contextual awareness in user queries. - Enhanced rewrite template with critical instructions for intent classification, ensuring that rewritten questions preserve essential entities and keywords. - Refined intent classification logic to prioritize user intents more effectively, improving the accuracy of responses based on user queries. - Added examples to clarify expected input and output formats for intent classification, enhancing usability for developers.
This commit is contained in:
@@ -245,6 +245,14 @@ func (r *messageRepository) UpdateMessageImages(ctx context.Context, sessionID,
|
||||
Update("images", images).Error
|
||||
}
|
||||
|
||||
// UpdateMessageRenderedContent updates only the rendered_content column for a message.
|
||||
func (r *messageRepository) UpdateMessageRenderedContent(ctx context.Context, sessionID, messageID string, renderedContent string) error {
|
||||
return r.db.WithContext(ctx).
|
||||
Model(&types.Message{}).
|
||||
Where("id = ? AND session_id = ?", messageID, sessionID).
|
||||
Update("rendered_content", renderedContent).Error
|
||||
}
|
||||
|
||||
// DeleteMessagesBySessionID deletes all messages belonging to a session (soft delete)
|
||||
func (r *messageRepository) DeleteMessagesBySessionID(ctx context.Context, sessionID string) error {
|
||||
return r.db.WithContext(ctx).Where("session_id = ?", sessionID).Delete(&types.Message{}).Error
|
||||
|
||||
Reference in New Issue
Block a user