# This is final chain that is called.    combine_documents_chain=combine_documents_chain,    # If documents exceed context for `StuffDocumentsChain`    collapse_documents_chain=combine_documents_chain,    # The maximum number of tokens to group documents into.    token_max=4000,)Combining our map and reduce chains into one:# Combining documents by mapping a chain over them, then combining resultsmap_reduce_chain = MapReduceDocumentsChain(    # Map chain    llm_chain=map_chain,    # Reduce chain    reduce_documents_chain=reduce_documents_chain,    # The variable name in the llm_chain to put the documents in    document_variable_name="docs",    # Return the results of the map steps in the output    return_intermediate_steps=False,)text_splitter = CharacterTextSplitter.from_tiktoken_encoder(    chunk_size=1000, chunk_overlap=0)split_docs = text_splitter.split_documents(docs)    Created a chunk of size 1003, which is longer than the specified 1000print(map_reduce_chain.run(split_docs))    Based on the list of documents provided, the main themes can be identified as follows:        1. LLM-powered autonomous agents: The documents discuss the concept of building agents with LLM as their core controller and highlight the potential of LLM beyond generating written content. They explore the capabilities of LLM as a general problem solver.        2. Agent system overview: The documents provide an overview of the components that make up a LLM-powered autonomous agent system, including planning, memory, and tool use. Each component is explained in detail, highlighting its role in enhancing the agent's capabilities.        3. Planning: The documents discuss how the agent breaks down large tasks into smaller subgoals and utilizes self-reflection to improve the quality of its actions and results.        4. Memory: The documents explain the importance of both short-term and long-term memory in an agent system. Short-term memory is utilized for in-context learning, while
Open In Colab
Open In Colab ->: # This is final chain that is called.    combine_documents_chain=combine_documents_chain,    # If documents exceed context for `StuffDocumentsChain`    collapse_documents_chain=combine_documents_chain,    # The maximum number of tokens to group documents into.    token_max=4000,)Combining our map and reduce chains into one:# Combining documents by mapping a chain over them, then combining resultsmap_reduce_chain = MapReduceDocumentsChain(    # Map chain    llm_chain=map_chain,    # Reduce chain    reduce_documents_chain=reduce_documents_chain,    # The variable name in the llm_chain to put the documents in    document_variable_name="docs",    # Return the results of the map steps in the output    return_intermediate_steps=False,)text_splitter = CharacterTextSplitter.from_tiktoken_encoder(    chunk_size=1000, chunk_overlap=0)split_docs = text_splitter.split_documents(docs)    Created a chunk of size 1003, which is longer than the specified 1000print(map_reduce_chain.run(split_docs))    Based on the list of documents provided, the main themes can be identified as follows:        1. LLM-powered autonomous agents: The documents discuss the concept of building agents with LLM as their core controller and highlight the potential of LLM beyond generating written content. They explore the capabilities of LLM as a general problem solver.        2. Agent system overview: The documents provide an overview of the components that make up a LLM-powered autonomous agent system, including planning, memory, and tool use. Each component is explained in detail, highlighting its role in enhancing the agent's capabilities.        3. Planning: The documents discuss how the agent breaks down large tasks into smaller subgoals and utilizes self-reflection to improve the quality of its actions and results.        4. Memory: The documents explain the importance of both short-term and long-term memory in an agent system. Short-term memory is utilized for in-context learning, while