Replies: 2 comments 1 reply
-
Hey there, @kolyan288! I'm here to help you with your bug, answer questions, and guide you to become a contributor. Let's tackle this together while waiting for a human maintainer. To fix the You can use the Here is an example of how you can use the from langchain_core.utils.json import parse_partial_json
# Assuming `json_string` is the string you are trying to parse
json_string = '...' # Replace with your actual JSON string
try:
parsed_json = parse_partial_json(json_string)
if parsed_json is None:
raise ValueError("Failed to parse JSON string.")
# Proceed with using `parsed_json`
except json.JSONDecodeError as e:
print(f"JSON decoding failed: {e}")
# Handle the error, e.g., log it or raise an exception Make sure to replace Additionally, ensure that the documents are correctly formatted and that the from langchain_community.vectorstores.chroma import Chroma
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_core.documents import Document
# Load and split documents
loader = WebBaseLoader("https://lilianweng.github.io/posts/2023-06-23-agent/")
data = loader.load()
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=0)
all_splits = text_splitter.split_documents(data)
# Create a Chroma vectorstore from the split documents
vectorstore = Chroma.from_documents(
documents=all_splits,
collection_name="rag-private",
embedding=embd,
)
retriever = vectorstore.as_retriever() Ensure that the |
Beta Was this translation helpful? Give feedback.
-
Hi, I am also from Russia and I had the same problem. The issue was that I had a Russian mail attached to the cohere account and my API key was not working no matter the environment. I solved this issue by creating a new account in cohere by signing in with google with my gmail attached to it. Now it works, but only with a VPN or on Google Colab. |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
I tried to run the code from the RAG LangGraph examples, but it throws an exception, although I did not change it in any way. How to fix the error?
System Info
langchain==0.2.1
langchain-chroma==0.1.1
langchain-cli==0.0.24
langchain-cohere==0.1.8
langchain-community==0.2.1
langchain-core==0.2.3
langchain-experimental==0.0.59
langchain-huggingface==0.0.1
langchain-openai==0.1.8
langchain-text-splitters==0.2.0
platform: linux mint 21.1
python version: 3.10.14
Beta Was this translation helpful? Give feedback.
All reactions