workspace working
This commit is contained in:
21
upload_with_auth.py
Normal file
21
upload_with_auth.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import requests
|
||||
import json
|
||||
import os
|
||||
|
||||
url = "http://localhost:3015/documents/upload"
|
||||
headers = {
|
||||
"X-API-Key": "jleu1212",
|
||||
"accept": "application/json",
|
||||
}
|
||||
files = {
|
||||
"file": open("test/ocr.pdf", "rb"),
|
||||
}
|
||||
data = {
|
||||
"workspace": "test1",
|
||||
"chunk_size": 1200,
|
||||
"chunk_overlap": 100,
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, files=files, data=data)
|
||||
print(f"Status: {response.status_code}")
|
||||
print(f"Response: {response.text}")
|
||||
Reference in New Issue
Block a user