64bit / async-openai

Rust library for OpenAI
https://docs.rs/async-openai
MIT License
1.04k stars 146 forks source link

Auto Generation from OpenAPI spec #163

Open 64bit opened 7 months ago

64bit commented 7 months ago

Background

This project started around Nov 2022 because I did not find any production ready Rust libraries for OpenAI covering all APIs.

And my non-comprehensive search back then did not lead any robust tools for generating Rust code from spec, and so this crate was hand written. Which is not sustainable when OpenAI does big releases like DevDay.

This issue is to have discussions, and potential long term solutions for generating Rust from OpenAPI spec. Something which helps not just async-openai but overall Rust eco-system for APIs with no production ready Rust crates - like DigitalOcean or Linode OpenAPI spec etc.

louis030195 commented 7 months ago

this works: openapi-generator generate -i openai-openapi.yaml -g rust -o ./output --skip-validate-spec

openai seems to use https://www.stainlessapi.com/ but it does seem a commercial product

64bit commented 7 months ago

Thanks for sharing the link.

Do you by any chance happen to have output of the openapi-generator ? I explored it back then but didn't work well

izyuumi commented 1 month ago

@64bit I am interested in this enhancement. Here's the output from the openapi-generator https://github.com/izyuumi/openaiapi.