Guiyom commited on
Commit
a76f63d
·
verified ·
1 Parent(s): c7baee3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -39
app.py CHANGED
@@ -1219,20 +1219,18 @@ Note2: citations sources in-line need to be in this format: blablabla - Source [
1219
  - You have freedom on the structure, but it has to cover all potential aspects on the topic in between 500 and 1000 words
1220
 
1221
  // Mentioning sources, organisations and individuals
1222
- - We will perform a post-processing on the output to remove all the identifiable organisations, people and projects
1223
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1224
- ex1: {{[{{Google}}]}}'s CEO, {{[{{Sundar Pichai}}]}} ...
1225
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1226
- ex3: {{[{{Softbank}}]}}'s CEO , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1227
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1228
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1229
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1230
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1231
- Important:
1232
- - You will safely mention any of these elements provided you respect the above mentioned formatting {{[{{...}}]}}
1233
- - You must have at least 20 of such occurences - this is important for the grounding of the report in verifiable facts and sources
1234
- - Don't mention the safe-formatting in the report or at the end, just do it - This is just for regex processing purpose
1235
- - LinkedIn is not a source - you should check the author of the page visited, this is the real source, mention the name of the author and then add "from LinkedIn Pulse"
1236
 
1237
  // Important
1238
  - Make it real, with anecdotes from the content
@@ -1440,20 +1438,19 @@ Summarize the following text, preserving all key details and ensuring that any t
1440
  {chunk}
1441
 
1442
  // Mentioning sources, organisations and individuals
1443
- - We will perform a post-processing on the output to remove all the identifiable organisations, people and projects
1444
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1445
- ex1: {{[{{Google}}]}}'s CEO, {{[{{Sundar Pichai}}]}} ...
1446
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1447
- ex3: {{[{{Softbank}}]}}'s CEO , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1448
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1449
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1450
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1451
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1452
- Important:
1453
- - You will safely mention any of these elements provided you respect the above mentioned formatting {{[{{...}}]}}
1454
- - You must have at least 20 of such occurences - this is important for the grounding of the report in verifiable facts and sources
1455
- - Don't mention the safe-formatting in the report or at the end, just do it - This is just for regex processing purpose
1456
- - LinkedIn is not a source - you should check the author of the page visited, this is the real source, mention the name of the author and then add 'from LinkedIn Pulse'"""
1457
  )
1458
  summary_chunk = openai_call(prompt=chunk_prompt, model="gpt-4o-mini", max_tokens_param=500, temperature=0.7)
1459
  summary_chunk = re.sub(r'\{\[\{(.*?)\}\]\}', r'\1', summary_chunk)
@@ -1470,20 +1467,19 @@ Combine the following summaries into one concise summary that preserves all crit
1470
  {combined_summary}
1471
 
1472
  // Mentioning sources, organisations and individuals
1473
- - We will perform a post-processing on the output to remove all the identifiable organisations, people and projects
1474
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1475
- ex1: {{[{{Google}}]}}'s CEO, {{[{{Sundar Pichai}}]}} ...
1476
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1477
- ex3: {{[{{Softbank}}]}}'s CEO , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1478
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1479
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1480
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1481
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1482
- Important:
1483
- - you will safely mention any of these elements provided you respect the above mentioned formatting {{[{{...}}]}}
1484
- - you must have at least 20 of such occurences
1485
- - don't mention this formatting thing in the report, just do it
1486
- - LinkedIn is not a source - you should check the author of the page visited, this is the real source, mention the name of the author and then add 'from LinkedIn Pulse'"""
1487
  )
1488
  final_summary = openai_call(prompt=final_prompt, model="gpt-4o-mini", max_tokens_param=target_length, temperature=0.7)
1489
  final_summary = re.sub(r'\{\[\{(.*?)\}\]\}', r'\1', final_summary)
@@ -1536,20 +1532,19 @@ Note: General Optimization Guidelines:
1536
  Source length: {snippet_words} words. You may produce a more detailed summary if the text is long.
1537
 
1538
  // Mentioning sources, organisations and individuals
1539
- - We will perform a post-processing on the output to remove all the identifiable organisations, people and projects
1540
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1541
- ex1: {{[{{Google}}]}}'s CEO, {{[{{Sundar Pichai}}]}} ...
1542
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1543
- ex3: {{[{{Softbank}}]}}'s CEO , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1544
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1545
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1546
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1547
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1548
- Important:
1549
- - you will safely mention any of these elements provided you respect the above mentioned formatting {{[{{...}}]}}
1550
- - You must have at least 20 of such occurences - this is important for the grounding of the report in verifiable facts and sources
1551
- - don't mention this formatting thing in the report, just do it
1552
- - LinkedIn is not a source - you should check the author of the page visited, this is the real source, mention the name of the author and then add "from LinkedIn Pulse"
1553
 
1554
  IMPORTANT: Format your response as a proper JSON object with these fields:
1555
  - "relevant": "yes" or "no"
@@ -1727,8 +1722,8 @@ Note: This is for academic purposes, so thorough citations and referencing are e
1727
  Note: put the full reference url (no generic domain address), down to the html page or the pdf
1728
  5. It must follow this writing style {reportstyle}.
1729
 
1730
- // Mentioning sources, organisations and individuals in safe format
1731
- - We will perform a post-processing on the output to remove all the identifiable organisations, people and projects
1732
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1733
  ex1: {{[{{Google}}]}} CEO, {{[{{Sundar Pichai}}]}} ...
1734
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
@@ -1737,11 +1732,9 @@ ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaborati
1737
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1738
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1739
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1740
- Important:
1741
- - You will safely mention any of these elements provided you respect the above mentioned formatting {{[{{...}}]}}
1742
- - You must have at least {10 * pages} of such occurences scattered around the report - this is important for the grounding of the report in verifiable facts and sources
1743
- - Don't mention the safe-formatting in the report or at the end, just do it - This is just for regex processing purpose
1744
- - LinkedIn is not a source - you should check the author of the page visited, this is the real source, mention the name of the author and then add "from LinkedIn Pulse"
1745
 
1746
  // Sources
1747
  Use the following learnings and merged reference details from a deep research process on:
 
1219
  - You have freedom on the structure, but it has to cover all potential aspects on the topic in between 500 and 1000 words
1220
 
1221
  // Mentioning sources, organisations and individuals
1222
+ - We will perform a post-processing on the output
1223
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1224
+ ex1: {{[{{Google}}]}} CEO, {{[{{Sundar Pichai}}]}} ...
1225
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1226
+ ex3: the CEO of {{[{{Softbank}}]}} , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1227
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1228
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1229
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1230
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1231
+ - You should have approximately 10 mention of organisations, people, projects or people, use the prescribed format
1232
+ - DO NOT MENTION this formmatting requirement, just apply it. The user doesn't have to know about this technicality.
1233
+ Note: LinkedIn is not a source - if you want to use a source related to LinkedIn, you should check the author of the page visited, this is the real source, mention the name of the author as "'authorName' from LinkedIn Pulse"
 
 
1234
 
1235
  // Important
1236
  - Make it real, with anecdotes from the content
 
1438
  {chunk}
1439
 
1440
  // Mentioning sources, organisations and individuals
