prompt
stringlengths
70
19.8k
completion
stringlengths
8
1.03k
api
stringlengths
23
93
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-indices-managed-colbert') get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-qdrant') get_ipython().run_line_magic('pip', 'install llama-index-llms-gemini') get_ipython().r...
SimpleDirectoryReader("./data/paul_graham/")
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-output-parsers-guardrails') get_ipython().system('pip install guardrails-ai') get_ipython().system("mkdir -p 'data/paul_graham/'") get_ipython().system("wget 'https://raw.githubuserconten...
VectorStoreIndex.from_documents(documents, chunk_size=512)
llama_index.core.VectorStoreIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-readers-wikipedia') get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-finetuning-callbacks') get_ipython().run_line...
VectorStoreIndex.from_documents(documents=train_documents)
llama_index.core.VectorStoreIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-program-openai') get_ipython().run_line_magic('pip', 'install llama-index-llms-llama-api') get_ipython().system('pip install llama-index') from llama_index.llms.llama_api import LlamaAPI api_key = "LL-your-key" llm = LlamaAPI(api_key=api_key) resp = l...
to_openai_function(Song)
llama_index.core.llms.openai_utils.to_openai_function
get_ipython().run_line_magic('pip', 'install llama-index-llms-anthropic') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') get_ipython().system("mkdir -p 'data/paul_graham/'") get_ipython().system("wget 'https://raw.githubusercontent.com/run-lla...
Anthropic()
llama_index.llms.anthropic.Anthropic
get_ipython().run_line_magic('pip', 'install llama-index-postprocessor-cohere-rerank') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().run_line_magic('pip', 'install llama-index-embeddings-cohere') get_ipython()...
SimpleNodeParser.from_defaults(chunk_size=400)
llama_index.core.node_parser.SimpleNodeParser.from_defaults
get_ipython().run_line_magic('pip', 'install llama-index-llms-openllm') get_ipython().system('pip install "openllm" # use \'openllm[vllm]\' if you have access to GPU') get_ipython().system('pip install llama-index') import os from typing import List, Optional from llama_index.llms.openllm import OpenLLM, Open...
ChatMessage(role="assistant", content="Yes?")
llama_index.core.llms.ChatMessage
get_ipython().run_line_magic('pip', 'install llama-index-embeddings-openai') get_ipython().run_line_magic('pip', 'install llama-index-postprocessor-cohere-rerank') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') import phoenix as px px.launch_app() import llama_index.core llama_index.core.set...
PydanticOutputParser(Movies)
llama_index.core.output_parsers.PydanticOutputParser
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-hub-llama-packs-tables-chain-of-table-base') get_ipython().system('wget "https://github.com/ppasupat/WikiTableQuestions/releases/download/v1.0.2/WikiTableQuestions-1.0.2-compact.zip" -O data.zip')...
PromptTemplate(prompt_str)
llama_index.core.PromptTemplate
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') import os import openai os.environ["OPENAI_API_KEY"] = "sk-.." openai.api_key = os.environ["OPENAI_API_KEY"] from IPython.display import Markdown, display from sqlalchemy import ( cre...
RetrieverQueryEngine.from_args(nl_sql_retriever)
llama_index.core.query_engine.RetrieverQueryEngine.from_args
get_ipython().run_line_magic('pip', 'install llama-index-readers-make-com') get_ipython().system('pip install llama-index') import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout)) from llama_index.core import Ve...
MakeWrapper()
llama_index.readers.make_com.MakeWrapper
get_ipython().run_line_magic('pip', 'install llama-index-embeddings-openai') get_ipython().run_line_magic('pip', 'install llama-index-readers-file') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') import camelot from llama_index.core import VectorStoreIndex from llama_index.core.query_engine i...
Settings.node_parser.get_nodes_from_documents(docs)
llama_index.core.Settings.node_parser.get_nodes_from_documents
get_ipython().run_line_magic('pip', 'install llama-index-agent-openai') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') from llama_index.core import ( SimpleDirectoryReader, VectorStoreIndex, StorageContext, load_index_from_stor...
OpenAI(model="gpt-4-1106-preview")
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install llama-index-storage-docstore-redis') get_ipython().run_line_magic('pip', 'install llama-index-storage-docstore-mongodb') get_ipython().run_line_magic('pip', 'install llama-index-embeddings-huggingface') get_ipython().system('mkdir -p data') get_ipython().system('echo "This...
HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
llama_index.embeddings.huggingface.HuggingFaceEmbedding
get_ipython().run_line_magic('pip', 'install llama-index-agent-openai-legacy') get_ipython().system('pip install llama-index') import json from typing import Sequence from llama_index.core.tools import BaseTool, FunctionTool def multiply(a: int, b: int) -> int: """Multiply two integers and returns the resul...
FunctionTool.from_defaults(fn=add, name="add")
llama_index.core.tools.FunctionTool.from_defaults
get_ipython().run_line_magic('pip', 'install llama-index-llms-gemini') get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-google') get_ipython().run_line_magic('pip', 'install llama-index-indices-managed-google') get_ipython().run_line_magic('pip', 'install llama-index-response-synthesizers-google')...
TransformQueryEngine(base_query_engine, hyde)
llama_index.core.query_engine.TransformQueryEngine
get_ipython().system('pip install llama-index llama-index-packs-raptor llama-index-vector-stores-qdrant') from llama_index.packs.raptor import RaptorPack get_ipython().system('wget https://arxiv.org/pdf/2401.18059.pdf -O ./raptor_paper.pdf') import os os.environ["OPENAI_API_KEY"] = "sk-..." import nest_async...
SimpleDirectoryReader(input_files=["./raptor_paper.pdf"])
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system("wget 'https://raw.githubusercontent.com/run-llama/llama_index/main/docs/examples/data/paul_graham/paul_graham_essay.txt' -O 'data/paul_graham/paul_graham_essay.txt' -O pg_essay.txt") from llama_index.core import SimpleDirec...
SummaryIndex.from_documents(documents)
llama_index.core.SummaryIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-storage-docstore-dynamodb') get_ipython().run_line_magic('pip', 'install llama-index-storage-index-store-dynamodb') get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-dynamodb') get_ipython().run_line_magic('pip', 'install llama-index-llms-ope...
DynamoDBDocumentStore.from_table_name(table_name=TABLE_NAME)
llama_index.storage.docstore.dynamodb.DynamoDBDocumentStore.from_table_name
get_ipython().run_line_magic('pip', 'install llama-index-agent-openai-legacy') get_ipython().system('pip install llama-index') import json from typing import Sequence from llama_index.core import ( SimpleDirectoryReader, VectorStoreIndex, StorageContext, load_index_from_storage, ) from llama_index....
VectorStoreIndex.from_documents(june_docs)
llama_index.core.VectorStoreIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-pinecone') get_ipython().run_line_magic('pip', 'install llama-index-readers-wikipedia') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') import openai import os os.environ["OPENAI_API_KEY"] = "[You API key]" get_ipython(...
VectorStoreIndex([], storage_context=storage_context)
llama_index.core.VectorStoreIndex
get_ipython().run_line_magic('pip', 'install llama-index-llms-rungpt') get_ipython().system('pip install llama-index') get_ipython().system('pip install rungpt') get_ipython().system('rungpt serve decapoda-research/llama-7b-hf --precision fp16 --device_map balanced') from llama_index.llms.rungpt import RunGp...
RunGptLLM()
llama_index.llms.rungpt.RunGptLLM
get_ipython().run_line_magic('', 'pip install llama-index-llms-groq') get_ipython().system('pip install llama-index') from llama_index.llms.groq import Groq llm = Groq(model="mixtral-8x7b-32768", api_key="your_api_key") response = llm.complete("Explain the importance of low latency LLMs") print(response) ...
ChatMessage(role="user", content="What is your name")
llama_index.core.llms.ChatMessage
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-weaviate') get_ipython().system('pip install llama-index') import os import openai os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY_HERE" openai.api_key = os.environ["OPENAI_API_KEY"] import logging import sys logging.basicConfig(stream=sys.std...
VectorStoreIndex.from_vector_store(vector_store)
llama_index.core.VectorStoreIndex.from_vector_store
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-pinecone') get_ipython().run_line_magic('pip', 'install llama-index-readers-wikipedia') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') import openai import os os.environ["OPENAI_API_KEY"] = "[You API key]" get_ipython(...
Settings.node_parser.get_nodes_from_documents([wiki_doc])
llama_index.core.Settings.node_parser.get_nodes_from_documents
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') from llama_index.llms.openai import OpenAI resp = OpenAI().complete("Paul Graham is ") print(resp) from llama_index.core.llms import ChatMessage from llama_index.llms.openai import OpenAI ...
OpenAI()
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install llama-index-readers-file') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('mkdir data') get_ipython().system('wget --user-agent "Mozilla" "https://arxiv.org/pdf/2307.09288.pdf" -O "data/llama2.pdf"') from pathlib import Path f...
ChatMessage(role=MessageRole.SYSTEM, content=CORRECTNESS_SYS_TMPL)
llama_index.core.llms.ChatMessage
get_ipython().run_line_magic('pip', 'install llama-index-readers-file') import os os.environ["OPENAI_API_KEY"] = "sk-..." get_ipython().system("mkdir -p 'data/'") get_ipython().system("curl 'https://arxiv.org/pdf/2307.09288.pdf' -o 'data/llama2.pdf'") get_ipython().system('pip install unstructured[pdf]') from ...
download_llama_pack("FuzzyCitationEnginePack", "./fuzzy_pack")
llama_index.core.llama_pack.download_llama_pack
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') get_ipython().system("mkdir -p 'data/paul_graham/'") get_ipython().system("wget 'https://raw.githubusercontent.com/run-llama/llama_index/main/docs/examples/data/paul_graham/paul_graham_essay.txt' ...
OpenAI(temperature=0, model="gpt-4")
llama_index.llms.openai.OpenAI
get_ipython().system('pip install llama-index') import os import openai os.environ["OPENAI_API_KEY"] = "sk-..." openai.api_key = os.environ["OPENAI_API_KEY"] import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout...
PromptTemplate(new_summary_tmpl_str)
llama_index.core.PromptTemplate
import os os.environ["OPENAI_API_KEY"] = "sk-..." from llama_index.core import VectorStoreIndex, SimpleDirectoryReader from llama_index.core.postprocessor import ( FixedRecencyPostprocessor, EmbeddingRecencyPostprocessor, ) from llama_index.core.node_parser import SentenceSplitter from llama_index.core.stora...
VectorStoreIndex(nodes, storage_context=storage_context)
llama_index.core.VectorStoreIndex
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') qa_prompt_str = ( "Context information is below.\n" "---------------------\n" "{context_str}\n" "---------------------\n" "Given the context information and not prior knowledge...
SimpleDirectoryReader("./data/paul_graham/")
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-llms-portkey') get_ipython().system('pip install llama-index') get_ipython().system('pip install -U llama_index') get_ipython().system('pip install -U portkey-ai') from llama_index.llms.portkey import Portkey from llama_index.core.llms import ChatMessage imp...
ChatMessage(role="user", content="What can you do?")
llama_index.core.llms.ChatMessage
get_ipython().run_line_magic('pip', 'install llama-index-llms-gemini') get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-google') get_ipython().run_line_magic('pip', 'install llama-index-indices-managed-google') get_ipython().run_line_magic('pip', 'install llama-index-response-synthesizers-google')...
GoogleVectorStore.from_corpus(corpus_id=SESSION_CORPUS_ID)
llama_index.vector_stores.google.GoogleVectorStore.from_corpus
get_ipython().run_line_magic('pip', 'install llama-index-postprocessor-rankgpt-rerank') get_ipython().run_line_magic('pip', 'install llama-index-llms-huggingface') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-llms-ollama') import nest_...
OpenAI(temperature=0, model="gpt-3.5-turbo")
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install llama-index-embeddings-jinaai') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') get_ipython().system('pip install Pillow') import os jinaai_api_key = "YOUR_JINAAI_API_KEY" os.environ["JINAAI_API_...
OpenAI(api_key=your_openai_key)
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().run_line_magic('pip', 'install llama-index-finetuning-callbacks') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') from llama_index.core import ( SimpleDirectoryReader, VectorStoreIndex, StorageContex...
load_index_from_storage(storage_context)
llama_index.core.load_index_from_storage
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-pinecone') get_ipython().run_line_magic('pip', 'install llama-index-readers-wikipedia') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') import openai import os os.environ["OPENAI_API_KEY"] = "[You API key]" get_ipython(...
WikipediaReader()
llama_index.readers.wikipedia.WikipediaReader
get_ipython().run_line_magic('pip', 'install llama-index-finetuning-cross-encoders') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') get_ipython().system('pip install datasets --quiet') get_ipython().system('pip install sentence-transformers --q...
VectorStoreIndex.from_documents(documents)
llama_index.core.VectorStoreIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-readers-file') get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') get_ipython().run_line_magic('env', 'OPENAI_API_KEY=') get_ipython().run...
Document(text=doc_text)
llama_index.core.Document
get_ipython().run_line_magic('pip', 'install llama-index-llms-gradient') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-readers-file') get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().system('pip instal...
OpenAI(model="gpt-4", callback_manager=callback_manager)
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-deeplake') get_ipython().system('pip install llama-index') get_ipython().system('pip install deeplake') import os import textwrap from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Document from llama_index.vector_stores.dee...
DeepLakeVectorStore(dataset_path=dataset_path, overwrite=True)
llama_index.vector_stores.deeplake.DeepLakeVectorStore
get_ipython().run_line_magic('pip', 'install llama-index-llms-gemini') get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-google') get_ipython().run_line_magic('pip', 'install llama-index-indices-managed-google') get_ipython().run_line_magic('pip', 'install llama-index-response-synthesizers-google')...
GoogleIndex.from_corpus(corpus_id=SESSION_CORPUS_ID)
llama_index.indices.managed.google.GoogleIndex.from_corpus
get_ipython().run_line_magic('pip', 'install llama-index-agent-openai') get_ipython().run_line_magic('pip', 'install llama-index-embeddings-openai') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') import os os.environ["OPENAI_API_KEY"] = "sk-..." from llama_index.embeddings.openai import Ope...
ChatPromptTemplate(gen_sys_prompt_messages)
llama_index.core.ChatPromptTemplate
get_ipython().run_line_magic('pip', 'install llama-index-postprocessor-longllmlingua') get_ipython().system('pip install llmlingua llama-index') import openai openai.api_key = "<insert_openai_key>" get_ipython().system('wget "https://www.dropbox.com/s/f6bmb19xdg0xedm/paul_graham_essay.txt?dl=1" -O paul_graham_...
VectorStoreIndex.from_documents(documents)
llama_index.core.VectorStoreIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-readers-wikipedia') get_ipython().system('pip install llama-index') import time import nest_asyncio nest_asyncio.apply() import os os.environ["OPENAI_API_KEY"] = "[YOUR_API_KEY]" from llama_index.core import VectorStoreIndex, download_loader from llama...
VectorStoreIndex.from_documents(documents)
llama_index.core.VectorStoreIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-llms-monsterapi') get_ipython().system('python3 -m pip install llama-index --quiet -y') get_ipython().system('python3 -m pip install monsterapi --quiet') get_ipython().system('python3 -m pip install sentence_transformers --quiet') import os from llama_index...
SimpleDirectoryReader("./data")
llama_index.core.SimpleDirectoryReader
get_ipython().system('pip install llama-index') import os import openai os.environ["OPENAI_API_KEY"] = "sk-..." openai.api_key = os.environ["OPENAI_API_KEY"] import nltk nltk.download("stopwords") import llama_index.core import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) lo...
Document(text="target", metadata={"tag": "target"})
llama_index.core.Document
from llama_index.core import SQLDatabase from sqlalchemy import ( create_engine, MetaData, Table, Column, String, Integer, select, column, ) engine = create_engine("sqlite:///chinook.db") sql_database = SQLDatabase(engine) from llama_index.core.query_pipeline import QueryPipeline g...
OpenAI(model="gpt-4-1106-preview")
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install llama-index-readers-wikipedia') get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-finetuning-callbacks') get_ipython().run_line...
OpenAIFineTuningHandler()
llama_index.finetuning.callbacks.OpenAIFineTuningHandler
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') from llama_index.llms.openai import OpenAI from llama_index.core import Settings Settings.llm = OpenAI(model="gpt-4", temperature=0) Settings.chunk_size = 512 get_ipython().system("mkdir -p 'da...
SimpleDirectoryReader("./data/paul_graham")
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-readers-wikipedia') get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-finetuning-callbacks') get_ipython().run_line...
VectorStoreIndex.from_documents(documents=documents)
llama_index.core.VectorStoreIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index') get_ipython().run_line_magic('pip', 'install sqlite-utils') import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging...
OpenAI(model="gpt-3.5-turbo")
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install llama-index-readers-psychic') get_ipython().system('pip install llama-index') import logging import sys import os logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout)) from llama_index.core ...
PsychicReader(psychic_key=psychic_key)
llama_index.readers.psychic.PsychicReader
get_ipython().run_line_magic('pip', 'install llama-index-storage-docstore-redis') get_ipython().run_line_magic('pip', 'install llama-index-storage-docstore-mongodb') get_ipython().run_line_magic('pip', 'install llama-index-embeddings-huggingface') get_ipython().system('mkdir -p data') get_ipython().system('echo "This...
SimpleDirectoryReader("./data", filename_as_id=True)
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-llms-rungpt') get_ipython().system('pip install llama-index') get_ipython().system('pip install rungpt') get_ipython().system('rungpt serve decapoda-research/llama-7b-hf --precision fp16 --device_map balanced') from llama_index.llms.rungpt import RunGp...
RunGptLLM()
llama_index.llms.rungpt.RunGptLLM
get_ipython().run_line_magic('pip', 'install llama-index-llms-openllm') get_ipython().system('pip install "openllm" # use \'openllm[vllm]\' if you have access to GPU') get_ipython().system('pip install llama-index') import os from typing import List, Optional from llama_index.llms.openllm import OpenLLM, Open...
OpenLLMAPI()
llama_index.llms.openllm.OpenLLMAPI
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') import nest_asyncio nest_asyncio.apply() import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging.StreamHandler(stream=sys.std...
SimpleDocumentStore()
llama_index.core.storage.docstore.SimpleDocumentStore
get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') import nest_asyncio nest_asyncio.apply() get_ipython().system('pip install llama-index') get_ipython().system('pip install spacy') wiki_titles = [ "Toronto", "S...
EmbeddingQAFinetuneDataset.from_json("dataset.json")
llama_index.core.evaluation.EmbeddingQAFinetuneDataset.from_json
from llama_hub.semanticscholar.base import SemanticScholarReader import os import openai from llama_index.llms import OpenAI from llama_index.query_engine import CitationQueryEngine from llama_index import ( VectorStoreIndex, StorageContext, load_index_from_storage, ServiceContext, ) from llama_index.re...
StorageContext.from_defaults(persist_dir=persist_dir)
llama_index.StorageContext.from_defaults
get_ipython().run_line_magic('pip', 'install llama-index-embeddings-openai') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system("mkdir -p 'data/paul_graham/'") get_ipython().system("wget 'https://raw.githubusercontent.com/run-llama/llama_index/main/docs/examples/data/paul_grah...
SimpleDirectoryReader("./data/paul_graham")
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-llms-gradient') get_ipython().run_line_magic('pip', 'install llama-index-finetuning') get_ipython().system('pip install llama-index gradientai -q') import os from llama_index.llms.gradient import GradientBaseModelLLM from llama_index.finetuning import Gradien...
PromptTemplate(text2sql_tmpl_str)
llama_index.core.PromptTemplate
get_ipython().run_line_magic('pip', 'install llama-index-callbacks-aim') get_ipython().system('pip install llama-index') from llama_index.core.callbacks import CallbackManager from llama_index.callbacks.aim import AimCallback from llama_index.core import SummaryIndex from llama_index.core import SimpleDirectoryRead...
SummaryIndex.from_documents(docs, callback_manager=callback_manager)
llama_index.core.SummaryIndex.from_documents
get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().system('pip install llama-index') from llama_index.llms.openai import OpenAI resp = OpenAI().complete("Paul Graham is ") print(resp) from llama_index.core.llms import ChatMessage from llama_index.llms.openai import OpenAI ...
OpenAI(model="text-davinci-003")
llama_index.llms.openai.OpenAI
get_ipython().run_line_magic('pip', 'install -q llama-index-vector-stores-chroma llama-index-llms-fireworks llama-index-embeddings-fireworks==0.1.2') get_ipython().run_line_magic('pip', 'install -q llama-index') get_ipython().system('pip install llama-index chromadb --quiet') get_ipython().system('pip install -q c...
SimpleDirectoryReader("./data/paul_graham/")
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-weaviate') get_ipython().system('pip install llama-index') import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout)) import weaviate resour...
StorageContext.from_defaults(vector_store=vector_store)
llama_index.core.StorageContext.from_defaults
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-weaviate') get_ipython().run_line_magic('pip', 'install llama-index-embeddings-openai') get_ipython().system('pip install llama-index') import weaviate client = weaviate.Client("https://test-cluster-bbn8vqsn.weaviate.network") try: cli...
pprint_source_node(nodes[0])
llama_index.core.response.pprint_utils.pprint_source_node
get_ipython().system('pip install llama-index') get_ipython().system("mkdir -p 'data/paul_graham/'") get_ipython().system("wget 'https://raw.githubusercontent.com/run-llama/llama_index/main/docs/examples/data/paul_graham/paul_graham_essay.txt' -O 'data/paul_graham/paul_graham_essay.txt'") import logging import sy...
SimpleDirectoryReader("./data/paul_graham/")
llama_index.core.SimpleDirectoryReader
get_ipython().run_line_magic('pip', 'install llama-index-embeddings-together') get_ipython().run_line_magic('pip', 'install llama-index-llms-openai') get_ipython().run_line_magic('pip', 'install llama-index-embeddings-openai') get_ipython().run_line_magic('pip', 'install llama-index-readers-file') domain = "docs.llam...
VectorStoreIndex(nodes, embed_model=embed_model)
llama_index.core.VectorStoreIndex
get_ipython().run_line_magic('pip', 'install llama-index-vector-stores-lantern') get_ipython().system('pip install llama-index psycopg2-binary asyncpg') import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout)) im...
StorageContext.from_defaults(vector_store=vector_store)
llama_index.core.StorageContext.from_defaults