forked from praxis-proxy/praxis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest-validate.yaml
More file actions
55 lines (53 loc) · 1.75 KB
/
Copy pathrequest-validate.yaml
File metadata and controls
55 lines (53 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Responses API Request Validation
#
# Validates Responses API requests and rejects invalid parameter
# combinations.
#
# Requires the ai-inference feature:
# cargo build -p praxis-proxy --features ai-inference
#
# The openai_responses_format classifier must run before openai_responses_validate.
# It buffers the body, classifies the request as Responses API, and
# promotes model/stream/store/background to openai_responses_format.*
# metadata that openai_responses_validate reads for parameter-combination
# validation.
#
# openai_responses_validate then extracts conversation.id when present,
# generates response and conversation IDs, and writes responses.*
# metadata for downstream pipeline filters.
#
# Valid requests are forwarded to the upstream backend with the
# original body unchanged. Invalid requests receive a 400 JSON
# error response.
#
# Example valid request:
#
# curl -X POST http://localhost:8080/v1/responses \
# -H "Content-Type: application/json" \
# -d '{"model":"gpt-4.1","input":"Hello, world!"}'
#
# Example rejected request (stream + background conflict):
#
# curl -X POST http://localhost:8080/v1/responses \
# -H "Content-Type: application/json" \
# -d '{"model":"gpt-4.1","input":"test","stream":true,"background":true}'
listeners:
- name: responses-gateway
address: "127.0.0.1:8080"
filter_chains:
- validate-and-route
filter_chains:
- name: validate-and-route
filters:
- filter: openai_responses_format
on_invalid: reject
- filter: openai_responses_validate
- filter: router
routes:
- path: "/v1/responses"
cluster: inference
- filter: load_balancer
clusters:
- name: inference
endpoints:
- "127.0.0.1:8000"