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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add run name for query constructor #18101

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions libs/langchain/langchain/retrievers/self_query/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def from_llm(
chain_kwargs: Optional[Dict] = None,
enable_limit: bool = False,
use_original_query: bool = False,
hwchase17 marked this conversation as resolved.
Show resolved Hide resolved
query_constructor_run_name: str = "query_constructor",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo doesn't need to be an arg, can just hard code

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're using an arg, perhaps we could use a standard arg name argument? (e.g., run_name) and it'll be understood that it refers to the top level object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if there's multiple different runnables in a constructor?

ill just remove as an arg for now and avoid this question :)

**kwargs: Any,
) -> "SelfQueryRetriever":
if structured_query_translator is None:
Expand Down Expand Up @@ -235,6 +236,9 @@ def from_llm(
enable_limit=enable_limit,
**chain_kwargs,
)
query_constructor = query_constructor.with_config(
run_name=query_constructor_run_name
)
return cls(
query_constructor=query_constructor,
vectorstore=vectorstore,
Expand Down