{ "cells": [ { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:32:27.617760Z", "start_time": "2024-10-29T18:32:26.626308Z" } }, "cell_type": "code", "source": [ "from langchain_community.tools import ArxivQueryRun, WikipediaQueryRun\n", "from langchain_community.utilities import ArxivAPIWrapper, WikipediaAPIWrapper" ], "id": "a435d5aeb3924884", "outputs": [], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:32:27.686190Z", "start_time": "2024-10-29T18:32:27.629994Z" } }, "cell_type": "code", "source": [ "wiki_api = WikipediaAPIWrapper(top_k_results=1, max_tokens=500 )\n", "wiki_api = WikipediaQueryRun(api_wrapper=wiki_api)\n", "wiki_api.name" ], "id": "b14caadf6783a38a", "outputs": [ { "data": { "text/plain": [ "'wikipedia'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 2 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:32:27.894026Z", "start_time": "2024-10-29T18:32:27.850869Z" } }, "cell_type": "code", "source": [ "arxiv_api = ArxivAPIWrapper(top_k_results=1, max_tokens=500 )\n", "arxiv_api = ArxivQueryRun(api_wrapper=arxiv_api)\n", "arxiv_api.name" ], "id": "26841fb3cc762f14", "outputs": [ { "data": { "text/plain": [ "'arxiv'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 3 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:32:33.606669Z", "start_time": "2024-10-29T18:32:33.591504Z" } }, "cell_type": "code", "source": "tools = [wiki_api, arxiv_api]", "id": "41a663232fd8c090", "outputs": [], "execution_count": 4 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:33:57.464755Z", "start_time": "2024-10-29T18:33:57.442645Z" } }, "cell_type": "code", "source": [ "## Custom tool\n", "from langchain.document_loaders import WebBaseLoader\n", "from langchain.vectorstores import FAISS\n", "from langchain.text_splitter import RecursiveCharacterTextSplitter\n", "from langchain_groq import ChatGroq\n", "from langchain_huggingface import HuggingFaceEmbeddings\n", "from dotenv import load_dotenv\n", "load_dotenv()" ], "id": "ae3e6152572b015a", "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 9 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:34:05.220937Z", "start_time": "2024-10-29T18:33:59.455568Z" } }, "cell_type": "code", "source": [ "webloader = WebBaseLoader(\"https://jalammar.github.io/illustrated-transformer/\")\n", "docs = webloader.load()\n", "splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)\n", "document = splitter.split_documents(docs)\n", "vectorstore = FAISS.from_documents(document, HuggingFaceEmbeddings())\n", "retriever = vectorstore.as_retriever()" ], "id": "d0c2eabc73039a74", "outputs": [], "execution_count": 10 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:33:24.573845Z", "start_time": "2024-10-29T18:33:24.556040Z" } }, "cell_type": "code", "source": [ "from langchain.tools.retriever import create_retriever_tool\n", "retriever_tool = create_retriever_tool(retriever, \"Transformer Study\", \"Search anything about Transformers\")" ], "id": "11679e0bd4ca5d42", "outputs": [], "execution_count": 7 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:34:06.409793Z", "start_time": "2024-10-29T18:34:05.908259Z" } }, "cell_type": "code", "source": [ "tools = [wiki_api, arxiv_api, retriever_tool]\n", "model = ChatGroq(model=\"Gemma2-9B-It\")" ], "id": "cf0ab84b67702818", "outputs": [], "execution_count": 11 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:38:51.485068Z", "start_time": "2024-10-29T18:38:50.500300Z" } }, "cell_type": "code", "source": [ "from langchain import hub\n", "prompt = hub.pull(\"hwchase17/openai-functions-agent\")\n", "prompt.messages" ], "id": "e831cdeb54d5f34", "outputs": [ { "data": { "text/plain": [ "[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], input_types={}, partial_variables={}, template='You are a helpful assistant'), additional_kwargs={}),\n", " MessagesPlaceholder(variable_name='chat_history', optional=True),\n", " HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['input'], input_types={}, partial_variables={}, template='{input}'), additional_kwargs={}),\n", " MessagesPlaceholder(variable_name='agent_scratchpad')]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 14 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T18:34:20.708077Z", "start_time": "2024-10-29T18:34:20.437439Z" } }, "cell_type": "code", "source": [ "from langchain.agents import create_openai_tools_agent\n", "agent = create_openai_tools_agent(model, tools, prompt)" ], "id": "53dd0b6d56abefde", "outputs": [], "execution_count": 13 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T20:42:26.355456Z", "start_time": "2024-10-29T20:42:26.330918Z" } }, "cell_type": "code", "source": [ "from langchain.agents import AgentExecutor\n", "agent_exe = AgentExecutor(agent = agent,tools = tools, verbose = True)\n", "agent_exe" ], "id": "cbbab60dac13e8d9", "outputs": [ { "data": { "text/plain": [ "AgentExecutor(verbose=True, agent=RunnableMultiActionAgent(runnable=RunnableAssign(mapper={\n", " agent_scratchpad: RunnableLambda(lambda x: format_to_openai_tool_messages(x['intermediate_steps']))\n", "})\n", "| ChatPromptTemplate(input_variables=['agent_scratchpad', 'input'], optional_variables=['chat_history'], input_types={'chat_history': list[typing.Annotated[typing.Union[typing.Annotated[langchain_core.messages.ai.AIMessage, Tag(tag='ai')], typing.Annotated[langchain_core.messages.human.HumanMessage, Tag(tag='human')], typing.Annotated[langchain_core.messages.chat.ChatMessage, Tag(tag='chat')], typing.Annotated[langchain_core.messages.system.SystemMessage, Tag(tag='system')], typing.Annotated[langchain_core.messages.function.FunctionMessage, Tag(tag='function')], typing.Annotated[langchain_core.messages.tool.ToolMessage, Tag(tag='tool')], typing.Annotated[langchain_core.messages.ai.AIMessageChunk, Tag(tag='AIMessageChunk')], typing.Annotated[langchain_core.messages.human.HumanMessageChunk, Tag(tag='HumanMessageChunk')], typing.Annotated[langchain_core.messages.chat.ChatMessageChunk, Tag(tag='ChatMessageChunk')], typing.Annotated[langchain_core.messages.system.SystemMessageChunk, Tag(tag='SystemMessageChunk')], typing.Annotated[langchain_core.messages.function.FunctionMessageChunk, Tag(tag='FunctionMessageChunk')], typing.Annotated[langchain_core.messages.tool.ToolMessageChunk, Tag(tag='ToolMessageChunk')]], FieldInfo(annotation=NoneType, required=True, discriminator=Discriminator(discriminator=, custom_error_type=None, custom_error_message=None, custom_error_context=None))]], 'agent_scratchpad': list[typing.Annotated[typing.Union[typing.Annotated[langchain_core.messages.ai.AIMessage, Tag(tag='ai')], typing.Annotated[langchain_core.messages.human.HumanMessage, Tag(tag='human')], typing.Annotated[langchain_core.messages.chat.ChatMessage, Tag(tag='chat')], typing.Annotated[langchain_core.messages.system.SystemMessage, Tag(tag='system')], typing.Annotated[langchain_core.messages.function.FunctionMessage, Tag(tag='function')], typing.Annotated[langchain_core.messages.tool.ToolMessage, Tag(tag='tool')], typing.Annotated[langchain_core.messages.ai.AIMessageChunk, Tag(tag='AIMessageChunk')], typing.Annotated[langchain_core.messages.human.HumanMessageChunk, Tag(tag='HumanMessageChunk')], typing.Annotated[langchain_core.messages.chat.ChatMessageChunk, Tag(tag='ChatMessageChunk')], typing.Annotated[langchain_core.messages.system.SystemMessageChunk, Tag(tag='SystemMessageChunk')], typing.Annotated[langchain_core.messages.function.FunctionMessageChunk, Tag(tag='FunctionMessageChunk')], typing.Annotated[langchain_core.messages.tool.ToolMessageChunk, Tag(tag='ToolMessageChunk')]], FieldInfo(annotation=NoneType, required=True, discriminator=Discriminator(discriminator=, custom_error_type=None, custom_error_message=None, custom_error_context=None))]]}, partial_variables={'chat_history': []}, metadata={'lc_hub_owner': 'hwchase17', 'lc_hub_repo': 'openai-functions-agent', 'lc_hub_commit_hash': 'a1655024b06afbd95d17449f21316291e0726f13dcfaf990cc0d18087ad689a5'}, messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], input_types={}, partial_variables={}, template='You are a helpful assistant'), additional_kwargs={}), MessagesPlaceholder(variable_name='chat_history', optional=True), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['input'], input_types={}, partial_variables={}, template='{input}'), additional_kwargs={}), MessagesPlaceholder(variable_name='agent_scratchpad')])\n", "| RunnableBinding(bound=ChatGroq(client=, async_client=, model_name='Gemma2-9B-It', model_kwargs={}, groq_api_key=SecretStr('**********')), kwargs={'tools': [{'type': 'function', 'function': {'name': 'wikipedia', 'description': 'A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.', 'parameters': {'properties': {'query': {'description': 'query to look up on wikipedia', 'type': 'string'}}, 'required': ['query'], 'type': 'object'}}}, {'type': 'function', 'function': {'name': 'arxiv', 'description': 'A wrapper around Arxiv.org Useful for when you need to answer questions about Physics, Mathematics, Computer Science, Quantitative Biology, Quantitative Finance, Statistics, Electrical Engineering, and Economics from scientific articles on arxiv.org. Input should be a search query.', 'parameters': {'properties': {'query': {'description': 'search query to look up', 'type': 'string'}}, 'required': ['query'], 'type': 'object'}}}, {'type': 'function', 'function': {'name': 'Transformer Study', 'description': 'Search anything about Transformers', 'parameters': {'properties': {'query': {'description': 'query to look up in retriever', 'type': 'string'}}, 'required': ['query'], 'type': 'object'}}}]}, config={}, config_factories=[])\n", "| OpenAIToolsAgentOutputParser(), input_keys_arg=[], return_keys_arg=[], stream_runnable=True), tools=[WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper(wiki_client=, top_k_results=1, lang='en', load_all_available_meta=False, doc_content_chars_max=4000)), ArxivQueryRun(api_wrapper=ArxivAPIWrapper(arxiv_search=, arxiv_exceptions=(, , ), top_k_results=1, ARXIV_MAX_QUERY_LENGTH=300, continue_on_failure=False, load_max_docs=100, load_all_available_meta=False, doc_content_chars_max=4000)), Tool(name='Transformer Study', description='Search anything about Transformers', args_schema=, func=functools.partial(, retriever=VectorStoreRetriever(tags=['FAISS', 'HuggingFaceEmbeddings'], vectorstore=, search_kwargs={}), document_prompt=PromptTemplate(input_variables=['page_content'], input_types={}, partial_variables={}, template='{page_content}'), document_separator='\\n\\n'), coroutine=functools.partial(, retriever=VectorStoreRetriever(tags=['FAISS', 'HuggingFaceEmbeddings'], vectorstore=, search_kwargs={}), document_prompt=PromptTemplate(input_variables=['page_content'], input_types={}, partial_variables={}, template='{page_content}'), document_separator='\\n\\n'))])" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 16 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T20:45:17.698060Z", "start_time": "2024-10-29T20:45:16.439652Z" } }, "cell_type": "code", "source": "response = agent_exe.invoke({\"input\" : \"Tell me about transformer\"})", "id": "51163b1023b7f93f", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", "\u001B[32;1m\u001B[1;3m\n", "Invoking: `Transformer Study` with `{'query': 'transformer'}`\n", "\n", "\n", "\u001B[0m\u001B[38;5;200m\u001B[1;3mAcknowledgements\n", "Thanks to Illia Polosukhin, Jakob Uszkoreit, Llion Jones , Lukasz Kaiser, Niki Parmar, and Noam Shazeer for providing feedback on earlier versions of this post.\n", "Please hit me up on Twitter for any corrections or feedback.\n", "\n", "\n", " Written on June 27, 2018\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "Subscribe to get notified about upcoming posts by email\n", "\n", "Email Address \n", "\n", "\n", "\n", "\n", "\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.\n", "\n", "\n", "Attribution example:\n", "\n", "Alammar, J (2018). The Illustrated Transformer [Blog post]. Retrieved from https://jalammar.github.io/illustrated-transformer/\n", "\n", "Note: If you translate any of the posts, let me know so I can link your translation to the original post. My email is in the about page.\n", "\n", "Go Forth And Transform\n", "I hope you’ve found this a useful place to start to break the ice with the major concepts of the Transformer. If you want to go deeper, I’d suggest these next steps:\n", "\n", "The Transformer was proposed in the paper Attention is All You Need. A TensorFlow implementation of it is available as a part of the Tensor2Tensor package. Harvard’s NLP group created a guide annotating the paper with PyTorch implementation. In this post, we will attempt to oversimplify things a bit and introduce the concepts one by one to hopefully make it easier to understand to people without in-depth knowledge of the subject matter.\n", "2020 Update: I’ve created a “Narrated Transformer” video which is a gentler approach to the topic:\n", "\n", "The Illustrated Transformer – Jay Alammar – Visualizing machine learning one concept at a time.\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "Jay Alammar\n", "Visualizing machine learning one concept at a time.@JayAlammar on Twitter. YouTube Channel\n", "\n", "\n", "Blog\n", "About\n", "\n", "\n", "\n", "\n", "\n", "\n", "The Illustrated Transformer\n", "\n", "Discussions:\n", "Hacker News (65 points, 4 comments), Reddit r/MachineLearning (29 points, 3 comments)\n", "\n", "\n", "Translations: Arabic, Chinese (Simplified) 1, Chinese (Simplified) 2, French 1, French 2, Italian, Japanese, Korean, Persian, Russian, Spanish 1, Spanish 2, Vietnamese\n", "\n", "Watch: MIT’s Deep Learning State of the Art lecture referencing this post\u001B[0m\u001B[32;1m\u001B[1;3mThe Illustrated Transformer is a blog post by Jay Alammar that visualizes and explains the concepts of the Transformer model. \n", "\n", "\n", "\u001B[0m\n", "\n", "\u001B[1m> Finished chain.\u001B[0m\n" ] } ], "execution_count": 18 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T20:45:26.188517Z", "start_time": "2024-10-29T20:45:26.180377Z" } }, "cell_type": "code", "source": "response", "id": "c6013c6493022641", "outputs": [ { "data": { "text/plain": [ "{'input': 'Tell me about transformer',\n", " 'output': 'The Illustrated Transformer is a blog post by Jay Alammar that visualizes and explains the concepts of the Transformer model. \\n\\n\\n'}" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 19 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T20:47:43.485054Z", "start_time": "2024-10-29T20:47:40.665170Z" } }, "cell_type": "code", "source": "response = agent_exe.invoke({\"input\" : \"Tell me about Suchitra Sen\"})", "id": "25f808c54136151c", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", "\u001B[32;1m\u001B[1;3m\n", "Invoking: `wikipedia` with `{'query': 'Suchitra Sen'}`\n", "\n", "\n", "\u001B[0m\u001B[36;1m\u001B[1;3mPage: Suchitra Sen\n", "Summary: Suchitra Sen (Bengali: [ʃuˈt͡ʃitːra ˈʃen] ; born Roma Dasgupta, Bengali: [ˈrɔma ˈdaʃɡupto] ; 6 April 1931 – 17 January 2014), widely known as the Mahanayika (lit. 'Great actress'), was an Indian actress who worked in Bengali and Hindi cinema. The movies in which she was paired opposite Uttam Kumar became classics in the history of Bengali cinema.\n", "Sen was the first Indian actress to receive an award at an international film festival when, at the 1963 Moscow International Film Festival, she won the Silver Prize for Best Actress for Saat Pake Bandha. She was catapulted to stardom after she was cast as Vishnupriya by Devaki Kumar Bose in his Bhagaban Shree Krishna Chaitanya (1953).\n", "In 1972, she was awarded the Padma Shri, the fourth highest civilian award in India. From 1979 on, she retreated from public life and shunned all forms of public contact; for this she is often compared to Greta Garbo. In 2005, she refused the Dadasaheb Phalke Award, the highest cinematic award in India, to stay out of the public eye. In 2012, she was conferred the West Bengal Government's highest honour: Banga Bibhushan. Her first official release was Sukumar Dasgupta's Saat Number Kayedi (1953).\n", "\n", "\u001B[0m\u001B[32;1m\u001B[1;3mSuchitra Sen was a renowned Indian actress known for her work in Bengali and Hindi cinema. She is often referred to as the \"Mahanayika\" (Great actress). \n", "\u001B[0m\n", "\n", "\u001B[1m> Finished chain.\u001B[0m\n" ] } ], "execution_count": 21 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T20:48:10.067023Z", "start_time": "2024-10-29T20:48:10.060333Z" } }, "cell_type": "code", "source": "response", "id": "187d9800533a7307", "outputs": [ { "data": { "text/plain": [ "{'input': 'Tell me about Suchitra Sen',\n", " 'output': 'Suchitra Sen was a renowned Indian actress known for her work in Bengali and Hindi cinema. She is often referred to as the \"Mahanayika\" (Great actress). \\n'}" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 22 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T20:49:16.523064Z", "start_time": "2024-10-29T20:49:13.246455Z" } }, "cell_type": "code", "source": "response = agent_exe.invoke({\"input\" : \"Tell me about llama index ?\"})", "id": "a6bb37f59ca20c9b", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", "\u001B[32;1m\u001B[1;3m\n", "Invoking: `wikipedia` with `{'query': 'Llama Index'}`\n", "\n", "\n", "\u001B[0m\u001B[36;1m\u001B[1;3mPage: Vector database\n", "Summary: A vector database, vector store or vector search engine is a database that can store vectors (fixed-length lists of numbers) along with other data items. Vector databases typically implement one or more Approximate Nearest Neighbor algorithms, so that one can search the database with a query vector to retrieve the closest matching database records.\n", "Vectors are mathematical representations of data in a high-dimensional space. In this space, each dimension corresponds to a feature of the data, with the number of dimensions ranging from a few hundred to tens of thousands, depending on the complexity of the data being represented. A vector's position in this space represents its characteristics. Words, phrases, or entire documents, as well as images, audio, and other types of data, can all be vectorized.\n", "These feature vectors may be computed from the raw data using machine learning methods such as feature extraction algorithms, word embeddings or deep learning networks. The goal is that semantically similar data items receive feature vectors close to each other.\n", "Vector databases can be used for similarity search, semantic search, multi-modal search, recommendations engines, large language models (LLMs), object detection, etc.\n", "Vector databases are also often used to implement retrieval-augmented generation (RAG), a method to improve domain-specific responses of large language models. The retrieval component of a RAG can be any search system, but is most often implemented as a vector database. Text documents describing the domain of interest are collected, and for each document or document section, a feature vector (known as an \"embedding\") is computed, typically using a deep learning network, and stored in a vector database. Given a user prompt, the feature vector of the prompt is computed, and the database is queried to retrieve the most relevant documents. These are then automatically added into the context window of the large language model, and the large language model proceeds to create a response to the prompt given this context.\u001B[0m\u001B[32;1m\u001B[1;3mLlama Index is an open-source framework that makes it easy to build applications powered by large language models (LLMs). \n", "\n", "It simplifies the process of connecting LLMs to your own data, allowing them to access and understand information specific to your needs.\n", "\n", "Think of Llama Index as a bridge between your data and powerful LLMs like those from OpenAI or Google. \n", "\n", "\n", "\n", "It's designed to make working with LLMs more practical and accessible, especially for tasks like:\n", "\n", "* **Question Answering:** Build systems that can answer questions based on your own documents or datasets.\n", "* **Summarization:** Generate concise summaries of large amounts of text.\n", "* **Code Generation:** Use LLMs to assist in writing and understanding code.\n", "* **Data Analysis:** Leverage LLMs to uncover insights and patterns in your data.\n", "\n", "\n", "\n", "Llama Index achieves this by:\n", "\n", "* **Indexing your data:** It transforms your data (text, code, PDFs, etc.) into a format that LLMs can understand.\n", "* **Providing efficient search:** It allows you to quickly retrieve relevant information from your indexed data.\n", "* **Integrating with LLMs:** It seamlessly connects your data to various LLMs, enabling powerful applications.\n", "\n", "\n", "\n", "Essentially, Llama Index empowers you to harness the capabilities of LLMs for a wide range of tasks while keeping your data secure and under your control.\n", "\u001B[0m\n", "\n", "\u001B[1m> Finished chain.\u001B[0m\n" ] } ], "execution_count": 23 }, { "metadata": { "ExecuteTime": { "end_time": "2024-10-29T20:49:23.177361Z", "start_time": "2024-10-29T20:49:23.170856Z" } }, "cell_type": "code", "source": "response", "id": "eda4ef8e765d9781", "outputs": [ { "data": { "text/plain": [ "{'input': 'Tell me about llama index ?',\n", " 'output': \"Llama Index is an open-source framework that makes it easy to build applications powered by large language models (LLMs). \\n\\nIt simplifies the process of connecting LLMs to your own data, allowing them to access and understand information specific to your needs.\\n\\nThink of Llama Index as a bridge between your data and powerful LLMs like those from OpenAI or Google. \\n\\n\\n\\nIt's designed to make working with LLMs more practical and accessible, especially for tasks like:\\n\\n* **Question Answering:** Build systems that can answer questions based on your own documents or datasets.\\n* **Summarization:** Generate concise summaries of large amounts of text.\\n* **Code Generation:** Use LLMs to assist in writing and understanding code.\\n* **Data Analysis:** Leverage LLMs to uncover insights and patterns in your data.\\n\\n\\n\\nLlama Index achieves this by:\\n\\n* **Indexing your data:** It transforms your data (text, code, PDFs, etc.) into a format that LLMs can understand.\\n* **Providing efficient search:** It allows you to quickly retrieve relevant information from your indexed data.\\n* **Integrating with LLMs:** It seamlessly connects your data to various LLMs, enabling powerful applications.\\n\\n\\n\\nEssentially, Llama Index empowers you to harness the capabilities of LLMs for a wide range of tasks while keeping your data secure and under your control.\\n\"}" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 24 }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": "", "id": "6619ae4fd40179df" } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }