Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions all-in-one/scripts/config-template/ai-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,6 @@ spec:
priority: 100
url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/ai-proxy:2.0.0" >"$WASM_PLUGIN_CONFIG_FOLDER/ai-proxy.internal.yaml"

AI_STATISTICS_MATCH_RULES=""
for i in "${GENERATED_INGRESSES[@]}"
do
AI_STATISTICS_MATCH_RULES="$AI_STATISTICS_MATCH_RULES
- config:
attributes:
- apply_to_log: true
key: question
value: messages.@reverse.0.content
value_source: request_body
- apply_to_log: true
key: answer
rule: append
value: choices.0.delta.content
value_source: response_streaming_body
- apply_to_log: true
key: answer
value: choices.0.message.content
value_source: response_body
configDisable: false
ingress:
- $i"
done
echo -e "\
apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
Expand All @@ -176,9 +153,10 @@ metadata:
namespace: higress-system
resourceVersion: \"1\"
spec:
defaultConfigDisable: true
defaultConfig:
use_default_attributes: true
defaultConfigDisable: false
failStrategy: FAIL_OPEN
matchRules:$AI_STATISTICS_MATCH_RULES
phase: UNSPECIFIED_PHASE
priority: 900
url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/ai-statistics:2.0.0" >"$WASM_PLUGIN_CONFIG_FOLDER/ai-statistics-1.0.0.yaml"
Expand Down