mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 10:45:42 +01:00
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:
parent
059f35840a
commit
6eeb95ec7f
6 changed files with 198 additions and 17 deletions
2
tests/fixtures/ingest_helper.py
vendored
2
tests/fixtures/ingest_helper.py
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue