MCPcopy Create free account
hub / github.com/InferCore/InferCore / deriveDegradeState

Function deriveDegradeState

internal/server/server.go:738–750  ·  view source on GitHub ↗
(output map[string]any)

Source from the content-addressed store, hash-verified

736}
737
738func deriveDegradeState(output map[string]any) types.DegradeState {
739 if output == nil {
740 return types.DegradeState{Triggered: false}
741 }
742 streamDegraded, _ := output["stream_degraded"].(bool)
743 if streamDegraded {
744 return types.DegradeState{
745 Triggered: true,
746 Reason: "stream request degraded to non-stream mode",
747 }
748 }
749 return types.DegradeState{Triggered: false}
750}
751
752func (s *Server) withRequestLoggingAndMetrics(next http.Handler) http.Handler {
753 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 1

writeAIResponseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected