Spaces:
Runtime error
Runtime error
Commit
·
009c740
1
Parent(s):
f908aec
print prompt template
Browse files
app.py
CHANGED
|
@@ -11,6 +11,7 @@ from langchain.vectorstores import Pinecone
|
|
| 11 |
from langchain.agents import initialize_agent
|
| 12 |
from langchain.agents import AgentType
|
| 13 |
from langchain.agents import Tool
|
|
|
|
| 14 |
from langchain.tools import BaseTool
|
| 15 |
from langchain.tools import DuckDuckGoSearchRun
|
| 16 |
from langchain.utilities import WikipediaAPIWrapper
|
|
@@ -74,15 +75,17 @@ chat = AzureChatOpenAI(
|
|
| 74 |
)
|
| 75 |
llm = chat
|
| 76 |
|
| 77 |
-
llm_math = LLMMathChain(llm = llm)
|
| 78 |
|
| 79 |
-
math_tool = Tool(
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
)
|
| 84 |
|
| 85 |
-
tools = [DB_Search(), duckduckgo_tool, python_tool
|
|
|
|
|
|
|
| 86 |
|
| 87 |
embeddings = OpenAIEmbeddings(deployment="model_embedding", chunk_size=15)
|
| 88 |
|
|
@@ -104,6 +107,8 @@ agent = initialize_agent(tools, llm,
|
|
| 104 |
verbose = True,
|
| 105 |
handle_parsing_errors = True)
|
| 106 |
|
|
|
|
|
|
|
| 107 |
global vectordb
|
| 108 |
vectordb = Chroma(persist_directory='db', embedding_function=embeddings)
|
| 109 |
global vectordb_p
|
|
|
|
| 11 |
from langchain.agents import initialize_agent
|
| 12 |
from langchain.agents import AgentType
|
| 13 |
from langchain.agents import Tool
|
| 14 |
+
from langchain.agents import load_tools
|
| 15 |
from langchain.tools import BaseTool
|
| 16 |
from langchain.tools import DuckDuckGoSearchRun
|
| 17 |
from langchain.utilities import WikipediaAPIWrapper
|
|
|
|
| 75 |
)
|
| 76 |
llm = chat
|
| 77 |
|
| 78 |
+
# llm_math = LLMMathChain(llm = llm)
|
| 79 |
|
| 80 |
+
# math_tool = Tool(
|
| 81 |
+
# name ='Calculator',
|
| 82 |
+
# func = llm_math.run,
|
| 83 |
+
# description ='Useful for when you need to answer questions about math.'
|
| 84 |
+
# )
|
| 85 |
|
| 86 |
+
tools = [DB_Search(), duckduckgo_tool, python_tool]
|
| 87 |
+
|
| 88 |
+
tools = load_tools(["llm-math"], llm=llm)
|
| 89 |
|
| 90 |
embeddings = OpenAIEmbeddings(deployment="model_embedding", chunk_size=15)
|
| 91 |
|
|
|
|
| 107 |
verbose = True,
|
| 108 |
handle_parsing_errors = True)
|
| 109 |
|
| 110 |
+
print(agent.agent.llm_chain.prompt.template)
|
| 111 |
+
|
| 112 |
global vectordb
|
| 113 |
vectordb = Chroma(persist_directory='db', embedding_function=embeddings)
|
| 114 |
global vectordb_p
|