Forum in maintenance, we will back soon 🙂
SimplerLLM - Load content libraries issue Youtube summary tool not able to pull URLs
Hi Hasan, Need your help to make this work ....
using the youtube summary tool but when i run the code in vscode i face these issues: the loading library in simplellm is not triggering the URL am sharing to summarise. Iam using hasan's youtube video link itself for this test. The simplerllm libraries need a update on the bug maybe... am sharing the error screenshot and the script code screenshot: for the script i have made some adjustments to handle the error+bugs but no luck.
Not sure YouTube URL is in the format that the load_content
function in simplerLLM expects could be URLs with additional parameters might not be correctly parsed? But am using the standard url format as in the image attached. Not sure if the load_content
function works any specific types YouTube URLs. I have tried few here none seems to complete the script run successfully. Trying to figure out if simplerLLM library itself is not handling certain URL formats correctly, should the library get updated or should you modify the URL parsing function? ( all images attaches : code + response)
Hoping Hasan can help to fix.
hi hasan
kindly check on this when you’re open, am trying to make this script work with load_content @simplerllm
@google-naturemeditation Hello, the code seems to be correct. Try using another URL and if it doesn't work can you please send the code so that i can copy it and try from my end.
from SimplerLLM.language.llm import LLM, LLMProvider from SimplerLLM.tools.generic_loader import load_content # Create an instance of the LLM llm_instance = LLM.create(provider=LLMProvider.OPENAI, model_name="gpt-4o") # Define the YouTube URL url = "https://www.youtube.com/watch?v=D4EhZt_uweI" # Use a standard YouTube URL for testing try: # Load the content from the URL content = load_content(url).content # Define the prompt for summarization summarize_prompt = f"generate a bullet point summary for the following: {content}" # Generate the summary response generated_text = llm_instance.generate_response(prompt=summarize_prompt) # Print the generated summary print(generated_text) except ValueError as e: print(f"An error occurred: {e}")
tried with multiple different URLs but no luck so sharing the code above, also here is the error thats popping up ....
File "/Users/apple/Documents/Sites_applications-2024/.venv/lib/python3.12/site-packages/SimplerLLM/tools/generic_loader.py", line 206, in __read_youtube_video
raise Exception(f"An error occurred while fetching the video details: {e}")
Exception: An error occurred while fetching the video details: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>
was thinking if we are using the correct version of the simplerllm library and if that function is supporting this URL format from YouTube? should the library be updated to any new version of the library to manage any bugs related to URL parsing also for pulling in youtube urls? thanks for looking into this
here load_content function with simplerllm works for text output but not for youtube videos urls
anyluck with this request mate?
@google-naturemeditation did you set the OpenAI API key in the .env file? It seems from the error message that your system isn't setup to interpret the SSL connection properly.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
hey … yes key is set up proper… it works well with all other scripts including hasans blog summary script it’s only showing this error when using the youtube summary script with URLs
it seems like a URL parsing error with simplerllm
hey hasan how’s it going mate? any chance to fix this error or it’s what it is … thanks
@google-naturemeditation Hello, sorry for the late reply. I just copied and pasted your code on my IDE and it worked perfectly. Did you try creating a virtual environment, then installing simplerllm and run it?
strangest thing @husein let me try again this one will update
@husein yea its working for me too now:) thanks for the suggestion mate
@google-naturemeditation You're welcome my friend!