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

added rag handler param #8781

Merged
merged 3 commits into from
Feb 19, 2024
Merged

added rag handler param #8781

merged 3 commits into from
Feb 19, 2024

Conversation

martyna-mindsdb
Copy link
Contributor

@martyna-mindsdb martyna-mindsdb commented Feb 16, 2024

Description

  • added rag handler param
  • update readme and docs

Fixes #issue_number

Type of change

  • ⚑ New feature (non-breaking change which adds functionality)
  • πŸ“„ This change requires a documentation update

Verification Process

To ensure the changes are working as expected:

  • Test Location: Specify the URL or path for testing.
  • Verification Steps: Outline the steps or queries needed to validate the change. Include any data, configurations, or actions required to reproduce or see the new functionality.

Additional Media:

  • I have attached a brief loom video or screenshots showcasing the new functionality or change.

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

@martyna-mindsdb
Copy link
Contributor Author

@dusvyat
Please have a look.

When testing I get an error after creating the model - ValidationError: 1 validation error for RAGHandlerParameters input_column extra fields not permitted (type=value_error.extra), raised at: C:\Users\Martyna\mindsdb_setup\mindsdb\.\mindsdb\integrations\libs\ml_handler_process\learn_process.py#109

@dusvyat
Copy link
Contributor

dusvyat commented Feb 16, 2024

@dusvyat Please have a look.

When testing I get an error after creating the model - ValidationError: 1 validation error for RAGHandlerParameters input_column extra fields not permitted (type=value_error.extra), raised at: C:\Users\Martyna\mindsdb_setup\mindsdb\.\mindsdb\integrations\libs\ml_handler_process\learn_process.py#109

As we use pydantic, we need to update the model see here

You would need to add it here too

@martyna-mindsdb
Copy link
Contributor Author

@dusvyat
Thanks. It fixed this issue.

But now, when querying for predictions, there is another issue:

image

@@ -133,6 +133,6 @@ def predict(self, df: pd.DataFrame = None, args: dict = None):

# get question from sql query
# e.g. where question = 'What is the capital of France?'
response = question_answerer(df["question"].tolist()[0])
response = question_answerer(df[args["input_column"]].tolist()[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be args.input_column

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had it at first. Changing it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Now it works fine. Thanks.

image

Copy link
Contributor

@dusvyat dusvyat left a comment

Choose a reason for hiding this comment

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

lgtm πŸš€

@martyna-mindsdb martyna-mindsdb merged commit 281d0fe into staging Feb 19, 2024
10 checks passed
@StpMax StpMax mentioned this pull request Feb 19, 2024
@hamishfagg hamishfagg deleted the rag-handler-param branch June 10, 2024 21:27
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