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 instruction query generator #226

Merged
merged 8 commits into from
Dec 20, 2023

Conversation

izellevy
Copy link
Collaborator

@izellevy izellevy commented Dec 14, 2023

Problem

Currently, we only support LLMs that have function calling functionality for query generation. We need to support LLMs that do not have this functionality.

Solution

Added a new query generator that is able to generate a question based on the chat history without using function calling

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Describe specific steps for validating this change.


Copy link
Collaborator

@igiloh-pinecone igiloh-pinecone left a comment

Choose a reason for hiding this comment

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

@izellevy please see a few suggestions

config/anyscale.yaml Outdated Show resolved Hide resolved
src/canopy/chat_engine/query_generator/condensed.py Outdated Show resolved Hide resolved
src/canopy/chat_engine/query_generator/condensed.py Outdated Show resolved Hide resolved
src/canopy/chat_engine/query_generator/condensed.py Outdated Show resolved Hide resolved
src/canopy/chat_engine/query_generator/condensed.py Outdated Show resolved Hide resolved
Copy link
Contributor

@acatav acatav left a comment

Choose a reason for hiding this comment

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

LGTM overall! left some comments for your decision, and some for a discussion

src/canopy/chat_engine/query_generator/condensed.py Outdated Show resolved Hide resolved
src/canopy/chat_engine/query_generator/condensed.py Outdated Show resolved Hide resolved

class CondensedQueryGenerator(QueryGenerator):
_DEFAULT_COMPONENTS = {
"llm": AnyscaleLLM,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it not make more sense to use OpenAI also here as default. It seems more consistent for me, especially when we add more LLMs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also think so but @igiloh-pinecone had a comment on this. I agree that our default should be OpenAI

config/anyscale.yaml Outdated Show resolved Hide resolved
pass


class CondensedQueryGenerator(QueryGenerator):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure condensed describes well enough what this class is doing. How about InstructionQueryGenerator ? I think instruction prompting is the most common terminology for this type of prompt and parsing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@igiloh-pinecone what do you think about the name?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tend to agree with @acatav , the name Instruction or even Prompt is more common.
The "condensed" naming is a term that LLamaIndex invented, and I haven't seen it used otherwise.

Copy link
Collaborator

@igiloh-pinecone igiloh-pinecone left a comment

Choose a reason for hiding this comment

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

LGTM!

I do agree with @acatav about the name though. @izellevy - up to you

@izellevy izellevy changed the title Add condensed query generator Add instruction query generator Dec 18, 2023
@igiloh-pinecone igiloh-pinecone added this pull request to the merge queue Dec 19, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 19, 2023
@igiloh-pinecone igiloh-pinecone added this pull request to the merge queue Dec 19, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 19, 2023
@izellevy izellevy added this pull request to the merge queue Dec 20, 2023
Merged via the queue into pinecone-io:main with commit d0bcd22 Dec 20, 2023
10 checks passed
@izellevy izellevy deleted the feature/llm_query_generator branch December 20, 2023 11:55
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.

None yet

3 participants