GerevAI / gerev

🧠 AI-powered enterprise search engine 🔎
https://app.klu.so/signup?utm_source=github_gerevai
MIT License
2.72k stars 178 forks source link

Suggestion: wrap data_source clients #80

Open Itaykal opened 1 year ago

Itaykal commented 1 year ago

Using SDKs and official APIs is nice and very easy to read/implement/maintain, but when using requests I think wrapping those requests in a client could make life easier on future changes. Same goes to the official APIs and SDKs but those are much less of a pain when reading the code itself.

Creating a client.py file or data_class/client folder seems right for me, Ideally when something changes in the API itself you'd want your code to work properly, when you wrap it up in your own class you need to change much less code in the data source itself and only touch the client side.

As for making the code safer - adding this folder could be a nice place to start writing tests and mocks for each client but that's a whole other topic.

Roey7 commented 1 year ago

Good vision @Itaykal , wanna do it?

Itaykal commented 1 year ago

I could, it will take me some time as I'm not sure how much available I'll be in the next few weeks