Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -29,7 +29,7 @@ SysPromptJson = "You are now in the role of an expert AI who can extract structu
|
|
29 |
SysPromptList = "You are now in the role of an expert AI who can extract structured information from user request. All elements must be in double quotes. You must respond ONLY with a valid python List. Do not add any additional comments."
|
30 |
SysPromptDefault = "You are an expert AI, complete the given task. Do not add any additional comments."
|
31 |
SysPromptMd = "You are an expert AI who can create a structured report using information provided in the context from user request.The report should be in markdown format consists of markdown tables structured into subtopics. Do not add any additional comments."
|
32 |
-
|
33 |
sys_prompts = {
|
34 |
"offline": {
|
35 |
"Chat": "You are an expert AI, complete the given task. Do not add any additional comments.",
|
@@ -65,7 +65,8 @@ async def generate_report(request: Request, query: QueryModel):
|
|
65 |
|
66 |
# Combine query with user keywords
|
67 |
if query.internet:
|
68 |
-
search_query = query_str
|
|
|
69 |
|
70 |
# Search for relevant URLs
|
71 |
urls = search_brave(search_query, num_results=4)
|
|
|
29 |
SysPromptList = "You are now in the role of an expert AI who can extract structured information from user request. All elements must be in double quotes. You must respond ONLY with a valid python List. Do not add any additional comments."
|
30 |
SysPromptDefault = "You are an expert AI, complete the given task. Do not add any additional comments."
|
31 |
SysPromptMd = "You are an expert AI who can create a structured report using information provided in the context from user request.The report should be in markdown format consists of markdown tables structured into subtopics. Do not add any additional comments."
|
32 |
+
SysPromptSearch = "Extract from the input text to form a concise Google search query, focusing only on the main topic and omitting additional redundant details in max 8 words, include year if necessory, 2024, Do not add any additional comments."
|
33 |
sys_prompts = {
|
34 |
"offline": {
|
35 |
"Chat": "You are an expert AI, complete the given task. Do not add any additional comments.",
|
|
|
65 |
|
66 |
# Combine query with user keywords
|
67 |
if query.internet:
|
68 |
+
search_query = together_response(query_str, model=llm_default_medium, SysPrompt=sys_prompt_output_format, max_tokens = 25)
|
69 |
+
print(f"query:{query_str}, formatted query:{search_query}")
|
70 |
|
71 |
# Search for relevant URLs
|
72 |
urls = search_brave(search_query, num_results=4)
|