Download internal/httpapi/openai/shared/trace.go from a3216/ds2api: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/internal/httpapi/openai/shared/trace.go
- Command line
-
hf download hf://spaces/a3216/ds2api@ce5a019598af8a3a8fa70d3880098df3e850ecd7/internal/httpapi/openai/shared/trace.go
-
curl -L -o trace.go https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/internal/httpapi/openai/shared/trace.go
400 Bytes
| package shared | |
| import ( | |
| "net/http" | |
| "strings" | |
| "github.com/go-chi/chi/v5/middleware" | |
| ) | |
| func RequestTraceID(r *http.Request) string { | |
| if r == nil { | |
| return "" | |
| } | |
| if q := strings.TrimSpace(r.URL.Query().Get("__trace_id")); q != "" { | |
| return q | |
| } | |
| if h := strings.TrimSpace(r.Header.Get("X-Ds2-Test-Trace")); h != "" { | |
| return h | |
| } | |
| return strings.TrimSpace(middleware.GetReqID(r.Context())) | |
| } | |