google / generative-ai-docs

Documentation for Google's Gen AI site - including the Gemini API and Gemma
https://ai.google.dev
Apache License 2.0
1.46k stars 494 forks source link

WebBaseLoader data type error #436

Closed atmikshetty closed 1 week ago

atmikshetty commented 1 month ago

Description of the bug:

File where the issue exists: examples/gemini/python/langchain/Gemini_LangChain_Summarization_WebLoad.ipynb

Code Snippet: stuff_chain = (

Extract data from the documents and add to the key text.

{
    "text": lambda docs: "\n\n".join(
        format_document(doc, doc_prompt) for doc in docs
    )
}
| llm_prompt         # Prompt for Gemini
| llm                # Gemini function
| StrOutputParser()  # output parser

)

throws an data type error when accessing the data from the docs.

Actual vs expected behavior:

Actual: The chain does not building since the dict data type is not directly accepted. Expected: The chain should be successfully created.

image

Any other information you'd like to share?

This could be resolved by using a text_splitter. I can make a pr resolving this issue if it's possible. Do reply.

singhniraj08 commented 1 month ago

@atmikshetty, Hi, I don't see any issues running the Langchain example tutorial. Ref: Screenshot below Can you please share the replicate colab gist so that we can reproduce the code on our end. Thank you!

image

github-actions[bot] commented 3 weeks ago

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!