feat(API): Ingest plain text (#1417)

* Add ingest/text route to ingest plain text

* Add new ingest text test and adapt ingest/file ones

* Include new API in docs

* Remove duplicated logic
This commit is contained in:
Iván Martínez 2023-12-18 21:47:05 +01:00 committed by GitHub
parent 059f35840a
commit 6eeb95ec7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 198 additions and 17 deletions

View file

@ -13,7 +13,7 @@ class IngestHelper:
def ingest_file(self, path: Path) -> IngestResponse:
files = {"file": (path.name, path.open("rb"))}
response = self.test_client.post("/v1/ingest", files=files)
response = self.test_client.post("/v1/ingest/file", files=files)
assert response.status_code == 200
ingest_result = IngestResponse.model_validate(response.json())
return ingest_result