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

Add OpenAPI chain with OpenAI functions #97

Merged
merged 9 commits into from
Jul 8, 2023
Merged

Conversation

kreneskyp
Copy link
Owner

@kreneskyp kreneskyp commented Jul 5, 2023

Description

This integrates the OpenAPI Functions chain described here: https://python.langchain.com/docs/modules/chains/additional/openapi_openai

The OpenAPI Functions chain reads an API spec and passes it to an OpenAI LLM as functions. The chain then executes the call against the API.

image

Tested with klarna api

image

Changes

  • adds NodeType definitions for get_openapi_chain

How Tested

  • manual tests

TODOs

  • Currently blocked as get_openapi_chain uses SimpleRequestChain which does not support async. Need a workaround or upstream fix.

      Fixed: Hacked around this by patching `asyncio` support into `SimpleRequestRouter` used by the OpenAPI chain.
    
  • API requests are working but needs further work to format output for the user.

Discovered and fixed bugs or worked around them #104 #105 #106

@kreneskyp kreneskyp marked this pull request as ready for review July 8, 2023 01:12
@kreneskyp kreneskyp merged commit dc629d9 into master Jul 8, 2023
@kreneskyp kreneskyp deleted the openai_function_chain branch July 8, 2023 01:24
This was referenced Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant