@@ -182,6 +182,93 @@ jobs:
182182 echo "⚠️ Response may not contain expected fields, but request succeeded"
183183 fi
184184
185+ - name : Test Response API - Create Response
186+ run : |
187+ echo "Testing Response API: POST /v1/responses..."
188+
189+ response=$(curl -s -X POST http://localhost:8801/v1/responses \
190+ -H "Content-Type: application/json" \
191+ -d '{
192+ "model": "qwen3",
193+ "input": "What is 2 + 2?",
194+ "store": true
195+ }')
196+
197+ echo "Response: $response"
198+
199+ # Extract response ID for subsequent tests
200+ response_id=$(echo "$response" | jq -r '.id // empty')
201+ if [ -n "$response_id" ] && [[ "$response_id" == resp_* ]]; then
202+ echo "✅ Response API create test passed (id=$response_id)"
203+ echo "RESPONSE_ID=$response_id" >> $GITHUB_ENV
204+ else
205+ echo "❌ Response API create test failed - invalid or missing response ID"
206+ exit 1
207+ fi
208+
209+ - name : Test Response API - Get Response
210+ run : |
211+ echo "Testing Response API: GET /v1/responses/$RESPONSE_ID..."
212+
213+ response=$(curl -s -X GET "http://localhost:8801/v1/responses/$RESPONSE_ID" \
214+ -H "Content-Type: application/json")
215+
216+ echo "Response: $response"
217+
218+ # Verify response ID matches
219+ got_id=$(echo "$response" | jq -r '.id // empty')
220+ if [ "$got_id" = "$RESPONSE_ID" ]; then
221+ echo "✅ Response API get test passed"
222+ else
223+ echo "❌ Response API get test failed - ID mismatch (expected=$RESPONSE_ID, got=$got_id)"
224+ exit 1
225+ fi
226+
227+ - name : Test Response API - Get Input Items
228+ run : |
229+ echo "Testing Response API: GET /v1/responses/$RESPONSE_ID/input_items..."
230+
231+ response=$(curl -s -X GET "http://localhost:8801/v1/responses/$RESPONSE_ID/input_items" \
232+ -H "Content-Type: application/json")
233+
234+ echo "Response: $response"
235+
236+ # Verify it's a list
237+ object_type=$(echo "$response" | jq -r '.object // empty')
238+ if [ "$object_type" = "list" ]; then
239+ echo "✅ Response API input_items test passed"
240+ else
241+ echo "❌ Response API input_items test failed - expected object=list, got=$object_type"
242+ exit 1
243+ fi
244+
245+ - name : Test Response API - Delete Response
246+ run : |
247+ echo "Testing Response API: DELETE /v1/responses/$RESPONSE_ID..."
248+
249+ response=$(curl -s -X DELETE "http://localhost:8801/v1/responses/$RESPONSE_ID" \
250+ -H "Content-Type: application/json")
251+
252+ echo "Response: $response"
253+
254+ # Verify deletion
255+ deleted=$(echo "$response" | jq -r '.deleted // empty')
256+ if [ "$deleted" = "true" ]; then
257+ echo "✅ Response API delete test passed"
258+ else
259+ echo "❌ Response API delete test failed - expected deleted=true"
260+ exit 1
261+ fi
262+
263+ # Verify 404 on subsequent get
264+ get_response=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:8801/v1/responses/$RESPONSE_ID")
265+ if [ "$get_response" = "404" ]; then
266+ echo "✅ Response API delete verification passed (404 on get)"
267+ else
268+ echo "❌ Response API delete verification failed - expected 404, got $get_response"
269+ exit 1
270+ fi
271+
185272 - name : Show service logs on failure
186273 if : failure()
187274 run : |
0 commit comments