Skip to content

Commit b49a46d

Browse files
ci: add Response API tests to Docker Compose CI
- Enable Response API in config/config.yaml - Add Response API test steps to integration-test-docker.yml: - POST /v1/responses (create) - GET /v1/responses/{id} (retrieve) - GET /v1/responses/{id}/input_items (list input items) - DELETE /v1/responses/{id} (delete and verify 404) Signed-off-by: Jintao Zhang <[email protected]>
1 parent 38757ba commit b49a46d

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed

.github/workflows/integration-test-docker.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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: |

config/config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ bert_model:
33
threshold: 0.6
44
use_cpu: true
55

6+
# Response API Configuration
7+
# Enables OpenAI Response API support with conversation chaining
8+
response_api:
9+
enabled: true
10+
store_backend: "memory" # Options: "memory", "milvus", "redis"
11+
ttl_seconds: 86400 # 24 hours
12+
max_responses: 1000
13+
614
semantic_cache:
715
enabled: true
816
backend_type: "memory" # Options: "memory", "milvus", or "hybrid"

0 commit comments

Comments
 (0)