(ctx context.Context, from, to sdktranslator.Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool)
| 1903 | } |
| 1904 | |
| 1905 | func (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 | |
| 1919 | func (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() { |
nothing calls this directly
no test coverage detected