-
Couldn't load subscription status.
- Fork 6.5k
feat(retrievers-superlinked): add Superlinked retriever integration (new package) #19636
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(retrievers-superlinked): add Superlinked retriever integration (new package) #19636
Conversation
…verage and egg-info
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
|
||
| from typing import Any, List, Optional | ||
|
|
||
| try: |
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.
This seems weird. llama-index-core is a dependency of this package. We don't need this try/except statement, we can just import the classes since the core package is expected to be there
| """ | ||
| LlamaIndex retriever for Superlinked. | ||
|
|
||
| Parameters |
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've bee using google-style docstrings, the API reference won't generate nicely without that specific style
| ) -> None: | ||
| # Import and validate types lazily to avoid hard dependency at import time | ||
| try: | ||
| from superlinked.framework.dsl.app.app import App # type: ignore |
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.
Shouldn't superlinked just be a package dependency? No need to hide the import
|
|
||
| # Initialize BaseRetriever | ||
| try: | ||
| super().__init__(callback_manager) |
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.
nit: prefer explicit kwargs: super().__init__(callback_manager=callback_manager)
| self.k = k | ||
|
|
||
| # Initialize BaseRetriever | ||
| try: |
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.
no need for this try/except
| page_content_field: str, | ||
| query_text_param: str = "query_text", | ||
| metadata_fields: Optional[List[str]] = None, | ||
| k: int = 4, |
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.
nit: top_k instead of k ? (sims inconsistent otherwise)
| query_text_param: str = "query_text", | ||
| metadata_fields: Optional[List[str]] = None, | ||
| k: int = 4, | ||
| callback_manager: Optional[Any] = None, |
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.
you could technically import the proper type here
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.
This seems ok, but I think we can clean up the imports and dependencies
…oogle-style docs, rename k->top_k, deps, examples/tests, lint clean
@logan-markewich made some fixes |
Description
Adds a new integration package: Superlinked Retriever, under
llama-index-integrations/retrievers/llama-index-retrievers-superlinked. It exposes a LlamaIndex-compatible retriever that wraps a SuperlinkedAppandQueryDescriptor, returningTextNode/NodeWithScore.Includes:
from llama_index.retrievers.superlinked import SuperlinkedRetrieveruv.lockDependencies:
llama-index-core>=0.13.1,<0.14superlinked,pandas(Superlinked requires Python 3.10–3.12)Fixes # (issue): N/A
New Package?
Did I fill in the
tool.llamahubsection in thepyproject.tomland provide a detailed README.md for my new integration or package?Version Bump?
Did I bump the version in the
pyproject.tomlfile of the package I am updating? (Except for thellama-index-corepackage)0.1.0)Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.
Notes:
superlinked+pandas; optional QueryEngine path degrades gracefully if LLM extras are not installed.Suggested Checklist:
uv run make format; uv run make lintto appease the lint godsSuggested PR title:
feat(retrievers-superlinked): add Superlinked retriever integration (new package)