MCPcopy Index your code
hub / github.com/InferCore/InferCore / HTTPJSONKB

Struct HTTPJSONKB

internal/retrieval/http_kb.go:22–26  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

20// Response body: {"chunks":[{"text":"...","source":"...","score":1.0}, ...]}
21// Alternative key "results" is also accepted with the same element shape.
22type 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".
29func NewHTTPJSONKB(kb config.KnowledgeBaseConfig) (*HTTPJSONKB, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected