Spaces:
Sleeping
Sleeping
Update agent.py
Browse filescreating the prompt for ProA
agent.py
CHANGED
@@ -5,39 +5,6 @@ from vectara_agentic.tools import VectaraToolFactory
|
|
5 |
|
6 |
initial_prompt = "How can I help you today?"
|
7 |
|
8 |
-
prompt_old = """
|
9 |
-
[
|
10 |
-
{"role": "system", "content": "You are an AI assistant that forms a detailed and comprehensive answer to a user query based on search results that are provided to you." },
|
11 |
-
{"role": "user", "content": "
|
12 |
-
[INSTRUCTIONS]
|
13 |
-
If the search results are irrelevant to the question respond with *** I do not have enough information to answer this question.***
|
14 |
-
Search results may include tables in a markdown format.
|
15 |
-
When answering a question using a table be careful about which rows and columns contain the answer and include all relevant information from the relevant rows and columns that the query is asking about.
|
16 |
-
Do not base your response on information or knowledge that is not in the search results.
|
17 |
-
Make sure your response is answering the query asked. If the query is related to an entity (such as a person or place), make sure you use search results related to that entity.
|
18 |
-
Consider that each search result is a partial segment from a bigger text, and may be incomplete.
|
19 |
-
Your output should always be in a single language - the $vectaraLangName language. Check spelling and grammar for the $vectaraLangName language.
|
20 |
-
Search results for the query *** $vectaraQuery***, are listed below, some are text, some MAY be tables in markdown format.
|
21 |
-
#foreach ($qResult in $vectaraQueryResultsDeduped)
|
22 |
-
[$esc.java($foreach.index + 1)]
|
23 |
-
#if($qResult.hasTable())
|
24 |
-
Table Title: $qResult.getTable().title() || Table Description: $qResult.getTable().description() || Table Data:
|
25 |
-
$qResult.getTable().markdown()
|
26 |
-
#else
|
27 |
-
$qResult.getText()
|
28 |
-
#end
|
29 |
-
#end
|
30 |
-
Generate a comprehensive response to the query *** $vectaraQuery *** using information and facts in the search results provided.
|
31 |
-
Give a slight preference to search results that appear earlier in the list.
|
32 |
-
Include statistical and numerical evidence to support and contextualize your response.
|
33 |
-
Your response should include all relevant information and values from the search results. Do not omit anything relevant.
|
34 |
-
Prioritize a long, detailed, thorough and comprehensive response over a short one.
|
35 |
-
Cite relevant search results in your answer following these specific instructions: $vectaraCitationInstructions
|
36 |
-
Respond always in the $vectaraLangName language, and only in that language."}
|
37 |
-
]
|
38 |
-
"""
|
39 |
-
|
40 |
-
|
41 |
prompt = """
|
42 |
[
|
43 |
{"role": "system", "content": "
|
@@ -130,7 +97,7 @@ def create_assistant_tools(cfg):
|
|
130 |
)
|
131 |
|
132 |
def initialize_agent(_cfg, agent_progress_callback=None):
|
133 |
-
|
134 |
- You are an expert in clinical trial and statistical data analysis with extensive experience in designing, analyzing, and interpreting clinical research data.
|
135 |
- Your task is to answer user question, using the tools you have available.
|
136 |
- use the 'search_publications' tool to get a list of relevant trials or documents that match the user question, but always call it with summarize=False.
|
@@ -158,8 +125,8 @@ def initialize_agent(_cfg, agent_progress_callback=None):
|
|
158 |
|
159 |
agent = Agent(
|
160 |
tools=create_assistant_tools(_cfg),
|
161 |
-
topic="
|
162 |
-
custom_instructions=
|
163 |
agent_progress_callback=agent_progress_callback,
|
164 |
)
|
165 |
agent.report()
|
|
|
5 |
|
6 |
initial_prompt = "How can I help you today?"
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
prompt = """
|
9 |
[
|
10 |
{"role": "system", "content": "
|
|
|
97 |
)
|
98 |
|
99 |
def initialize_agent(_cfg, agent_progress_callback=None):
|
100 |
+
proa_capital_bot_instructions = """
|
101 |
- You are an expert in clinical trial and statistical data analysis with extensive experience in designing, analyzing, and interpreting clinical research data.
|
102 |
- Your task is to answer user question, using the tools you have available.
|
103 |
- use the 'search_publications' tool to get a list of relevant trials or documents that match the user question, but always call it with summarize=False.
|
|
|
125 |
|
126 |
agent = Agent(
|
127 |
tools=create_assistant_tools(_cfg),
|
128 |
+
topic="Market Analysis",
|
129 |
+
custom_instructions=proa_capital_bot_instructions,
|
130 |
agent_progress_callback=agent_progress_callback,
|
131 |
)
|
132 |
agent.report()
|