OpenAPITools / OpenAPITools/openapi-generator
[REQ] New python client generator which exports the api funcs as langchain tools
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
I had this use case in my org where I need to provide an ai agentic chatbot over a basic crud server. Wanted to auto generate the langchain tools as they can be done using the openapi spec offered by the server easily. Think having a generator here would be useful in general as well.
I saw a thread regarding MCP server but this is specifically for tools
Describe the solution you'd like
- Introduce a new generator named
python-langchain-tools. - The
PythonLangchainToolsClientCodegenclass for this will extend thePythonClientCodegenand utilize it for client generation. - The new
PythonLangchainToolsClientCodegenclass would just create additional files which will import the clients and export them as lang chain tools
Describe alternatives you've considered
- creating new type of generators apart from
clientandserversbut tools are just a facade over clients so I think this would be good enougth to start with
Additional context
I have already implemented this in my local in a non platformized way using the approach mentioned above. If the community thinks this is plausible, can create a PR as well
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing PythonClientCodegen class and how client generators are organized. The proposed generator is named python-langchain-tools and should extend PythonClientCodegen while adding files that import the generated clients and expose them as LangChain tools. Done means the new generator can produce both the Python client and these tool files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, python
- Domain
- ai, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100