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

Fix text nodes creation and improve agent handling #345

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

albertgilopez
Copy link

This PR addresses several issues and improvements in the multimodal RAG pipeline:

  1. Text Nodes Creation:

    • Modified the get_text_nodes function to handle multiple documents and create a node for each page
    • Updated the code where text nodes are created to use the modified function
    • Added checks to print the number of nodes and content of specific nodes for verification
  2. Multimodal Query Engine:

    • Updated the MultimodalQueryEngine class to ensure it's properly returning source nodes
  3. Agent Setup and Response Handling:

    • Modified the setup for both multimodal and base agents to use ReActAgent.from_tools()
    • Updated the query process to use agent.chat() instead of agent.query()
    • Improved error handling when accessing source nodes in the response
  4. Consistency:

    • Ensured consistency between multimodal and base agent setups
    • Standardized the way queries are made and responses are handled for both agents

These changes ensure that:

  • We create a text node for each page in the document, matching the number of images
  • The query engine properly returns source nodes
  • Both multimodal and base agents are set up and queried consistently
  • Responses are handled safely, with proper checks for the existence of source nodes

Testing:

  • Verified that the number of text nodes matches the number of images
  • Tested queries on both multimodal and base agents to ensure they return expected results with source nodes

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

1 participant