PanoEvJ commited on
Commit
c81a5f7
1 Parent(s): aefaaab

updated gitignore

Browse files
Files changed (2) hide show
  1. .gitignore +2 -2
  2. app.py +9 -6
.gitignore CHANGED
@@ -1,4 +1,4 @@
1
  .env
2
  __pycache__
3
- cache
4
- .chainlit
 
1
  .env
2
  __pycache__
3
+ .cache
4
+ .chainlit
app.py CHANGED
@@ -163,12 +163,12 @@ async def init():
163
  return oppenheimer_multisource_chain.invoke({"question" : input})
164
  tools = [
165
  Tool(
166
- name = "BarbieInfo",
167
  func=query_barbie,
168
  description='Useful when you need to answer questions about the Barbie movie'
169
  ),
170
  Tool(
171
- name = "OppenheimerInfo",
172
  func=query_oppenheimer,
173
  description='Useful when you need to answer questions about the Oppenheimer movie'
174
  ),
@@ -193,7 +193,7 @@ async def init():
193
  tools=tools,
194
  verbose=True )
195
  # create execution agent
196
- barbenheimer_agent_chain = cl.make_async(AgentExecutor.from_agent_and_tools)(
197
  agent=barbenheimer_agent,
198
  tools=tools,
199
  verbose=True )
@@ -206,8 +206,8 @@ async def init():
206
  @cl.on_message
207
  async def main(message):
208
 
209
- msg = cl.Message(content=f"Thinking...")
210
- await msg.send()
211
 
212
  chain = cl.user_session.get("chain")
213
  cb = cl.AsyncLangchainCallbackHandler(
@@ -215,7 +215,10 @@ async def main(message):
215
  )
216
  cb.answer_reached = True
217
  res = await chain.acall(message, callbacks=[cb], )
218
-
 
 
 
219
  answer = res["result"]
220
  source_elements = []
221
  visited_sources = set()
 
163
  return oppenheimer_multisource_chain.invoke({"question" : input})
164
  tools = [
165
  Tool(
166
+ name="BarbieInfo",
167
  func=query_barbie,
168
  description='Useful when you need to answer questions about the Barbie movie'
169
  ),
170
  Tool(
171
+ name="OppenheimerInfo",
172
  func=query_oppenheimer,
173
  description='Useful when you need to answer questions about the Oppenheimer movie'
174
  ),
 
193
  tools=tools,
194
  verbose=True )
195
  # create execution agent
196
+ barbenheimer_agent_chain = await cl.make_async(AgentExecutor.from_agent_and_tools)(
197
  agent=barbenheimer_agent,
198
  tools=tools,
199
  verbose=True )
 
206
  @cl.on_message
207
  async def main(message):
208
 
209
+ # msg = cl.Message(content=f"Thinking...")
210
+ # await msg.send()
211
 
212
  chain = cl.user_session.get("chain")
213
  cb = cl.AsyncLangchainCallbackHandler(
 
215
  )
216
  cb.answer_reached = True
217
  res = await chain.acall(message, callbacks=[cb], )
218
+
219
+ # msg = cl.Message(content=f"{res}")
220
+ # await msg.send()
221
+
222
  answer = res["result"]
223
  source_elements = []
224
  visited_sources = set()