mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-20 14:41:05 +08:00
Port agent PRs to GO - 5 (#16667)
### Summary Port https://github.com/infiniflow/ragflow/pull/15376 https://github.com/infiniflow/ragflow/pull/16401 https://github.com/infiniflow/ragflow/pull/15484 https://github.com/infiniflow/ragflow/pull/16685
This commit is contained in:
@@ -789,6 +789,10 @@ func (h *MemoryHandler) SearchMessage(c *gin.Context) {
|
||||
similarityThreshold, _ := strconv.ParseFloat(c.DefaultQuery("similarity_threshold", "0.2"), 64)
|
||||
keywordsSimilarityWeight, _ := strconv.ParseFloat(c.DefaultQuery("keywords_similarity_weight", "0.7"), 64)
|
||||
topN, _ := strconv.Atoi(c.DefaultQuery("top_n", "5"))
|
||||
if topN <= 0 || topN > 100 {
|
||||
common.ResponseWithCodeData(c, common.CodeArgumentError, nil, "top_n must be between 1 and 100")
|
||||
return
|
||||
}
|
||||
|
||||
agentID := c.DefaultQuery("agent_id", "")
|
||||
sessionID := c.DefaultQuery("session_id", "")
|
||||
@@ -856,6 +860,10 @@ func (h *MemoryHandler) GetMessages(c *gin.Context) {
|
||||
agentID := c.DefaultQuery("agent_id", "")
|
||||
sessionID := c.DefaultQuery("session_id", "")
|
||||
limit, _ := strconv.Atoi(c.DefaultQuery("limit", "10"))
|
||||
if limit <= 0 || limit > 100 {
|
||||
common.ResponseWithCodeData(c, common.CodeArgumentError, nil, "limit must be between 1 and 100")
|
||||
return
|
||||
}
|
||||
if len(memoryIDs) == 0 {
|
||||
common.ResponseWithCodeData(c, common.CodeArgumentError, nil, "memory_ids is required.")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user