mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-25 09:53:29 +08:00
Refactor context command (#13952)
### What problem does this PR solve? Refactor context search command ### Type of change - [x] Refactoring Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -114,15 +114,15 @@ func (c *RAGFlowClient) ContextSearch(cmd *Command) (ResponseIf, error) {
|
||||
}
|
||||
}
|
||||
|
||||
threshold := 0.0
|
||||
if cmd.Params["threshold"] != nil {
|
||||
threshold, ok = cmd.Params["threshold"].(float64)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("fail to convert 'threshold' to float64")
|
||||
}
|
||||
}
|
||||
//threshold := 0.0
|
||||
//if cmd.Params["threshold"] != nil {
|
||||
// threshold, ok = cmd.Params["threshold"].(float64)
|
||||
// if !ok {
|
||||
// return nil, fmt.Errorf("fail to convert 'threshold' to float64")
|
||||
// }
|
||||
//}
|
||||
|
||||
fmt.Printf("search query: %s, path: %s, threshold: %f, number: %d\n", query, path, threshold, number)
|
||||
fmt.Printf("search query: %s, path: %s, number: %d\n", query, path, number)
|
||||
|
||||
// Convert to response
|
||||
var response ContextSearchResponse
|
||||
|
||||
Reference in New Issue
Block a user