chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
14.61k stars 1.22k forks source link

[Feature Request]: Improve server api for generating clients for statically typed languages #935

Open tazarov opened 1 year ago

tazarov commented 1 year ago

Describe the problem

While creating clients for chroma in Java and Go I've wanted to be able to generate java/go specific clients from the openapi.json of chroma sever API. However as it was taken from pyhon implementation, it relies on generics (e.g. { } as return object) which JS and Python are all to happy to play along with. However static languages like java/go etc. do not like this type of generics and generated clients need a lot of adjustments.

Describe the proposed solution

I have created a "good enough" spec based on 0.4.4 server which can be used to enhance the FastAPI endpoints (response models mostly) so that generated OpenAPI spec is useful for static langs.

Here is the Gist with the spec - https://gist.github.com/tazarov/c2e0f4952a881cc7a0fb01de982e8556

Alternatives considered

Update the generated clients by hand - too consuming and when, inevitably, changes to the API are made it is a lot more difficult to update clients.

Importance

would make my life easier

Additional Information

No response

tazarov commented 1 year ago

@jeffchuber you can attach https://github.com/chroma-core/chroma/pull/942 to this