(req types.AIRequest)
| 495 | } |
| 496 | |
| 497 | func ragQuery(req types.AIRequest) string { |
| 498 | if req.Context != nil { |
| 499 | if q, ok := req.Context["query"].(string); ok && strings.TrimSpace(q) != "" { |
| 500 | return strings.TrimSpace(q) |
| 501 | } |
| 502 | } |
| 503 | if req.Input != nil { |
| 504 | if t, ok := req.Input["text"].(string); ok { |
| 505 | return strings.TrimSpace(t) |
| 506 | } |
| 507 | } |
| 508 | return "" |
| 509 | } |
| 510 | |
| 511 | func kbName(req types.AIRequest, cfg *config.Config) string { |
| 512 | if req.Context != nil { |