68 lines
1.7 KiB
Bash
Executable File
68 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
PORT=${1:-18080}
|
|
BASE_URL="http://localhost:${PORT}"
|
|
|
|
echo "=== 1. Testing Models Endpoint ==="
|
|
curl -s "${BASE_URL}/v1/models" | jq .
|
|
|
|
echo ""
|
|
echo "=== 2. Testing Non-Streaming Chat Completion ==="
|
|
curl -s -X POST "${BASE_URL}/v1/chat/completions" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"model": "qorona",
|
|
"messages": [
|
|
{"role": "user", "content": "What is the capital of Italy? Answer in 1 word."}
|
|
],
|
|
"reasoning_effort": "none",
|
|
"max_tokens": 50
|
|
}' | jq .
|
|
|
|
echo ""
|
|
echo "=== 3. Testing Streaming SSE Completion (with reasoning) ==="
|
|
curl -N -s -X POST "${BASE_URL}/v1/chat/completions" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"model": "qorona",
|
|
"messages": [
|
|
{"role": "user", "content": "Calculate 25 * 25 and explain briefly in one sentence."}
|
|
],
|
|
"stream": true,
|
|
"reasoning_effort": "medium",
|
|
"max_tokens": 150
|
|
}'
|
|
|
|
echo ""
|
|
echo "=== 4. Testing Function/Tool Calling ==="
|
|
curl -s -X POST "${BASE_URL}/v1/chat/completions" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"model": "qorona",
|
|
"messages": [
|
|
{"role": "user", "content": "What is the weather in Berlin?"}
|
|
],
|
|
"tools": [
|
|
{
|
|
"type": "function",
|
|
"function": {
|
|
"name": "get_weather",
|
|
"description": "Get current weather for location",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"location": {"type": "string"}
|
|
},
|
|
"required": ["location"]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"reasoning_effort": "none",
|
|
"max_tokens": 200
|
|
}' | jq .
|
|
|
|
echo ""
|
|
echo "=== All qorona integration tests finished successfully! ==="
|