Skip to content

Forum in maintenance, we will back soon 🙂

SimplerLLM - Load c...
 
Notifications
Clear all

SimplerLLM - Load content libraries issue Youtube summary tool not able to pull URLs

16 Posts
3 Users
3 Reactions
124 Views
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

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.

 

Screenshot 2024 08 07 at 12.51.23 AM

 

Screenshot 2024 08 07 at 12.50.33 AM
 
Posted : 08/06/2024 7:38 pm
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

hi hasan

kindly check on this when you’re open, am trying to make this script work with load_content @simplerllm 

 
Posted : 08/06/2024 9:27 pm
(@husein)
Posts: 534
Member Moderator
 

@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.

 
Posted : 08/07/2024 8:23 am
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 
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}")
 
Posted : 08/07/2024 8:37 am
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

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)>

 
Posted : 08/07/2024 8:40 am
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

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

 
Posted : 08/07/2024 8:51 am
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

here load_content function with simplerllm works for text output but not for youtube videos urls 

 
Posted : 08/07/2024 2:31 pm
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

anyluck with this request mate?

 
Posted : 08/08/2024 10:58 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@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.

This post was modified 4 months ago by SSAdvisor

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 08/08/2024 11:48 am
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

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 

 
Posted : 08/08/2024 12:43 pm
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

it seems like a URL parsing error with simplerllm 

 
Posted : 08/08/2024 12:47 pm
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

hey hasan how’s it going mate? any chance to fix this error or it’s what it is … thanks 

 
Posted : 08/09/2024 7:57 am
(@husein)
Posts: 534
Member Moderator
 

@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?

 
Posted : 08/09/2024 5:10 pm
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

strangest thing @husein let me try again this one will update 

 
Posted : 08/09/2024 6:21 pm
(@google-naturemeditation)
Posts: 25
Eminent Member
Topic starter
 

@husein yea its working for me too now:) thanks for the suggestion mate

 
Posted : 08/09/2024 6:25 pm
(@husein)
Posts: 534
Member Moderator
 

@google-naturemeditation You're welcome my friend!

 
Posted : 08/10/2024 8:51 am
Share: