MCPcopy
hub / github.com/mudler/LocalAI / correlationIDFromContext

Function correlationIDFromContext

core/http/middleware/usage.go:268–275  ·  view source on GitHub ↗
(c echo.Context)

Source from the content-addressed store, hash-verified

266}
267
268func correlationIDFromContext(c echo.Context) string {
269 if v, ok := c.Get(ContextKeyCorrelationID).(string); ok {
270 return v
271 }
272 // X-Correlation-ID header is set by trace.go middleware; read it as a
273 // fallback if the echo-context binding hasn't been populated yet.
274 return c.Response().Header().Get("X-Correlation-ID")
275}
276
277// lastSSEData returns the payload of the last "data: " line whose content is not "[DONE]".
278func lastSSEData(b []byte) ([]byte, bool) {

Callers 1

UsageMiddlewareFunction · 0.85

Calls 2

HeaderMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected