25 lines
609 B
Bash
Executable file
25 lines
609 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ $# -lt 1 ]]; then
|
|
printf 'Uso: %s "consulta especifica"\n' "$0" >&2
|
|
exit 1
|
|
fi
|
|
|
|
QUERY="$*"
|
|
ENDPOINT="https://rag.por-correo.com/retrieve"
|
|
|
|
curl -sS -X POST "$ENDPOINT" \
|
|
-H "Content-Type: application/json" \
|
|
-d @- <<JSON
|
|
{
|
|
"mode": "documental",
|
|
"intent": "specific",
|
|
"query": $(printf '%s' "$QUERY" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))'),
|
|
"scope": {
|
|
"sourceId": "corpus:gstreamer:official:v1",
|
|
"sourceRef": "gstreamer-official",
|
|
"tags": ["gstreamer", "official-docs", "multimedia", "documental"]
|
|
}
|
|
}
|
|
JSON
|