Background
We want to extend the prototype currently implemented in main.py and transition it to a more solid base.
This is a big refactor but we want to introduce the changes step by step across several pull requests and keep the project functional.
This lowers the risk by keeping changes minimal.
Task
- Implement a
DeepsetClient that makes all requests to the deepset API.
The client should:
- be async
- be useable with an AsyncContextManager
- be testable (create a thin wrapper around http transport (via httpx) that we can fake in tests (dependency injection) (maybe via Protocol?)
- make all requests to the deepset API via the DeepsetClient
- go through main.py and change all places where we make requests to the API so that they use the new DeepsetClient
- adjust the tests in test_main.py
Out of Scope
- we do NOT introduce specific models or API exceptions yet
- we do NOT introduce any API resources yet (like Pipeline)
- keep the changes minimal
- only introduce what we need to get DeepsetClient working
Background
We want to extend the prototype currently implemented in main.py and transition it to a more solid base.
This is a big refactor but we want to introduce the changes step by step across several pull requests and keep the project functional.
This lowers the risk by keeping changes minimal.
Task
DeepsetClientthat makes all requests to the deepset API.The client should:
Out of Scope