HTTPJSONKB calls a remote retrieval service over HTTP POST with a small JSON contract. Request body: {"query":" ","top_k":N} Response body: {"chunks":[{"text":"...","source":"...","score":1.0}, ...]} Alternative key "results" is also accepted with the same element shape.
| 20 | // Response body: {"chunks":[{"text":"...","source":"...","score":1.0}, ...]} |
| 21 | // Alternative key "results" is also accepted with the same element shape. |
| 22 | type HTTPJSONKB struct { |
| 23 | name string |
| 24 | cfg config.KnowledgeBaseConfig |
| 25 | client *http.Client |
| 26 | } |
| 27 | |
| 28 | // NewHTTPJSONKB builds an adapter for knowledge_bases type "http". |
| 29 | func NewHTTPJSONKB(kb config.KnowledgeBaseConfig) (*HTTPJSONKB, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected