mirror of
https://github.com/lossless-group/perplexed-plugin.git
synced 2026-07-22 17:00:32 +00:00
On branch feature/perplexity-streaming Changes to be committed: modified: README.md new file: src/docs/Understanding-the-Perplexity-Response-Object.md modified: src/services/lmStudioService.ts modified: src/services/perplexicaService.ts modified: src/services/perplexityService.ts new file: src/utils/formatDate.ts modified: styles.css new file: test-perplexity-api.sh new file: test-perplexity-non-streaming.sh
39 lines
890 B
Bash
Executable file
39 lines
890 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Test script for Perplexity API (Non-streaming)
|
|
# Usage: ./test-perplexity-non-streaming.sh YOUR_API_KEY
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 YOUR_API_KEY"
|
|
echo "Example: $0 pplx-abc123..."
|
|
exit 1
|
|
fi
|
|
|
|
API_KEY="$1"
|
|
|
|
echo "Testing Perplexity API (NON-STREAMING) with the same payload structure..."
|
|
echo "API Key: ${API_KEY:0:10}..."
|
|
echo ""
|
|
|
|
curl -X POST "https://api.perplexity.ai/chat/completions" \
|
|
-H "Authorization: Bearer $API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Accept: application/json" \
|
|
-d '{
|
|
"model": "sonar-pro",
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "What is GRC in simple terms?"
|
|
}
|
|
],
|
|
"stream": false,
|
|
"return_citations": true,
|
|
"return_images": false,
|
|
"return_related_questions": false
|
|
}' \
|
|
--verbose \
|
|
--max-time 30
|
|
|
|
echo ""
|
|
echo "Non-streaming test completed."
|