MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / NormalizeRequest

Method NormalizeRequest

internal/pluginhost/adapters.go:1880–1891  ·  view source on GitHub ↗
(ctx context.Context, from, to sdktranslator.Format, model string, body []byte, stream bool)

Source from the content-addressed store, hash-verified

1878}
1879
1880func (h *Host) NormalizeRequest(ctx context.Context, from, to sdktranslator.Format, model string, body []byte, stream bool) []byte {
1881 current := bytes.Clone(body)
1882 for _, record := range h.activeRecords() {
1883 if h.isPluginFused(record.id) || record.plugin.Capabilities.RequestNormalizer == nil {
1884 continue
1885 }
1886 if normalized, ok := h.callRequestNormalizer(ctx, record, from, to, model, current, stream); ok {
1887 current = normalized
1888 }
1889 }
1890 return current
1891}
1892
1893func (h *Host) TranslateRequest(ctx context.Context, from, to sdktranslator.Format, model string, body []byte, stream bool) ([]byte, bool) {
1894 for _, record := range h.activeRecords() {

Callers

nothing calls this directly

Calls 4

activeRecordsMethod · 0.95
isPluginFusedMethod · 0.95
callRequestNormalizerMethod · 0.95
CloneMethod · 0.45

Tested by

no test coverage detected