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

Langchain: Update Vectara templates #15363

Merged
merged 8 commits into from
Jan 20, 2024

Conversation

ofermend
Copy link
Contributor

@ofermend ofermend commented Dec 31, 2023

fixed multi-query template for Vectara
added self-query template for Vectara

Also added prompt_name parameter to summarization

CC @efriis
Twitter handle: @ofermend

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 31, 2023
@efriis efriis self-assigned this Dec 31, 2023
Copy link

vercel bot commented Dec 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jan 13, 2024 5:49am

@dosubot dosubot bot added Ɑ: models Related to LLMs or chat model modules 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Dec 31, 2023
Copy link
Member

@efriis efriis left a comment

Choose a reason for hiding this comment

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

Hey @ofermend ! The multiquery changes look great.

I don't think the self query one has been tested. I think the chain is missing a prompt and LLM call potentially, and let me know if that's incorrect! I run into a KeyError on -1 when running it because the object passed into the lambda is a dict.


chain = (
RunnableParallel({"context": retriever, "question": RunnablePassthrough()})
| (lambda res: res[-1])
Copy link
Member

Choose a reason for hiding this comment

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

Bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you're right.
I've spent some time looking at this more closely and I think it's more complex than I had originally thought. Not this bug specifically, I mean the whole self-query RAG. I wanted to make it work such that it uses Vectara summarizer, but it seems quite complex in the current setting, as SelfQueryRetriever seems to be built around retreiving documents and then using a separate LLM to do the final summarization.

  1. I could probably still make this template follow this path - use Vectara as purely a document retriever (without summarization) - what other example is best to follow in this case?
  2. Potentially later we can refactor this to make SelfQuery also support accepting a summarization component.
    WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@efriis due to not having too much bandwidth next few weeks to make this work, let me just clean up (remove) the SQ stuff and will just leave the good fixes for MQ. We can tackle the SQ at some later time. SG?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds great!

python = ">=3.8.1,<4.0"
langchain = ">=0.0.325"
openai = "<2"
tiktoken = "^0.5.1"
Copy link
Member

Choose a reason for hiding this comment

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

also missing lark

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 10, 2024
@ofermend
Copy link
Contributor Author

Updated w/o SelfQuery

@ofermend
Copy link
Contributor Author

@efriis - update as discussed. Pls let me know if anything else missing.

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jan 20, 2024
@baskaryan baskaryan merged commit ffae98d into langchain-ai:master Jan 20, 2024
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PR looks good. Use to confirm that a PR is ready for merging. Ɑ: models Related to LLMs or chat model modules size:S This PR changes 10-29 lines, ignoring generated files. template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants