Spaces:
Sleeping
Sleeping
Download test_jina.py from thabsheeeeeer/DocBrain-API: direct link, hf CLI and curl.
- Browser
- Download file 379 Bytes
-
https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/test_jina.py
- Command line
-
hf download hf://spaces/thabsheeeeeer/DocBrain-API/test_jina.py
-
curl -L -o test_jina.py https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/test_jina.py
379 Bytes
| import httpx | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| response = httpx.post( | |
| "https://api.jina.ai/v1/embeddings", | |
| headers={ | |
| "Authorization": f"Bearer {os.getenv('JINA_API_KEY')}", | |
| "Content-Type": "application/json", | |
| }, | |
| json={ | |
| "model": "jina-embeddings-v3", | |
| "input": ["Hello world"], | |
| }, | |
| ) | |
| print(response.json()) |