MCPcopy Create free account
hub / github.com/coder/coder / isStreaming

Function isStreaming

aibridge/internal/integrationtest/mockupstream.go:201–206  ·  view source on GitHub ↗
(body []byte, urlPath string)

Source from the content-addressed store, hash-verified

199}
200
201func isStreaming(body []byte, urlPath string) bool {
202 // The Anthropic SDK's Bedrock middleware extracts "stream"
203 // from the JSON body and encodes them in the URL path instead.
204 // See: https://github.com/anthropics/anthropic-sdk-go/blob/4d669338f2041f3c60640b6dd317c4895dc71cd4/bedrock/bedrock.go#L247-L248
205 return gjson.GetBytes(body, "stream").Bool() || strings.HasSuffix(urlPath, "invoke-with-response-stream")
206}
207
208func (ms *mockUpstream) writeSSE(w http.ResponseWriter, data []byte) {
209 ms.t.Helper()

Callers 1

handleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected