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

Parse JSON string in adapt() #584

Merged

Conversation

mitmul
Copy link
Contributor

@mitmul mitmul commented Feb 9, 2024

Thank you for this great framework for evaluating RAG systems.

When using RAGAS, I encountered the following error while trying to adapt metrics to a specific language because the content of the output key in the elements of the examples attribute in the Prompt class was in un-parsed JSON (=str). It would be great if this PR could fix this error. I would appreciate it if you could check. Here is the error:

/usr/lib/python3.10/site-packages/ragas/llms/prompt.py", line 154, in get_all_keys                                 
    for key, value in nested_json.items():                                                    
AttributeError: 'str' object has no attribute 'items'  

@shahules786
Copy link
Member

got it, thanks @mitmul

@shahules786 shahules786 merged commit eeb8233 into explodinggradients:main Feb 9, 2024
15 checks passed
@mitmul mitmul deleted the parse-json-str-in-adapt branch February 10, 2024 02:06
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

2 participants