Function
kbName
(req types.AIRequest, cfg *config.Config)
Source from the content-addressed store, hash-verified
| 509 | } |
| 510 | |
| 511 | func kbName(req types.AIRequest, cfg *config.Config) string { |
| 512 | if req.Context != nil { |
| 513 | if v, ok := req.Context["knowledge_base"].(string); ok && strings.TrimSpace(v) != "" { |
| 514 | return strings.TrimSpace(v) |
| 515 | } |
| 516 | } |
| 517 | if cfg != nil && len(cfg.KnowledgeBases) > 0 { |
| 518 | return cfg.KnowledgeBases[0].Name |
| 519 | } |
| 520 | return "" |
| 521 | } |
| 522 | |
| 523 | type aiSuccessParams struct { |
| 524 | traceID string |
Tested by
no test coverage detected