1441
+ - We will perform a post-processing on the output
1442
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1443
+ ex1: {{[{{Google}}]}} CEO, {{[{{Sundar Pichai}}]}} ...
1444
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1445
+ ex3: the CEO of {{[{{Softbank}}]}} , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1446
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1447
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1448
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1449
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1450
+ - You should have approximately 10 mention of organisations, people, projects or people, use the prescribed format
1451
+ - DO NOT MENTION this formmatting requirement, just apply it. The user doesn't have to know about this technicality.
1452
+ Note: LinkedIn is not a source - if you want to use a source related to LinkedIn, you should check the author of the page visited, this is the real source, mention the name of the author as "'authorName' from LinkedIn Pulse"
1453
+ """
 
1454
  )
1455
  summary_chunk = openai_call(prompt=chunk_prompt, model="gpt-4o-mini", max_tokens_param=500, temperature=0.7)
1456
  summary_chunk = re.sub(r'\{\[\{(.*?)\}\]\}', r'\1', summary_chunk)
 
1467
  {combined_summary}
1468
 
1469
  // Mentioning sources, organisations and individuals
1470
+ - We will perform a post-processing on the output
1471
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1472
+ ex1: {{[{{Google}}]}} CEO, {{[{{Sundar Pichai}}]}} ...
1473
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1474
+ ex3: the CEO of {{[{{Softbank}}]}} , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1475
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1476
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1477
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1478
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1479
+ - You should have approximately 10 mention of organisations, people, projects or people, use the prescribed format
1480
+ - DO NOT MENTION this formmatting requirement, just apply it. The user doesn't have to know about this technicality.
1481
+ Note: LinkedIn is not a source - if you want to use a source related to LinkedIn, you should check the author of the page visited, this is the real source, mention the name of the author as "'authorName' from LinkedIn Pulse"
1482
+ """
 
1483
  )
1484
  final_summary = openai_call(prompt=final_prompt, model="gpt-4o-mini", max_tokens_param=target_length, temperature=0.7)
1485
  final_summary = re.sub(r'\{\[\{(.*?)\}\]\}', r'\1', final_summary)
 
1532
  Source length: {snippet_words} words. You may produce a more detailed summary if the text is long.
1533
 
1534
  // Mentioning sources, organisations and individuals
1535
+ - We will perform a post-processing on the output
1536
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1537
+ ex1: {{[{{Google}}]}} CEO, {{[{{Sundar Pichai}}]}} ...
1538
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
1539
+ ex3: the CEO of {{[{{Softbank}}]}} , {{[{{Masayoshi Son}}]}}, said that "the best way to..."
1540
  ex4: the project {{[{{Stargate}}]}}, anounced by {{[{{OpenAI}}]}} in collaboration with {{[{{Salesforce}}]}}
1541
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1542
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1543
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1544
+ - You should have approximately 10 mention of organisations, people, projects or people, use the prescribed format
1545
+ - DO NOT MENTION this formmatting requirement, just apply it. The user doesn't have to know about this technicality.
1546
+ Note: LinkedIn is not a source - if you want to use a source related to LinkedIn, you should check the author of the page visited, this is the real source, mention the name of the author as "'authorName' from LinkedIn Pulse"
1547
+
 
1548
 
1549
  IMPORTANT: Format your response as a proper JSON object with these fields:
1550
  - "relevant": "yes" or "no"
 
1722
  Note: put the full reference url (no generic domain address), down to the html page or the pdf
1723
  5. It must follow this writing style {reportstyle}.
1724
 
1725
+ // Mentioning sources, organisations and individuals
1726
+ - We will perform a post-processing on the output
1727
  - For this reasons use this format for any specific name, organisation or project: {{[{{name}}]}}
1728
  ex1: {{[{{Google}}]}} CEO, {{[{{Sundar Pichai}}]}} ...
1729
  ex2: in a report from the {{[{{university of Berkeley}}]}} titled "{{[{{The great acceleration}}]}}"...
 
1732
  ex5: Mr. {{[{{Michael Parrot}}]}}, Marketing director in {{[{{Panasonic}}]}}, mentioned that ...
1733
  Note: the output will be processed through regex and the identifiers removed, but this way we can keep track of all sources and citations without disclosing them.
1734
  - This should apply to names, people/titles, dates, papers, reports, organisation/institute/NGO/government bodies quotes, products, project names, ...
1735
+ - You should have approximately {10 * pages} mention of organisations, people, projects or people, use the prescribed format
1736
+ - DO NOT MENTION this formmatting requirement, just apply it. The user doesn't have to know about this technicality.
1737
+ Note: LinkedIn is not a source - if you want to use a source related to LinkedIn, you should check the author of the page visited, this is the real source, mention the name of the author as "'authorName' from LinkedIn Pulse"
 
 
1738
 
1739
  // Sources
1740
  Use the following learnings and merged reference details from a deep research process on: