1
This commit is contained in:
70
agent58k/test_server.sh
Normal file
70
agent58k/test_server.sh
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
# Test script to verify the Qwen Agent MCP Server is working
|
||||
|
||||
echo "🧪 Testing Qwen Agent MCP Server..."
|
||||
|
||||
# Check if server is running
|
||||
if ! curl -s http://localhost:8000/health > /dev/null 2>&1; then
|
||||
echo "❌ Server is not running on localhost:8000"
|
||||
echo " Start it with: python server.py"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Server is running"
|
||||
|
||||
# Test health endpoint
|
||||
echo ""
|
||||
echo "📊 Health Check:"
|
||||
curl -s http://localhost:8000/health | jq '.'
|
||||
|
||||
# Test root endpoint
|
||||
echo ""
|
||||
echo "📊 Capabilities:"
|
||||
curl -s http://localhost:8000/ | jq '.'
|
||||
|
||||
# Test models endpoint
|
||||
echo ""
|
||||
echo "📊 Available Models:"
|
||||
curl -s http://localhost:8000/v1/models | jq '.'
|
||||
|
||||
# Test chat completion (non-streaming)
|
||||
echo ""
|
||||
echo "📊 Testing Chat Completion (Simple):"
|
||||
curl -s http://localhost:8000/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "zdolny/qwen3-coder58k-tools:latest",
|
||||
"messages": [
|
||||
{"role": "user", "content": "What is 2+2? Just give the answer."}
|
||||
],
|
||||
"stream": false
|
||||
}' | jq '.choices[0].message.content'
|
||||
|
||||
# Test with tool usage
|
||||
echo ""
|
||||
echo "📊 Testing Chat with Tools (List Directory):"
|
||||
curl -s http://localhost:8000/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "zdolny/qwen3-coder58k-tools:latest",
|
||||
"messages": [
|
||||
{"role": "user", "content": "List the files in the current directory using the list directory tool"}
|
||||
],
|
||||
"stream": false
|
||||
}' | jq '.choices[0].message.content'
|
||||
|
||||
# Test streaming
|
||||
echo ""
|
||||
echo "📊 Testing Streaming:"
|
||||
curl -s -N http://localhost:8000/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "zdolny/qwen3-coder58k-tools:latest",
|
||||
"messages": [
|
||||
{"role": "user", "content": "Count from 1 to 3"}
|
||||
],
|
||||
"stream": true
|
||||
}' | head -n 20
|
||||
|
||||
echo ""
|
||||
echo "✅ All tests completed!"
|
||||
Reference in New Issue
Block a user