Spaces:
Sleeping
Sleeping
thoristhor
commited on
Commit
•
480f01a
1
Parent(s):
5208eb9
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,14 @@ pinecone.init(api_key=PINECONE_API_KEY, environment="us-east1-gcp")
|
|
15 |
pindex=pinecone.Index("sethgodin")
|
16 |
indexed_pinecone=GPTPineconeIndex([], pinecone_index=pindex)
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
memory = GPTIndexMemory(index=pinedex, memory_key="chat_history", query_kwargs={"response_mode": "compact"})
|
19 |
llm=OpenAI(temperature=0)
|
20 |
agent_chain = initialize_agent([], llm, agent="conversational-react-description", memory=memory)
|
|
|
15 |
pindex=pinecone.Index("sethgodin")
|
16 |
indexed_pinecone=GPTPineconeIndex([], pinecone_index=pindex)
|
17 |
|
18 |
+
tools = [
|
19 |
+
Tool(
|
20 |
+
name = "GPT Index",
|
21 |
+
func=lambda q: str(indexed_pinecone.query(q)),
|
22 |
+
description="useful for when you want to answer questions about the author. The input to this tool should be a complete english sentence.",
|
23 |
+
return_direct=True
|
24 |
+
),
|
25 |
+
]
|
26 |
memory = GPTIndexMemory(index=pinedex, memory_key="chat_history", query_kwargs={"response_mode": "compact"})
|
27 |
llm=OpenAI(temperature=0)
|
28 |
agent_chain = initialize_agent([], llm, agent="conversational-react-description", memory=memory)
|