Skip to content

Commit

Permalink
Solve pylint complains
Browse files Browse the repository at this point in the history
  • Loading branch information
Maclenn77 committed Dec 9, 2023
1 parent 93d929b commit 966c865
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def set_api_key():
else:
st.write("Please upload a file of type: pdf")

st.subheader("Search your knowledge base")
st.subheader("Search on your knowledge base")
# if st.button("Chroma data collection"):
# st.write(collection)

Expand Down
20 changes: 17 additions & 3 deletions src/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,33 @@ def __init__(self, llm, chroma_db):
"""Initialize the Agent"""
search = Search(chroma_db)

tools = [
self.tools = [
Tool.from_function(
func=search.run,
name="Search DB",
description="Useful when you need to answer questions about a PDF in the collection.",
description="Useful when you need more context about a specific topic.",
handle_parsing_errors=True,
)
]

self.agent = initialize_agent(
tools,
self.tools,
llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
verbose=True,
handle_parsing_errors=True,
)

def add_tools(self, tools: list[Tool]):
"""Add tools to the Agent"""
self.tools.extend(tools)

def replace_agent(self, agent: AgentType, llm):
"""Replace the Agent"""
self.agent = initialize_agent(
self.tools,
llm,
agent=agent,
verbose=True,
handle_parsing_errors=True,
)

0 comments on commit 966c865

Please sign in to comment.