langchain
langchain copied to clipboard
Question about OpenAPI chain API auth
I'm trying to add a tool with the OpenAPI chain, and I'm struggling to get API auth working.
A bit about my use case:
- I want to build a ToolKit that takes a prompt and queries an external API (using multiple endpoints of the same API)
- I ideally want to load an OpenAPI schema from a file so the documentation for the endpoint can be passed to the LLM as context
- I need to specify the BaseURL as it's a multi-tenanted API, so I can't use the Server URL from an OpenAPI spec
- I need to add a basic auth header on each request i.e.
Authorization: Basic <token>
Is Open API chain the right tool?
I've tried the load_from_spec option but it reads the Base URL from the Open API spec. All the examples in the docs are for public, unauthenticated API calls as well.
I'd be happy to make a PR to update the docs if this functionality is supported but undocumented, or even try updating the OpenAPI tool if you can point me in the right direction.