Skip to content

Instantly share code, notes, and snippets.

@fsndzomga
Last active March 31, 2024 22:45
Show Gist options
  • Save fsndzomga/3cd4d64215a5fb9f87620fb3bb8f4f4a to your computer and use it in GitHub Desktop.
Save fsndzomga/3cd4d64215a5fb9f87620fb3bb8f4f4a to your computer and use it in GitHub Desktop.
#!/bin/bash
# Testing file upload
echo "Testing file upload..."
curl -X 'POST' \
'http://localhost:8000/uploadfile/' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@/usercode/test-file.txt;type=text/plain'
echo ""
echo ""
# Testing the root endpoint
echo "Testing the root endpoint..."
curl -X 'GET' 'http://localhost:8000/' -H 'accept: application/json'
echo ""
echo ""
# Wait for 30 seconds before testing question answering
echo "Waiting for 30 seconds before testing question answering..."
sleep 30
# Testing question answering
echo "Testing question answering..."
curl -X 'POST' \
'http://localhost:8000/ask/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"document_id": 1, "question": "When was Barack Obama elected for the second time ?"}'
echo ""
echo ""
# Testing similar chunk retrieval
echo "Testing similar chunk retrieval..."
curl -X 'POST' \
'http://localhost:8000/find-similar-chunks/1' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"question": "Who is Barack Obama wife and when did they met ?"}'
echo ""
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment