-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: Add OpenAPI support, OpenAPITool
component
#8
Conversation
OpenAPIServiceToFunctions
and OpenAPIServiceConnector
OpenAPIServiceToFunctions
and OpenAPIServiceConnector
I ran all the integration live tests as well locally; for those we need to setup integration runs and api keys as well |
0765b5c
to
83e8f88
Compare
OpenAPIServiceToFunctions
and OpenAPIServiceConnector
OpenAPITool
component
We currently support OpenAI function calling compatible models (OpenAI, fireworks, anyscale) etc |
haystack_experimental/components/tools/openapi/payload_extraction.py
Outdated
Show resolved
Hide resolved
haystack_experimental/components/tools/openapi/schema_conversion.py
Outdated
Show resolved
Hide resolved
haystack_experimental/components/tools/openapi/schema_conversion.py
Outdated
Show resolved
Hide resolved
haystack_experimental/components/tools/openapi/schema_conversion.py
Outdated
Show resolved
Hide resolved
haystack_experimental/components/tools/openapi/schema_conversion.py
Outdated
Show resolved
Hide resolved
My first question looking at this at high level: How would I provide other haystack pipelines as tools with this component? |
@TuanaCelik we'll have another component for that use case. This one is specific for openapi integration, hence the package name and the component name. We'll add another component in tools.pipeline or smth similar for that use case. For this use case see https://github.com/vblagoje/notebooks/blob/main/haystack2x-demos/haystack_rag_serperdev_demo_new.ipynb |
@shadeMe I addressed 98% of the use cases as you suggested. I deviated from your advice in these situations:
|
@shadeMe I added back in http bearer token auth, as this one is fairly common type of auth in addition to apiKey. Even our own firecrawl example uses it:
For reference OpenAPI Specification 3.x supports the following four types of authentication:
We support only first two excluding basic http (that's user password http auth) |
haystack_experimental/components/tools/openapi/_schema_conversion.py
Outdated
Show resolved
Hide resolved
haystack_experimental/components/tools/openapi/_schema_conversion.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI - There are a few more unresolved comments from the previous review.
@vblagoje Please also add the new feature to the catalog in the readme: https://github.com/deepset-ai/haystack-experimental?tab=readme-ov-file#experiments-catalog |
This made me realize that I didn't add an entry for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just need to add the component to the readMe.
@shadeMe Updated README to include the component 💪 |
This PR introduces the
OpenAPITool
, a powerful new component that enables calling OpenAPI service endpoints using payloads generated by chat generators from human instructions.Usage Examples
Example 1: Searching with Serper
The following example demonstrates how to use the
OpenAPITool
with the SerperDev API to perform a search:Example 2: Scraping with Firecrawl
The following example demonstrates how to use the
OpenAPITool
with the Firecrawl API to scrape a webpage:Example 3: Searching with Firecrawl using Anthropic Claude
The following example demonstrates how to use the
OpenAPITool
with the Firecrawl API to search and get back scraped pagesDemo
Here is a demo notebook featuring RAG+SerperDev, here is notebook demoing use of Anthropic models in Firecrawl WebQa RAG and finally a Cohere notebook variant of the same