(ctx context.Context, from, to sdktranslator.Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool)
| 1930 | } |
| 1931 | |
| 1932 | func (h *Host) NormalizeResponseAfter(ctx context.Context, from, to sdktranslator.Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) []byte { |
| 1933 | current := bytes.Clone(body) |
| 1934 | for _, record := range h.activeRecords() { |
| 1935 | normalizer := record.plugin.Capabilities.ResponseAfterTranslator |
| 1936 | if h.isPluginFused(record.id) || normalizer == nil { |
| 1937 | continue |
| 1938 | } |
| 1939 | if normalized, ok := h.callResponseNormalizer(ctx, record, "ResponseAfterTranslator.NormalizeResponse", normalizer, from, to, model, originalRequestRawJSON, requestRawJSON, current, stream); ok { |
| 1940 | current = normalized |
| 1941 | } |
| 1942 | } |
| 1943 | return current |
| 1944 | } |
| 1945 | |
| 1946 | func (h *Host) callRequestNormalizer(ctx context.Context, record capabilityRecord, from, to sdktranslator.Format, model string, body []byte, stream bool) (out []byte, ok bool) { |
| 1947 | if h == nil || h.isPluginFused(record.id) || !h.recordCurrent(record) || record.plugin.Capabilities.RequestNormalizer == nil { |
nothing calls this directly
no test coverage detected