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

[Attribute Error] : Cannot Load Google API #29165

Open
5 tasks done
Dokterpostds opened this issue Jan 13, 2025 · 0 comments
Open
5 tasks done

[Attribute Error] : Cannot Load Google API #29165

Dokterpostds opened this issue Jan 13, 2025 · 0 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@Dokterpostds
Copy link

Dokterpostds commented Jan 13, 2025

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
### Example Code

google_api_client = GoogleApiClient(credentials_path=Path("D:\Project_Multimedika\automation_youtube\client_secret.json"))


def load_docs(url):
    try:
        
        url = str(url)
        # loader = YoutubeLoader.from_youtube_url(
        #     youtube_url=url, 
        #     add_video_info=False,
        #     language=["id"],
        #     translation = "id"
        # )

        # documents = loader.load()
        
        
        # Use a Channel
        youtube_loader_channel = GoogleApiYoutubeLoader(
            google_api_client=google_api_client,
            channel_name="Dokter Post",
            captions_language="id",
        )

        # Use Youtube Ids

        youtube_loader_ids = GoogleApiYoutubeLoader(
            google_api_client=google_api_client, video_ids=[url], add_video_info=True
        )

        # returns a list of Documents
        documents = youtube_loader_channel.load()
        
        print("documents : ", documents)
        
        if not documents:  # Equivalent to checking if documents is an empty list
            return APIResponse(success=False, message="Tidak bisa menangkap subtitle", data={"summary": "tidak ada summary"})

        return documents
    except Exception as e:
        return APIResponse(success=False, message=f"error : {e}", data={"summary": "terdapat error"})

Error Message and Stack Trace (if applicable)

Screenshot 2025-01-13 093016

Description

I have updated langchain-community, but it is still error. The error is similar with [](#27432)

System Info

langchain-community == 0.3.14
fastapi == 0.115.6
openai == 1.59.3
uvicorn == 0.34.0
youtube-transcript-api == 0.6.3
pytube == 15.0.0
python-dotenv == 1.0.1
langchain-openai == 0.2.14
langchain-text-splitters == 0.3.4
oauthlib==3.2.2
google-api-core==2.24.0
google-api-python-client==2.158.0
google-auth==2.37.0
google-auth-httplib2==0.2.0
google-auth-oauthlib==1.2.1
googleapis-common-protos==1.66.0

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant