Classify returns pipeline kind from ref or request type.
(requestType, ref string)
| 24 | |
| 25 | // Classify returns pipeline kind from ref or request type. |
| 26 | func Classify(requestType, ref string) Kind { |
| 27 | rt := strings.ToLower(strings.TrimSpace(requestType)) |
| 28 | switch rt { |
| 29 | case types.RequestTypeRAG: |
| 30 | return KindRAG |
| 31 | case types.RequestTypeAgent: |
| 32 | return KindAgent |
| 33 | default: |
| 34 | r := strings.ToLower(strings.TrimSpace(ref)) |
| 35 | if strings.Contains(r, "rag/") { |
| 36 | return KindRAG |
| 37 | } |
| 38 | if strings.Contains(r, "agent/") { |
| 39 | return KindAgent |
| 40 | } |
| 41 | return KindInference |
| 42 | } |
| 43 | } |