lossless-group_perplexed-pl.../test-perplexity-api.sh
mpstaton bf8f02221f fix(streaming): fix streaming for chat query.
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
2025-08-08 19:10:06 +02:00

39 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
# Test script for Perplexity API
# Usage: ./test-perplexity-api.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 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": "In GRC platforms, what does Governance mean? Please explain important workflows, tools, processes, and any policies or regulations that might be relevant. If you mention tools or services or regulatory bodies or membership organizations, please link to them in the text.\n\n**Image References:**\nPlease include the following image references throughout your response where appropriate:\n- [IMAGE 1: Relevant diagram or illustration related to the topic]\n- [IMAGE 2: Practical example or use case visualization]\n- [IMAGE 3: Additional supporting visual content]"
}
],
"stream": true,
"return_citations": true,
"return_images": true,
"return_related_questions": false
}' \
--verbose \
--max-time 30
echo ""
echo "Test completed."