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

Update rag.py for ServiceContext and Response #11043

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

hkrsmk
Copy link
Contributor

@hkrsmk hkrsmk commented Feb 20, 2024

I had a problem using the upgrade CLI, similar to #10634

I wonder if it's because of the old import statements in this file. Please check and see if it's an appropriate patch before moving to Settings

Description

Similar issues with old ServiceContext and other old import statements. But I am not sure if the Response referred to is the same one as the new one I referred to. However, I couldn't find any other similarly-named "Response" in the docs, so I assumed this was correct.

However, according to this, the ServiceContext should be depreciated fully instead of a quick fix like this - https://docs.llamaindex.ai/en/stable/module_guides/supporting_modules/service_context_migration.html

I might have missed other old imports but I'm not familiar enough to check through it all. I guess we will see if this version errors out and fix it again 😆

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • I stared at the code and made sure it makes sense
  • In a local copy, the import was successful on the IDE.

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added Google Colab support for the newly added notebooks.
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
I had a problem using the CLI, similar to run-llama#10634

I wonder if it's because of the old import statements in this file. Please check and see if it's an appropriate patch before moving to Settings
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 20, 2024
@@ -7,15 +7,14 @@
from typing import Any, Callable, Dict, Optional, Union, cast

from llama_index.core import (
Response,
ServiceContext,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both of these imports work fine for me, but sure, more specific imports is fine too

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest making a fresh venv if those imports were causing issues tbh

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 20, 2024
@logan-markewich logan-markewich enabled auto-merge (squash) February 20, 2024 21:18
@logan-markewich logan-markewich merged commit 6b1083b into run-llama:main Feb 21, 2024
8 checks passed
Dominastorm pushed a commit to uptrain-ai/llama_index that referenced this pull request Feb 28, 2024
anoopshrma pushed a commit to anoopshrma/llama_index that referenced this pull request Mar 2, 2024
Izukimat pushed a commit to Izukimat/llama_index that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants