i get this code error: ""chunking) PS C:\Python Projects 2024\chunking> python app.py
#### Character Text Splitting ####
[
    Document(page_content='Text splitting in LangChain is a cr', metadata={'source': 'local'}),
    Document(page_content='itical feature that facilitates the', metadata={'source': 'local'}),
    Document(page_content=' division of large texts into small', metadata={'source': 'local'}),
    Document(page_content='er, manageable segments. ', metadata={'source': 'local'})    
]
(chunking) PS C:\Python Projects 2024\chunking> python app.py
#### Character Text Splitting ####
[
    Document(page_content='Text splitting in LangChain is a cr', metadata={'source': 'local'}),
    Document(page_content='itical feature that facilitates the', metadata={'source': 'local'}),
    Document(page_content=' division of large texts into small', metadata={'source': 'local'}),
    Document(page_content='er, manageable segments. ', metadata={'source': 'local'})
]
[
    Document(page_content='Text splitting in LangChain is a cr'),
    Document(page_content='itical feature that facilitates the'),
    Document(page_content=' division of large texts into small'),
    Document(page_content='er, manageable segments. ')
]
(chunking) PS C:\Python Projects 2024\chunking> python app.py
#### Character Text Splitting ####
[
    Document(page_content='Text splitting in LangChain is a cr', metadata={'source': 'local'}),
    Document(page_content='itical feature that facilitates the', metadata={'source': 'local'}),
    Document(page_content=' division of large texts into small', metadata={'source': 'local'}),
    Document(page_content='er, manageable segments. ', metadata={'source': 'local'})
]
[
    Document(page_content='Text splitting in LangChain is a cr'),
    Document(page_content='itical feature that facilitates the'),
    Document(page_content=' division of large texts into small'),
    Document(page_content='er, manageable segments. ')
]
#### Recursive Character Text Splitting ####
Traceback (most recent call last):
  File "C:\Python Projects 2024\chunking\app.py", line 60, in <module>
    with open('content.txt', 'r', encoding='utf-8') as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'content.txt'
(chunking) PS C:\Python Projects 2024\chunking> python app.py
#### Character Text Splitting ####
[
    Document(page_content='Text splitting in LangChain is a cr', metadata={'source': 'local'}),
    Document(page_content='itical feature that facilitates the', metadata={'source': 'local'}),
    Document(page_content=' division of large texts into small', metadata={'source': 'local'}),
    Document(page_content='er, manageable segments. ', metadata={'source': 'local'})
]
[
    Document(page_content='Text splitting in LangChain is a cr'),
    Document(page_content='itical feature that facilitates the'),
    Document(page_content=' division of large texts into small'),
    Document(page_content='er, manageable segments. ')
]
#### Recursive Character Text Splitting ####
Traceback (most recent call last):
  File "C:\Python Projects 2024\chunking\app.py", line 60, in <module>
    with open('content.txt', 'r', encoding='utf-8') as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'content.txt'
(chunking) PS C:\Python Projects 2024\chunking>
"" 

with this code input: ""from rich import print
from langchain.docstore.document import Document
from langchain_community.chat_models import ChatOllama
from langchain_community.vectorstores import Chroma
from langchain_community import embeddings
from langchain_core.runnables import RunnablePassthrough
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate

local_llm = ChatOllama(model="dolphin.mistral")

# RAG
def rag(chunks, collection_name):
    vectorstore = Chroma.from_documents(
        documents=documents,
        collection_name=collection_name,
        embedding=embeddings.ollama.OllamaEmbeddings(model='nomic-embed-text'),
    )
    retriever = vectorstore.as_retriever()

    prompt_template = """Answer the question based only on the following context:
    {context}
    Question: {question}
    """
    prompt = ChatPromptTemplate.from_template(prompt_template)

    chain = (
        {"context": retriever, "question": RunnablePassthrough()}
        | prompt
        | local_llm
        | StrOutputParser()
    )
    result = chain.invoke("What is the use of Text Splitting?")
    print(result)

    # 1. Character Text Splitting
print("#### Character Text Splitting ####")

text = "Text splitting in LangChain is a critical feature that facilitates the division of large texts into smaller, manageable segments. "

# Manual Splitting
chunks = []
chunk_size = 35 # Characters
for i in range(0, len(text), chunk_size):
    chunk = text[i:i + chunk_size]
    chunks.append(chunk)
documents = [Document(page_content=chunk, metadata={"source": "local"}) for chunk in chunks]
print(documents)

# Automatic Text Splitting
from langchain.text_splitter import CharacterTextSplitter
text_splitter = CharacterTextSplitter(chunk_size = 35, chunk_overlap=0, separator='', strip_whitespace=False)
documents = text_splitter.create_documents([text])
print(documents)

# 2. Recursive Character Text Splitting
print("#### Recursive Character Text Splitting ####")

from langchain.text_splitter import RecursiveCharacterTextSplitter
with open('content.txt', 'r', encoding='utf-8') as file:
    text = file.read()

text_splitter = RecursiveCharacterTextSplitter(chunk_size = 65, chunk_overlap=0) # ["\n\n", "\n", " ", ""] 65,450
print(text_splitter.create_documents([text])) ""