(r *http.Request)
| 141 | } |
| 142 | |
| 143 | func extractContextForTest(r *http.Request) (uuid.UUID, []uuid.UUID, bool) { |
| 144 | var chatContext agentchat.Context |
| 145 | var ok bool |
| 146 | agentchat.Middleware(http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) { |
| 147 | chatContext, ok = agentchat.FromContext(r.Context()) |
| 148 | })).ServeHTTP(httptest.NewRecorder(), r) |
| 149 | if !ok { |
| 150 | return uuid.Nil, nil, false |
| 151 | } |
| 152 | return chatContext.ID, chatContext.AncestorIDs, true |
| 153 | } |
| 154 | |
| 155 | // mustMarshalJSON marshals v to a JSON string, failing the test on error. |
| 156 | func mustMarshalJSON(t *testing.T, v any) string { |
no test coverage detected