-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-simple.sh
More file actions
37 lines (29 loc) · 1.45 KB
/
test-simple.sh
File metadata and controls
37 lines (29 loc) · 1.45 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
#!/bin/bash
# Простой тест прокси - рабочая версия для WSL
# ИСПРАВЛЕНО: обрабатывает Windows line endings (CRLF) в test.env
if [ -f "test.env" ]; then
# Загружаем переменные и удаляем \r (CRLF -> LF)
source <(tr -d '\r' < test.env)
fi
# Очищаем переменные от возможных \r
API_KEY=$(echo "${AGENT_ROUTER_TOKEN:-sk-test}" | tr -d '\r')
MODEL=$(echo "${OPENAI_MODEL:-gpt-5}" | tr -d '\r')
echo "=========================================="
echo "Простой тест прокси"
echo "=========================================="
echo "API_KEY: ${API_KEY:0:20}..."
echo "MODEL: $MODEL"
echo ""
echo "Тест 1: healthz endpoint"
echo "=========================================="
curl -s http://localhost:8787/healthz
echo ""
echo ""
echo "Тест 2: POST запрос"
echo "=========================================="
# ВАЖНО: curl в ОДНУ строку! Многострочные curl с \ вызывают проблемы в WSL
curl -s -w "\nHTTP Status: %{http_code}\n" -d "{\"model\":\"$MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Say hello from bash\"}],\"max_tokens\":50}" -H "Content-Type: application/json" -H "Authorization: Bearer $API_KEY" http://localhost:8787/agentrouter/v1/chat/completions
echo ""
echo "=========================================="
echo "Готово"
echo "=========================================="