Skip to content

Commit

Permalink
[fix] affinda passing file url
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrianC committed Dec 5, 2024
1 parent 512bd39 commit f0409eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions edenai_apis/apis/affinda/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,7 @@ def create_document(

files: Optional[Dict[str, BufferedReader]] = None

if file.type == "url":
payload["url"] = file.file
elif file.type == "file":
if file.type == "file":
with open(file.file, "rb") as f:
files = {"file": f}
return Document(
Expand All @@ -498,6 +496,7 @@ def create_document(
)
)
else:
payload["url"] = file.file
return Document(
**self.__requests(
method=HTTPMethod.POST,
Expand Down

0 comments on commit f0409eb

Please sign in to comment.