forked from praxis-proxy/praxis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompt-enrichment.yaml
More file actions
52 lines (50 loc) · 1.54 KB
/
Copy pathprompt-enrichment.yaml
File metadata and controls
52 lines (50 loc) · 1.54 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
# Prompt Enrichment
#
# Requires the ai-inference feature:
# cargo build -p praxis-proxy --features ai-inference
#
# Injects system messages into OpenAI-compatible chat completion
# requests before forwarding to the upstream provider. The system
# prompt is defined at the proxy layer and cannot be overridden
# by clients.
#
# Only static configured messages are supported. Prepend accepts
# only system role; append accepts system or user roles.
#
# JSON is reserialized, so byte-for-byte body identity and key
# order are not preserved.
#
# Example request:
#
# curl -X POST http://localhost:8080/v1/chat/completions \
# -H "Content-Type: application/json" \
# -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}]}'
#
# The upstream receives the request with the system message
# prepended and the citation reminder appended.
listeners:
- name: gateway
address: "0.0.0.0:8080" # dev value; binds all interfaces
filter_chains:
- enrich-and-route
filter_chains:
- name: enrich-and-route
filters:
- filter: prompt_enrich
prepend:
- role: system
content: >-
You are a helpful assistant for Acme Corp.
Always be concise and professional.
append:
- role: user
content: "Remember to cite your sources."
- filter: router
routes:
- path_prefix: "/"
cluster: provider
- filter: load_balancer
clusters:
- name: provider
endpoints:
- "127.0.0.1:3000"