Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

JS / TS Client library #43

Open
jakubno opened this issue Aug 22, 2023 · 8 comments
Open

JS / TS Client library #43

jakubno opened this issue Aug 22, 2023 · 8 comments
Labels
good first issue Good for newcomers

Comments

@jakubno
Copy link
Contributor

jakubno commented Aug 22, 2023

Is your feature request related to a problem? Please describe.

We want to generate as much of the code as possible from the OpenAPI. This will help us to stay up to date with the protocol and in the same time it improves development speed and limits possible bugs in implementation.

Describe the solution you'd like

  • It should be in TypeScript
  • Add makefile with generate command generate, which will regenerate the code

Additional context

I would recommend using of the OpenAPI codegens.

Feel free to come with something else

@jakubno jakubno added the good first issue Good for newcomers label Aug 22, 2023
@alchaplinsky
Copy link

Hey @jakubno,
I've been playing with making calls to agent-protocol in TypeScript and hacked together a simple client for it. It is pretty basic and it has no error handling, but I can work on improving it if that's something you'd be interested in adding to the repo. Let me know, I'd like to contribute! Cheers!

@jzanecook
Copy link
Collaborator

Wow @alchaplinsky that looks awesome! I'd love to make a new repo for it and transition it over, although I do have some concerns. Mainly in that it doesn't look like it uses the Open API generator for the spec (which means you wrote it all manually right?)

I did the same thing with the TS SDK early on 😆

If you want to keep improving it and base it on the openapi.yml spec, I'd be happy to bring it into the fold 👍

@alchaplinsky
Copy link

@jzanecook Yeah, it's not generated, it's something that I put together while playing with SDK. I'll look closer into openapi.yml spec, definitely better to have based on certain standards. I'd love to keep improving and evolving it and hopefully contribute to other repos as well!

@jzanecook
Copy link
Collaborator

@alchaplinsky That sounds great! Are you also on our Discord by any chance? Feel free to ask questions in there as well.

Honestly, if you can get it to generate based on the spec and it's working then I'd love to get it into its own repository and we can improve it from there.

@alchaplinsky
Copy link

@jzanecook Yes, I am on AIEF Discord. Sounds good, I'll work on it and will let you know when it's ready!

@wilsonianb
Copy link
Contributor

It looks like the python client was generated using @openapitools/openapi-generator-cli

The OpenAPI Generator is a Java project. openapi-generator-cli will download the appropriate JAR file and invoke the java executable to run the OpenAPI Generator. You must have the java binary executable available on your PATH for this to work.

I'm not crazy about needing Java. Would it be ok to instead require devs to have docker (just for client generation)?
https://www.npmjs.com/package/@openapitools/openapi-generator-cli#use-docker-instead-of-running-java-locally

There's also openapi-type-codegen ("we do not want to use JAVA codegen in our builds"😅), but then we're using different tooling for the python and js clients...

@wilsonianb
Copy link
Contributor

wilsonianb commented Jan 3, 2024

I'm also wondering if there should be a single script (in the root package.json?) to regenerate all clients and sdks based on the current OpenAPI specs.
You could then have husky and/or a GitHub Actions workflow validate that everything's up to date.

@wilsonianb
Copy link
Contributor

OpenAI Microsoft is also here to help
https://github.com/microsoft/kiota

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants