Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add example for Function Call with streaming #85

Closed
64bit opened this issue Jul 20, 2023 · 3 comments
Closed

Add example for Function Call with streaming #85

64bit opened this issue Jul 20, 2023 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@64bit
Copy link
Owner

64bit commented Jul 20, 2023

Just like examples/function-call but using streaming call.

Note: There is open PR at the moment but no way to test it #83

@oslfmt
Copy link
Contributor

oslfmt commented Jul 22, 2023

@64bit going to try to tackle this issue first.

I've been skimming the codebase and also the OpenAPI spec. Just curious (and this might help me understand the codebase better) - what was the main design and considerations you took while developing this library to use the OpenAI API? Did you mostly use the OpenAPI spec or look at the design of their official python library?

@64bit
Copy link
Owner Author

64bit commented Jul 23, 2023

The primary source was OpenAPI spec and async-stripe was source of inspiration, you might find evolution of this library if you look at early commits. When I started I couldnt find good resources to generate code from spec, and json spec is not always up to date, sometimes has human errors. Moreover there are complex situations like streaming where an input field like "stream": true determines SSE response.

So I decided to build this library with hand instead of relying on auto generation (although auto generation would be ideal for Rust in long term) because my focus was on correctness, auto retries on rate limit and full API coverage - all the things to make library production ready.

I had skimmed through the offcial python library too, and then went with spec as source of truth and grouping ("images", "fine-tunes" etc.) based on OpenAPI spec + RESTful spec.

@64bit
Copy link
Owner Author

64bit commented Jul 30, 2023

resolved in #90

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants