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

Method NormalizeResponseBefore

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

Source from the content-addressed store, hash-verified

1903}
1904
1905func (h *Host) NormalizeResponseBefore(ctx context.Context, from, to sdktranslator.Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) []byte {
1906 current := bytes.Clone(body)
1907 for _, record := range h.activeRecords() {
1908 normalizer := record.plugin.Capabilities.ResponseBeforeTranslator
1909 if h.isPluginFused(record.id) || normalizer == nil {
1910 continue
1911 }
1912 if normalized, ok := h.callResponseNormalizer(ctx, record, "ResponseBeforeTranslator.NormalizeResponse", normalizer, from, to, model, originalRequestRawJSON, requestRawJSON, current, stream); ok {
1913 current = normalized
1914 }
1915 }
1916 return current
1917}
1918
1919func (h *Host) TranslateResponse(ctx context.Context, from, to sdktranslator.Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) ([]byte, bool) {
1920 for _, record := range h.activeRecords() {

Callers

nothing calls this directly

Calls 4

activeRecordsMethod · 0.95
isPluginFusedMethod · 0.95
CloneMethod · 0.45

Tested by

no test coverage detected