datacipen commited on
Commit
fd12b73
1 Parent(s): cf4b178

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -111,7 +111,7 @@ async def on_message(message: cl.Message):
111
  )
112
  index = pc.Index(index_name)
113
  xq = embeddings.embed_query(message.content)
114
- xc = index.query(vector=xq, filter={"categorie": {"$eq": "bibliographie-OPP-DGDIN"}},top_k=150, include_metadata=True)
115
  context_p = ""
116
  for result in xc['matches']:
117
  context_p = context_p + result['metadata']['text']
@@ -139,7 +139,7 @@ async def on_message(message: cl.Message):
139
  cl.Text(name="Sources", content=sources_text, display="inline")
140
  )
141
 
142
- async with cl.Step(type="run", name="QA Assistant"):
143
  async for chunk in runnable.astream(
144
  {"question": message.content, "context":context_p},
145
  config=RunnableConfig(callbacks=[
 
111
  )
112
  index = pc.Index(index_name)
113
  xq = embeddings.embed_query(message.content)
114
+ xc = index.query(vector=xq, filter={"categorie": {"$eq": "bibliographie-OPP-DGDIN"}},top_k=120, include_metadata=True)
115
  context_p = ""
116
  for result in xc['matches']:
117
  context_p = context_p + result['metadata']['text']
 
139
  cl.Text(name="Sources", content=sources_text, display="inline")
140
  )
141
 
142
+ async with cl.Step(type="run", name="Réponse de Mistral"):
143
  async for chunk in runnable.astream(
144
  {"question": message.content, "context":context_p},
145
  config=RunnableConfig(callbacks=[