Open Z-oo883 opened 1 month ago
The "Connection error" you're encountering when applying transformations in the ragas
library could be due to several reasons, such as network issues, incorrect API keys, or misconfigured endpoints. Here are some steps you can take to troubleshoot and resolve the issue:
Check API Key and Endpoint: Ensure that your OpenAI API key and base URL are correctly set. Double-check the values in your .env
file and make sure they are loaded properly.
Network Connectivity: Verify that your network connection is stable and that there are no firewall or proxy settings blocking the connection to the OpenAI API.
Debugging Mode: Enable debugging mode in ragas
to get more detailed logs. Set the environment variable __RAGAS_DEBUG_TRACKING
to True
to enable detailed logging, which might provide more insights into the connection issues.
Error Handling: The ragas
library uses a decorator to handle errors silently. You might want to modify the code to raise exceptions for debugging purposes. This can help you identify the exact point of failure.
Review Logs: Check the logs for any additional error messages or stack traces that might indicate the source of the problem.
Test with Simple Setup: Try running a minimal setup with a simple document and transformation to see if the issue persists. This can help isolate the problem to specific parts of your code or configuration.
If the issue continues, consider testing with a different API or service to rule out specific service-related issues.
To continue talking to Dosu, mention @dosu.
@Z-oo883 = I was dealing with the same problem. It seems like in the 0.2.0 version, they did some refactoring and got rid of the embedding functionality that used to be part of the TestsetGenerator class in previous versions. I am not seeing the ability to pass an embedding model to the TestsetGenerator in the 0.2.0 version. I had to downgrade to use the 0.1.21 version instead to get it to work. With the new 0.2.0 version, I am not sure how you are supposed to create a testset with TestsetGenerator, if you cant either actively embed your text, or pass in embeddings somewhere earlier in the pipeline.
@Z-oo883 I have the same issue.
ERROR:ragas.testset.transforms.engine:unable to apply transformation: Connection error.
Also facing other errors in the process:
ERROR:ragas.prompt.pydantic_prompt:Prompt fix_output_format failed to parse output: The output parser failed to parse the output after 0 retries. ERROR:ragas.prompt.pydantic_prompt:Prompt headlines_extractor_prompt failed to parse output: The output parser failed to parse the output after 0 retries. ERROR:ragas.testset.transforms.engine:unable to apply transformation: The output parser failed to parse the output after 0 retries. ERROR:ragas.prompt.pydantic_prompt:Prompt fix_output_format failed to parse output: The output parser failed to parse the output after 0 retries. ERROR:ragas.prompt.pydantic_prompt:Prompt headlines_extractor_prompt failed to parse output: The output parser failed to parse the output after 0 retries. ERROR:ragas.testset.transforms.engine:unable to apply transformation: The output parser failed to parse the output after 0 retries. ERROR:ragas.testset.transforms.engine:unable to apply transformation: 'headlines' property not found in this node ERROR:ragas.testset.transforms.engine:unable to apply transformation: 'headlines' property not found in this node
I am following the updated how-to tutorial for test set generation without luck. I will try downgrading as @hunter-walden2113 suggested
This issue is due to part of the code associated with the generate_with_langchain_docs
method. That function is invoking a default LLM in the background to which there is no API key in your environment. There are many open issues regarding this problem. Working to fix it. In the meantime you can downgrade to the previous Ragas version to generate your test set.
when I try to use ragas0.2, I have encountered a problem:unable to apply transformation: Connection error,what shoud I do to deal with it? enviroment: ragas=0.2,python=3.9 code:
error: