Samagra-Development / ai-tools

AI Tooling to bootstrap applications fast
41 stars 109 forks source link

Curl Requests for the following APIs #26

Closed ChakshuGautam closed 1 year ago

ChakshuGautam commented 1 year ago
djgupta commented 1 year ago

start the APIs

sh ~/aitools_temp/start.sh

stop the APIs

sh ~/aitools_temp/stop.sh

openai completions

curl --location 'http://IP:8002/llm/openai/completions/remote' --header 'Authorization: Bearer APIKEY' --header 'Content-Type: application/json' --data '{ "model": "gpt-3.5-turbo", "messages": [ { "role": "user", "content": "Hello!" } ] }'

openai prompt

curl --location 'http://IP:8002/llm/openai/prompt/remote' --header 'Authorization: Bearer APIKEY' --header 'Content-Type: application/json' --data '{ "model": "text-davinci-003", "prompt": "Can you provide me 3 fill in the blanks questions for prepositions" }'

translate indic to english

curl --location 'http://IP:8001/translateX2Y/bhashini/onprem/translate_paragraph' --header 'Content-Type: application/json' --data '{ "source":"or", "target":"en", "paragraph": "ବହୁତ ଦିନ ହେଲାଣି ଦେଖା ନାହିଁ" }'

odia speech to odia text

curl --location 'http://IP:8000/speech2text/bhashini/onprem' --header 'Content-Type: application/json' --data '{ "config": { "language": { "sourceLanguage": "or" }, "transcriptionFormat": { "value": "transcript" }, "audioFormat": "wav" }, "audio": [ { "audioUri": "https://github.com/djgupta/flat_files/raw/main/odiya_test.wav" } ] }'

ChakshuGautam commented 1 year ago

/translateX2Y/bhashini/remote

curl --location 'http://127.0.0.1:5000/text_translation/bhashini/remote' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token'\
--data '{
    "source_language": "en",
    "target_language": "or",
    "text": "What is your name"
}'

/text_lang_detection/bhashini/remote

curl --location 'http://127.0.0.1:5000/text_lang_detection/bhashini/remote' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token'\
--data '{
    "text": "What is your name"
}'

/embeddings/openai/remote

curl --location 'http://127.0.0.1:5000/embeddings/openai/remote' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token'\
--data '{
    "prompt": "What is the eligibilty criteria for sheme to create New Inalnd Grow-out Ponds What is the eligibilty criteria for sheme to create New Inalnd Grow-out PondsWhat is the eligibilty criteria for sheme to create New Inalnd Grow-out PondsWhat is the eligibilty criteria for sheme to create New Inalnd Grow-out Ponds What is the eligibilty criteria for sheme to create New Inalnd Grow-out PondsWhat is the eligibilty criteria for sheme to create New Inalnd Grow-out PondsWhat is the eligibilty criteria for sheme to create New Inalnd Grow-out Ponds"
}'

/llm/openai/remote

curl --location 'http://127.0.0.1:5000/llm/openai/chatgpt3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token'\
--data '{
    "prompt": [
        {"role": "user", "content": "How do I grow paddy in orissa"}
    ]
}'

coref/spacy/local

curl --location 'http://127.0.0.1:5000/coref/spacy/local' \
--header 'Content-Type: application/json' \
--header 'Authorization: 2Un3M2heYuJ8NTsl9hLA2KnpTFwaeKgeRV05mu1dMwlUKt4WjT' \
--data '{
    "text": "The cats were startled by the dog as it growled at them."
}'
GautamR-Samagra commented 1 year ago

curl --location 'http://127.0.0.1:8833//embeddings/get_similarity/openai' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "How do I grow paddy in Odisha? " , "api_key": "API_key", "range_sim_score" : "0.03" }'