bupa1018 commited on
Commit
8cee1bc
·
1 Parent(s): 5dae557

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -332,10 +332,29 @@ def rag_workflow(query):
332
  rewritten_query_response = llm.invoke("Hello")
333
  rewritten_query = rewritten_query_response.content.strip()
334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  prompt = (
336
  f"The query is: '{query}'. "
337
  "Based on this query, choose the most appropriate option from the following: "
338
- "'kadiAPY library"', 'kadiAPY cli library', 'kadiAPY command line'. "
339
  "Respond only with one of these options—do not add any additional text or commentary."
340
  )
341
  metadata_prediction = llm.predict(prompt)
 
332
  rewritten_query_response = llm.invoke("Hello")
333
  rewritten_query = rewritten_query_response.content.strip()
334
 
335
+
336
+ prompt = (
337
+ f"""The query is: '{query}'.
338
+ Based on the user's query, assist them by determining which technical document they should read to interact with the software named 'Kadi4Mat'.
339
+ There are three different technical documents to choose from:
340
+ - Document 1: Provides information on how to use a Python library to interact with the HTTP API of 'Kadi4Mat'.
341
+ - Document 2: Provides information on how to use a Python library to implement custom CLI commands to interact with 'Kadi4Mat'.
342
+ - Document 3: Provides prewritten CLI command lines and guides on how to use the command-line interface to interact with 'Kadi4Mat'.
343
+
344
+ Your task is to select the single most likely option.
345
+ If Document 1 is the best choice, respond with 'kadi-apy python library'.
346
+ If Document 2 is the best choice, respond with 'kadi-apy python cli library'.
347
+ If Document 3 is the best choice, respond with 'kadi-apy command line interface'.
348
+ Respond with only the exact corresponding option and do not include any additional comments, explanations, or text."
349
+ """
350
+ )
351
+ metadata_prediction = llm.predict(prompt)
352
+
353
+
354
  prompt = (
355
  f"The query is: '{query}'. "
356
  "Based on this query, choose the most appropriate option from the following: "
357
+ "'kadiAPY library"', 'kadiAPY cli library', 'kadiAPY command line'"
358
  "Respond only with one of these options—do not add any additional text or commentary."
359
  )
360
  metadata_prediction = llm.predict(prompt)