Shamik commited on
Commit
4129aa0
·
verified ·
1 Parent(s): 4c3f84c

feat: using a detailed prompt for the VLM.

Browse files
src/insurance_assistants/agents.py CHANGED
@@ -16,7 +16,7 @@ from smolagents import (
16
  )
17
 
18
  from src.insurance_assistants.complex_rag import RAG
19
- from src.insurance_assistants.consts import PROMPT_PREFIX
20
 
21
  # _ = load_dotenv(dotenv_path=find_dotenv())
22
  rag_app = RAG()
@@ -45,9 +45,11 @@ class InsuranceInfoRetriever(Tool):
45
  chat_template = [
46
  {
47
  "role": "system",
48
- "content": """You find answers from the relevant documents. Answer only
49
- from these documents. If answer isn't available return 'Question cannot be answered based
50
- on the documents provided.' """,
 
 
51
  },
52
  {
53
  "role": "user",
@@ -76,7 +78,8 @@ class InsuranceInfoRetriever(Tool):
76
  insurance_agent = CodeAgent(
77
  tools=[InsuranceInfoRetriever(), FinalAnswerTool()],
78
  model=InferenceClientModel(bill_to="VitalNest", temperature=0.1,
79
- token=os.getenv("HF_TOKEN")),
 
80
  additional_authorized_imports=["os", "requests", "bs4", "pil", "base64", "io"],
81
  max_steps=1,
82
  verbosity_level=-1,
 
16
  )
17
 
18
  from src.insurance_assistants.complex_rag import RAG
19
+ from src.insurance_assistants.consts import PROMPT_PREFIX, PROMPT
20
 
21
  # _ = load_dotenv(dotenv_path=find_dotenv())
22
  rag_app = RAG()
 
45
  chat_template = [
46
  {
47
  "role": "system",
48
+ "content": PROMPT
49
+ # """You find answers from the relevant documents. Answer only
50
+ # from these documents. If answer isn't available return 'Question cannot be answered based
51
+ # on the documents provided.' """
52
+ ,
53
  },
54
  {
55
  "role": "user",
 
78
  insurance_agent = CodeAgent(
79
  tools=[InsuranceInfoRetriever(), FinalAnswerTool()],
80
  model=InferenceClientModel(bill_to="VitalNest", temperature=0.1,
81
+ # token=os.getenv("HF_TOKEN")
82
+ ),
83
  additional_authorized_imports=["os", "requests", "bs4", "pil", "base64", "io"],
84
  max_steps=1,
85
  verbosity_level=-1,
src/insurance_assistants/consts.py CHANGED
@@ -10,11 +10,9 @@ Give detailed and extensive answers, only containing info in the pages you are g
10
  You can answer using information contained in plots and figures if necessary.
11
  Answer in the same language as the query.
12
 
13
- Query: {query}
14
- PDF pages:
15
  """
16
 
17
- PRIMARY_HEADING = """# An Agentic RAG for Health Insurance Documents
18
  #### This agent answers health insurance related questions from pre-ingested set \
19
  of health insurance documents, search wikipedia, search the web \
20
  and execute basic python code. \
 
10
  You can answer using information contained in plots and figures if necessary.
11
  Answer in the same language as the query.
12
 
 
 
13
  """
14
 
15
+ PRIMARY_HEADING = """# Multi-agent Health Insurance Advisor
16
  #### This agent answers health insurance related questions from pre-ingested set \
17
  of health insurance documents, search wikipedia, search the web \
18
  and execute basic python code. \