LlamaHub
https://scrapbox.io/files/640ed2e74e85ff001c0309b8.png
Llama Hub
emptycrown/llama-hub: A library of data loaders for LLMs made by the community -- to be used with GPT Index and/or LangChain
LangChainのAgentsとかに繋ぎ込む外部データソースを取ってくるデータローダのライブラリ
外部データの取得方法はscrapingやapiを叩くなどデータソースごとに異なるためその辺の差異を埋めるためにコミュニティーベースで各種取得方法が作られていっている
例えばSlackやBiliBiliやWordpressなど有名どころは一通り揃っているっぽい
例えばLangChainとの接続
code:py
from llama_index import GPTSimpleVectorIndex, download_loader
from langchain.agents import initialize_agent, Tool
from langchain.llms import OpenAI
from langchain.chains.conversation.memory import ConversationBufferMemory
GoogleDocsReader = download_loader('GoogleDocsReader')
gdoc_ids = '1wf-y2pd9C878Oh-FmLH7Q_BQkljdm6TQal-c1pUfrec'
loader = GoogleDocsReader()
documents = loader.load_data(document_ids=gdoc_ids)
index = GPTSimpleVectorIndex(documents)
tools = [
Tool(
name="Google Doc Index",
func=lambda q: index.query(q),
description=f"Useful when you want answer questions about the Google Documents.",
),
]
llm = OpenAI(temperature=0)
memory = ConversationBufferMemory(memory_key="chat_history")
agent_chain = initialize_agent(
tools, llm, agent="zero-shot-react-description", memory=memory
)
output = agent_chain.run(input="Where did the author go to school?")
llm