OpenAPITools / OpenAPITools/openapi-generator

[REQ] New python client generator which exports the api funcs as langchain tools

Open
#22,076 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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 PythonLangchainToolsClientCodegen class for this will extend the PythonClientCodegen and utilize it for client generation.
  • The new PythonLangchainToolsClientCodegen class 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 client and servers but 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.