symbolicai 1.0.0__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. symai/__init__.py +198 -134
  2. symai/backend/base.py +51 -51
  3. symai/backend/engines/drawing/engine_bfl.py +33 -33
  4. symai/backend/engines/drawing/engine_gpt_image.py +4 -10
  5. symai/backend/engines/embedding/engine_llama_cpp.py +50 -35
  6. symai/backend/engines/embedding/engine_openai.py +22 -16
  7. symai/backend/engines/execute/engine_python.py +16 -16
  8. symai/backend/engines/files/engine_io.py +51 -49
  9. symai/backend/engines/imagecaptioning/engine_blip2.py +27 -23
  10. symai/backend/engines/imagecaptioning/engine_llavacpp_client.py +53 -46
  11. symai/backend/engines/index/engine_pinecone.py +116 -88
  12. symai/backend/engines/index/engine_qdrant.py +1011 -0
  13. symai/backend/engines/index/engine_vectordb.py +78 -52
  14. symai/backend/engines/lean/engine_lean4.py +65 -25
  15. symai/backend/engines/neurosymbolic/__init__.py +28 -28
  16. symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_chat.py +137 -135
  17. symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_reasoning.py +145 -152
  18. symai/backend/engines/neurosymbolic/engine_cerebras.py +328 -0
  19. symai/backend/engines/neurosymbolic/engine_deepseekX_reasoning.py +75 -49
  20. symai/backend/engines/neurosymbolic/engine_google_geminiX_reasoning.py +199 -155
  21. symai/backend/engines/neurosymbolic/engine_groq.py +106 -72
  22. symai/backend/engines/neurosymbolic/engine_huggingface.py +100 -67
  23. symai/backend/engines/neurosymbolic/engine_llama_cpp.py +121 -93
  24. symai/backend/engines/neurosymbolic/engine_openai_gptX_chat.py +213 -132
  25. symai/backend/engines/neurosymbolic/engine_openai_gptX_reasoning.py +180 -137
  26. symai/backend/engines/ocr/engine_apilayer.py +18 -20
  27. symai/backend/engines/output/engine_stdout.py +9 -9
  28. symai/backend/engines/{webscraping → scrape}/engine_requests.py +25 -11
  29. symai/backend/engines/search/engine_openai.py +95 -83
  30. symai/backend/engines/search/engine_parallel.py +665 -0
  31. symai/backend/engines/search/engine_perplexity.py +40 -41
  32. symai/backend/engines/search/engine_serpapi.py +33 -28
  33. symai/backend/engines/speech_to_text/engine_local_whisper.py +37 -27
  34. symai/backend/engines/symbolic/engine_wolframalpha.py +14 -8
  35. symai/backend/engines/text_to_speech/engine_openai.py +15 -19
  36. symai/backend/engines/text_vision/engine_clip.py +34 -28
  37. symai/backend/engines/userinput/engine_console.py +3 -4
  38. symai/backend/mixin/anthropic.py +48 -40
  39. symai/backend/mixin/deepseek.py +4 -5
  40. symai/backend/mixin/google.py +5 -4
  41. symai/backend/mixin/groq.py +2 -4
  42. symai/backend/mixin/openai.py +132 -110
  43. symai/backend/settings.py +14 -14
  44. symai/chat.py +164 -94
  45. symai/collect/dynamic.py +13 -11
  46. symai/collect/pipeline.py +39 -31
  47. symai/collect/stats.py +109 -69
  48. symai/components.py +556 -238
  49. symai/constraints.py +14 -5
  50. symai/core.py +1495 -1210
  51. symai/core_ext.py +55 -50
  52. symai/endpoints/api.py +113 -58
  53. symai/extended/api_builder.py +22 -17
  54. symai/extended/arxiv_pdf_parser.py +13 -5
  55. symai/extended/bibtex_parser.py +8 -4
  56. symai/extended/conversation.py +88 -69
  57. symai/extended/document.py +40 -27
  58. symai/extended/file_merger.py +45 -7
  59. symai/extended/graph.py +38 -24
  60. symai/extended/html_style_template.py +17 -11
  61. symai/extended/interfaces/blip_2.py +1 -1
  62. symai/extended/interfaces/clip.py +4 -2
  63. symai/extended/interfaces/console.py +5 -3
  64. symai/extended/interfaces/dall_e.py +3 -1
  65. symai/extended/interfaces/file.py +2 -0
  66. symai/extended/interfaces/flux.py +3 -1
  67. symai/extended/interfaces/gpt_image.py +15 -6
  68. symai/extended/interfaces/input.py +2 -1
  69. symai/extended/interfaces/llava.py +1 -1
  70. symai/extended/interfaces/{naive_webscraping.py → naive_scrape.py} +3 -2
  71. symai/extended/interfaces/naive_vectordb.py +2 -2
  72. symai/extended/interfaces/ocr.py +4 -2
  73. symai/extended/interfaces/openai_search.py +2 -0
  74. symai/extended/interfaces/parallel.py +30 -0
  75. symai/extended/interfaces/perplexity.py +2 -0
  76. symai/extended/interfaces/pinecone.py +6 -4
  77. symai/extended/interfaces/python.py +2 -0
  78. symai/extended/interfaces/serpapi.py +2 -0
  79. symai/extended/interfaces/terminal.py +0 -1
  80. symai/extended/interfaces/tts.py +2 -1
  81. symai/extended/interfaces/whisper.py +2 -1
  82. symai/extended/interfaces/wolframalpha.py +1 -0
  83. symai/extended/metrics/__init__.py +1 -1
  84. symai/extended/metrics/similarity.py +5 -2
  85. symai/extended/os_command.py +31 -22
  86. symai/extended/packages/symdev.py +39 -34
  87. symai/extended/packages/sympkg.py +30 -27
  88. symai/extended/packages/symrun.py +46 -35
  89. symai/extended/repo_cloner.py +10 -9
  90. symai/extended/seo_query_optimizer.py +15 -12
  91. symai/extended/solver.py +104 -76
  92. symai/extended/summarizer.py +8 -7
  93. symai/extended/taypan_interpreter.py +10 -9
  94. symai/extended/vectordb.py +28 -15
  95. symai/formatter/formatter.py +39 -31
  96. symai/formatter/regex.py +46 -44
  97. symai/functional.py +184 -86
  98. symai/imports.py +85 -51
  99. symai/interfaces.py +1 -1
  100. symai/memory.py +33 -24
  101. symai/menu/screen.py +28 -19
  102. symai/misc/console.py +27 -27
  103. symai/misc/loader.py +4 -3
  104. symai/models/base.py +147 -76
  105. symai/models/errors.py +1 -1
  106. symai/ops/__init__.py +1 -1
  107. symai/ops/measures.py +17 -14
  108. symai/ops/primitives.py +933 -635
  109. symai/post_processors.py +28 -24
  110. symai/pre_processors.py +58 -52
  111. symai/processor.py +15 -9
  112. symai/prompts.py +714 -649
  113. symai/server/huggingface_server.py +115 -32
  114. symai/server/llama_cpp_server.py +14 -6
  115. symai/server/qdrant_server.py +206 -0
  116. symai/shell.py +98 -39
  117. symai/shellsv.py +307 -223
  118. symai/strategy.py +135 -81
  119. symai/symbol.py +276 -225
  120. symai/utils.py +62 -46
  121. {symbolicai-1.0.0.dist-info → symbolicai-1.1.0.dist-info}/METADATA +19 -9
  122. symbolicai-1.1.0.dist-info/RECORD +168 -0
  123. symbolicai-1.0.0.dist-info/RECORD +0 -163
  124. {symbolicai-1.0.0.dist-info → symbolicai-1.1.0.dist-info}/WHEEL +0 -0
  125. {symbolicai-1.0.0.dist-info → symbolicai-1.1.0.dist-info}/entry_points.txt +0 -0
  126. {symbolicai-1.0.0.dist-info → symbolicai-1.1.0.dist-info}/licenses/LICENSE +0 -0
  127. {symbolicai-1.0.0.dist-info → symbolicai-1.1.0.dist-info}/top_level.txt +0 -0
symai/prompts.py CHANGED
@@ -8,7 +8,7 @@ from .utils import UserMessage
8
8
 
9
9
 
10
10
  class Prompt:
11
- stop_token = 'EOF'
11
+ stop_token = "EOF"
12
12
 
13
13
  def __init__(self, value, **format_kwargs):
14
14
  super().__init__()
@@ -45,19 +45,21 @@ class Prompt:
45
45
  return self.value
46
46
 
47
47
  def __str__(self) -> str:
48
- val_ = '\n'.join([str(p) for p in self.value])
48
+ val_ = "\n".join([str(p) for p in self.value])
49
49
  for p in self.dynamic_value:
50
- val_ += f'\n{p}'
50
+ val_ += f"\n{p}"
51
51
  if len(self.format_kwargs) > 0:
52
52
  for k, v in self.format_kwargs.items():
53
- template_ = '{'+k+'}'
53
+ template_ = "{" + k + "}"
54
54
  count = val_.count(template_)
55
55
  if count <= 0:
56
56
  msg = f"Template property `{k}` not found."
57
57
  UserMessage(msg)
58
58
  raise TemplatePropertyException(msg)
59
59
  if count > 1:
60
- msg = f"Template property {k} found multiple times ({count}), expected only once."
60
+ msg = (
61
+ f"Template property {k} found multiple times ({count}), expected only once."
62
+ )
61
63
  UserMessage(msg)
62
64
  raise TemplatePropertyException(msg)
63
65
  if v is None:
@@ -114,15 +116,11 @@ class PromptRegistry:
114
116
  cls._instance._default_language = PromptLanguage.ENGLISH
115
117
  cls._instance._default_model = ModelName.ALL
116
118
  cls._instance._model_fallback = True
117
- cls._instance._prompt_values = {
118
- ModelName.ALL: {PromptLanguage.ENGLISH: {}}
119
- }
119
+ cls._instance._prompt_values = {ModelName.ALL: {PromptLanguage.ENGLISH: {}}}
120
120
  cls._instance._prompt_instructions = {
121
121
  ModelName.ALL: {PromptLanguage.ENGLISH: {}}
122
122
  }
123
- cls._instance._prompt_tags = {
124
- ModelName.ALL: {PromptLanguage.ENGLISH: {}}
125
- }
123
+ cls._instance._prompt_tags = {ModelName.ALL: {PromptLanguage.ENGLISH: {}}}
126
124
  return cls._instance
127
125
 
128
126
  @property
@@ -163,17 +161,11 @@ class PromptRegistry:
163
161
 
164
162
  return model, lang
165
163
 
166
- def _retrieve_value(
167
- self, dictionary, model: ModelName, lang: PromptLanguage, key: str
168
- ):
164
+ def _retrieve_value(self, dictionary, model: ModelName, lang: PromptLanguage, key: str):
169
165
  model = model if model is not None else self._default_model
170
166
  lang = lang if lang is not None else self._default_language
171
167
 
172
- if (
173
- model in dictionary
174
- and lang in dictionary[model]
175
- and key in dictionary[model][lang]
176
- ):
168
+ if model in dictionary and lang in dictionary[model] and key in dictionary[model][lang]:
177
169
  return dictionary[model][lang][key]
178
170
  if self._model_fallback and model != ModelName.ALL:
179
171
  return self._retrieve_value(dictionary, ModelName.ALL, lang, key)
@@ -209,16 +201,11 @@ class PromptRegistry:
209
201
  with self._lock:
210
202
  model, lang = self._init_model_lang(model, lang)
211
203
  if delimiters is not None:
212
- self._prompt_tags[model][lang][key] = {
213
- 'tag': tag,
214
- 'delimiters': delimiters
215
- }
204
+ self._prompt_tags[model][lang][key] = {"tag": tag, "delimiters": delimiters}
216
205
  else:
217
206
  self._prompt_tags[model][lang][key] = tag
218
207
 
219
- def value(
220
- self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None
221
- ) -> str:
208
+ def value(self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None) -> str:
222
209
  return self._retrieve_value(self._prompt_values, model, lang, key)
223
210
 
224
211
  def instruction(
@@ -232,9 +219,9 @@ class PromptRegistry:
232
219
  tag_data = self._retrieve_value(self._prompt_tags, model, lang, key)
233
220
 
234
221
  if isinstance(tag_data, dict):
235
- tag_value = tag_data['tag']
222
+ tag_value = tag_data["tag"]
236
223
  if format:
237
- prefix, suffix = tag_data['delimiters']
224
+ prefix, suffix = tag_data["delimiters"]
238
225
  return f"{prefix}{tag_value}{suffix}"
239
226
  return tag_value
240
227
 
@@ -242,9 +229,7 @@ class PromptRegistry:
242
229
  return f"{self._tag_prefix}{tag_data}{self._tag_suffix}"
243
230
  return tag_data
244
231
 
245
- def has_value(
246
- self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None
247
- ) -> bool:
232
+ def has_value(self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None) -> bool:
248
233
  try:
249
234
  value = self._retrieve_value(self._prompt_values, model, lang, key)
250
235
  return value is not None
@@ -260,9 +245,7 @@ class PromptRegistry:
260
245
  except ValueError:
261
246
  return False
262
247
 
263
- def has_tag(
264
- self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None
265
- ) -> bool:
248
+ def has_tag(self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None) -> bool:
266
249
  try:
267
250
  value = self._retrieve_value(self._prompt_tags, model, lang, key)
268
251
  return value is not None
@@ -296,380 +279,416 @@ class JsonPromptTemplate(Prompt):
296
279
 
297
280
  class FuzzyEquals(Prompt):
298
281
  def __init__(self):
299
- super().__init__([
300
- "1 == 'ONE' =>True",
301
- "6.0 == 6 =>True",
302
- "'false' == False =>True",
303
- "1 == 'two' =>False",
304
- "'five' == 5 =>True",
305
- "'August 4, 1961' == '1961-08-04' =>True",
306
- "'ten' == 10 =>True",
307
- "3 == 'three' =>True",
308
- "'apple' == 'orange' =>False",
309
- "'is short' == '\nshort' =>True",
310
- "'' == 'empty' =>True",
311
- "'human' == 'homo sapiens' =>True",
312
- "'seven' == 'Sieben' =>True",
313
- "'Neun' == 9 =>True",
314
- "'' == 7 =>True",
315
- "'!ola mundo;' == 'ola mundo' =>True",
316
- "'eleven' == 'Elf' =>True",
317
- "'eleven' <= 8 =>False",
318
- "'eleven' <= 11 =>True",
319
- "'helloworld' == 'Hello World' =>True",
320
- "'hola mundo' == 'Hello World' =>True",
321
- "'adios mundo' == 'Hello World' =>False",
322
- "'Hello World' == 'Apples' =>False",
323
- "'a, b, c, d' == ['a', 'b', 'c', 'd'] =>True",
324
- "'a, c, d' == ['a', 'c', 'd'] =>True",
325
- "'a, c, d' == ['d', 'c', 'a'] =>False",
326
- "['zz', 'yy', 'xx'] == 'zz, yy, xx' =>True",
327
- "['zz', 'yy', 'xx'] == 'zz | yy | xx' =>True",
328
- "['zz', 'yy', 'xx'] == 'ZZ | YY | XX' =>True",
329
- "'House, Mouse, CARS' == 'house | mouse | cars' =>True",
330
- "'we hav teh most efective systeem in the citi.' == 'We have the most effective system in the city.' =>True",
331
- "'[SEMANTIC_PROGRAMMING]' == 'semantic programming' =>True",
332
- "'e' == 'constant' =>True",
333
- "'e' == '2.718...' =>True",
334
- "1/3 == '0.30...' =>False"
335
- ])
282
+ super().__init__(
283
+ [
284
+ "1 == 'ONE' =>True",
285
+ "6.0 == 6 =>True",
286
+ "'false' == False =>True",
287
+ "1 == 'two' =>False",
288
+ "'five' == 5 =>True",
289
+ "'August 4, 1961' == '1961-08-04' =>True",
290
+ "'ten' == 10 =>True",
291
+ "3 == 'three' =>True",
292
+ "'apple' == 'orange' =>False",
293
+ "'is short' == '\nshort' =>True",
294
+ "'' == 'empty' =>True",
295
+ "'human' == 'homo sapiens' =>True",
296
+ "'seven' == 'Sieben' =>True",
297
+ "'Neun' == 9 =>True",
298
+ "'' == 7 =>True",
299
+ "'!ola mundo;' == 'ola mundo' =>True",
300
+ "'eleven' == 'Elf' =>True",
301
+ "'eleven' <= 8 =>False",
302
+ "'eleven' <= 11 =>True",
303
+ "'helloworld' == 'Hello World' =>True",
304
+ "'hola mundo' == 'Hello World' =>True",
305
+ "'adios mundo' == 'Hello World' =>False",
306
+ "'Hello World' == 'Apples' =>False",
307
+ "'a, b, c, d' == ['a', 'b', 'c', 'd'] =>True",
308
+ "'a, c, d' == ['a', 'c', 'd'] =>True",
309
+ "'a, c, d' == ['d', 'c', 'a'] =>False",
310
+ "['zz', 'yy', 'xx'] == 'zz, yy, xx' =>True",
311
+ "['zz', 'yy', 'xx'] == 'zz | yy | xx' =>True",
312
+ "['zz', 'yy', 'xx'] == 'ZZ | YY | XX' =>True",
313
+ "'House, Mouse, CARS' == 'house | mouse | cars' =>True",
314
+ "'we hav teh most efective systeem in the citi.' == 'We have the most effective system in the city.' =>True",
315
+ "'[SEMANTIC_PROGRAMMING]' == 'semantic programming' =>True",
316
+ "'e' == 'constant' =>True",
317
+ "'e' == '2.718...' =>True",
318
+ "1/3 == '0.30...' =>False",
319
+ ]
320
+ )
336
321
 
337
322
 
338
323
  class SufficientInformation(Prompt):
339
324
  def __init__(self):
340
- super().__init__([
341
- "query 'What is the capital of Austria?' content 'Vienna is the capital, largest city, and one of nine states of Austria.' =>True",
342
- "query 'Where am I? content '' =>False",
343
- "query 'Where was Sepp Hochreiter born?' content 'Josef „Sepp“ Hochreiter (* 14. Februar 1967 in Mühldorf am Inn, Bayern[1]) ist ein deutscher Informatiker.' =>True",
344
- "query 'Why is the sky blue?' content 'A rainbow is a meteorological phenomenon that is caused by reflection, refraction and dispersion of light in water droplets resulting in a spectrum of light appearing in the sky.' =>False",
345
- "query 'When is the next full moon?' content 'Today is the 29th of February 2020. The next full moon will be on the 9th of April 2020.' =>True",
346
- "query 'Who is the current president of the United States?' content 'The 2020 United States presidential election was the 59th quadrennial presidential election, held on Tuesday, November 3, 2020.' =>False",
347
- ])
325
+ super().__init__(
326
+ [
327
+ "query 'What is the capital of Austria?' content 'Vienna is the capital, largest city, and one of nine states of Austria.' =>True",
328
+ "query 'Where am I? content '' =>False",
329
+ "query 'Where was Sepp Hochreiter born?' content 'Josef „Sepp“ Hochreiter (* 14. Februar 1967 in Mühldorf am Inn, Bayern[1]) ist ein deutscher Informatiker.' =>True",
330
+ "query 'Why is the sky blue?' content 'A rainbow is a meteorological phenomenon that is caused by reflection, refraction and dispersion of light in water droplets resulting in a spectrum of light appearing in the sky.' =>False",
331
+ "query 'When is the next full moon?' content 'Today is the 29th of February 2020. The next full moon will be on the 9th of April 2020.' =>True",
332
+ "query 'Who is the current president of the United States?' content 'The 2020 United States presidential election was the 59th quadrennial presidential election, held on Tuesday, November 3, 2020.' =>False",
333
+ ]
334
+ )
348
335
 
349
336
 
350
337
  class Modify(Prompt):
351
338
  def __init__(self):
352
- super().__init__([
353
- "text 'The quick brown fox jumps over the lazy dog.' modify 'fox to hours' =>The quick brown hours jumps over the lazy dog.",
354
- "text 'My cats name is Pucki' modify 'all caps' =>MY CATS NAME IS PUCKI",
355
- "text 'The square root of pi is 1.77245...' modify 'text to latex formula' =>$\sqrt[2]{\pi}=1.77245\dots$",
356
- "text 'I hate this fucking product so much, because it lag's all the time.' modify 'curse words with neutral formulation' =>I hate this product since it lag's all the time.",
357
- "text 'Hi, whats up? Our new products is awesome with a blasting set of features.' modify 'improve politeness and text quality' =>Dear Sir or Madam, I hope you are doing well. Let me introduce our new products with a fantastic set of new features.",
358
- "text 'Microsoft release a new chat bot API to enable human to machine translation.' modify 'language to German' =>Microsoft veröffentlicht eine neue Chat-Bot-API, um die Übersetzung von Mensch zu Maschine zu ermöglichen.",
359
- """text '{\n "name": "Manual Game",\n "type": "python",\n "request": "launch",\n "program": "${workspaceFolder}/envs/textgrid.py",\n "cwd": "${workspaceFolder}",\n "args": [\n "--debug"\n ],\n "env": {\n "PYTHONPATH": "."\n }\n}' modify 'json to yaml' =>name: Manual Game\ntype: python\nrequest: launch\nprogram: ${workspaceFolder}/envs/textgrid.py\ncwd: ${workspaceFolder}\nargs:\n - '--debug'\nenv:\n PYTHONPATH: .""",
360
- ])
339
+ super().__init__(
340
+ [
341
+ "text 'The quick brown fox jumps over the lazy dog.' modify 'fox to hours' =>The quick brown hours jumps over the lazy dog.",
342
+ "text 'My cats name is Pucki' modify 'all caps' =>MY CATS NAME IS PUCKI",
343
+ "text 'The square root of pi is 1.77245...' modify 'text to latex formula' =>$\sqrt[2]{\pi}=1.77245\dots$",
344
+ "text 'I hate this fucking product so much, because it lag's all the time.' modify 'curse words with neutral formulation' =>I hate this product since it lag's all the time.",
345
+ "text 'Hi, whats up? Our new products is awesome with a blasting set of features.' modify 'improve politeness and text quality' =>Dear Sir or Madam, I hope you are doing well. Let me introduce our new products with a fantastic set of new features.",
346
+ "text 'Microsoft release a new chat bot API to enable human to machine translation.' modify 'language to German' =>Microsoft veröffentlicht eine neue Chat-Bot-API, um die Übersetzung von Mensch zu Maschine zu ermöglichen.",
347
+ """text '{\n "name": "Manual Game",\n "type": "python",\n "request": "launch",\n "program": "${workspaceFolder}/envs/textgrid.py",\n "cwd": "${workspaceFolder}",\n "args": [\n "--debug"\n ],\n "env": {\n "PYTHONPATH": "."\n }\n}' modify 'json to yaml' =>name: Manual Game\ntype: python\nrequest: launch\nprogram: ${workspaceFolder}/envs/textgrid.py\ncwd: ${workspaceFolder}\nargs:\n - '--debug'\nenv:\n PYTHONPATH: .""",
348
+ ]
349
+ )
361
350
 
362
351
 
363
352
  class Filter(Prompt):
364
353
  def __init__(self):
365
- super().__init__([
366
- "text '['1', '7', '10', '-1', '177']' remove 'values larger or equal to 10' =>['1', '7', '-1']",
367
- "text '['1', '7', '10', '-1', '177']' include 'values larger or equal to 10' =>['10', '177']",
368
- "text '['1', '7', '10', '-1', '177']' remove 'values larger or equal to 10' =>['1', '7', '-1']",
369
- "text 'Our goal is to excels in the market. We offer various subscriptions, including PRO, Licensing & Reprints, Councils and Supply Chain Values. Join our team of experts.' remove 'sentences about subscriptions or licensing' =>Our goal is to excels in the market. Join our team of experts."
370
- "text 'In our meeting we had many participants. For example, Alice, Alan, Mark, Judi, Amber, and so on.' remove 'names starting with A' =>In our meeting we had many participants. For example, Mark, Judi, and so on.",
371
- "text 'I am Batman! I will show you pain.' remove 'spaces' =>IamBatman!Iwillshowyoupain.",
372
- "text 'I am Batman! I will show you pain.' include 'only sentence with Batman' =>I am Batman!",
373
- "text 'You are a good person. I like you.' remove 'punctuation' =>You are a good person I like you",
374
- "text '['- world cup 2022', '- Technology trend', '- artificial intelligence news']' include 'tech news' =>['- Technology trend', '- artificial intelligence news']",
375
- "text '['- world cup 2022', '- Technology trend', '- artificial intelligence news']' remove 'tech news' =>['- world cup 2022']",
376
- "text 'This is a test. This is only a test. This is a Test.' remove 'duplicates' =>This is a test.",
377
- "text 'Fuck you, you dumb asshole. I will change my job.' remove 'negative words' =>I will change my job.",
378
- "text 'The quick brown fox jumps over the lazy dog.' remove 'all e letters' =>Th quick brown fox jumps ovr th lazy dog.",
379
- "text 'Hi, mate! How are you?' remove 'greeting' =>How are you?",
380
- "text 'Hi, mate! How are you?' include 'only questions' =>How are you?",
381
- "text 'fetch logs | fields timestamp, severity, logfile, message, container | fieldsAdd severity = lower(loglevel)' remove 'fieldsAdd' =>fetch logs | fields timestamp, severity, logfile, message, container",
382
- ])
354
+ super().__init__(
355
+ [
356
+ "text '['1', '7', '10', '-1', '177']' remove 'values larger or equal to 10' =>['1', '7', '-1']",
357
+ "text '['1', '7', '10', '-1', '177']' include 'values larger or equal to 10' =>['10', '177']",
358
+ "text '['1', '7', '10', '-1', '177']' remove 'values larger or equal to 10' =>['1', '7', '-1']",
359
+ "text 'Our goal is to excels in the market. We offer various subscriptions, including PRO, Licensing & Reprints, Councils and Supply Chain Values. Join our team of experts.' remove 'sentences about subscriptions or licensing' =>Our goal is to excels in the market. Join our team of experts."
360
+ "text 'In our meeting we had many participants. For example, Alice, Alan, Mark, Judi, Amber, and so on.' remove 'names starting with A' =>In our meeting we had many participants. For example, Mark, Judi, and so on.",
361
+ "text 'I am Batman! I will show you pain.' remove 'spaces' =>IamBatman!Iwillshowyoupain.",
362
+ "text 'I am Batman! I will show you pain.' include 'only sentence with Batman' =>I am Batman!",
363
+ "text 'You are a good person. I like you.' remove 'punctuation' =>You are a good person I like you",
364
+ "text '['- world cup 2022', '- Technology trend', '- artificial intelligence news']' include 'tech news' =>['- Technology trend', '- artificial intelligence news']",
365
+ "text '['- world cup 2022', '- Technology trend', '- artificial intelligence news']' remove 'tech news' =>['- world cup 2022']",
366
+ "text 'This is a test. This is only a test. This is a Test.' remove 'duplicates' =>This is a test.",
367
+ "text 'Fuck you, you dumb asshole. I will change my job.' remove 'negative words' =>I will change my job.",
368
+ "text 'The quick brown fox jumps over the lazy dog.' remove 'all e letters' =>Th quick brown fox jumps ovr th lazy dog.",
369
+ "text 'Hi, mate! How are you?' remove 'greeting' =>How are you?",
370
+ "text 'Hi, mate! How are you?' include 'only questions' =>How are you?",
371
+ "text 'fetch logs | fields timestamp, severity, logfile, message, container | fieldsAdd severity = lower(loglevel)' remove 'fieldsAdd' =>fetch logs | fields timestamp, severity, logfile, message, container",
372
+ ]
373
+ )
383
374
 
384
375
 
385
376
  class MapExpression(Prompt):
386
377
  def __init__(self):
387
- super().__init__([
388
- "text '['apple', 'banana', 'kiwi', 'cat']' all fruits should become dogs =>['dog', 'dog', 'dog', 'cat']",
389
- "text 'this is a string' convert vowels to numbers =>'th1s 1s 4 str1ng'",
390
- "text '('small', 'tiny', 'huge', 'enormous')' convert size adjectives to numbers 1-10 =>'(2, 1, 8, 10)'",
391
- "text '{'happy', 'sad', 'angry', 'joyful'}' convert emotions to colors =>'{'yellow', 'blue', 'red', 'gold'}'",
392
- "text '{'item1': 'apple', 'item2': 'banana', 'item3': 'cat'}' convert fruits to vegetables =>'{'item1': 'carrot', 'item2': 'broccoli', 'item3': 'cat'}'",
393
- "text '[10, 20, 30, 40]' double each number =>'[20, 40, 60, 80]'",
394
- "text 'HELLO' make consonants lowercase =>'hEllO'"
395
- ])
378
+ super().__init__(
379
+ [
380
+ "text '['apple', 'banana', 'kiwi', 'cat']' all fruits should become dogs =>['dog', 'dog', 'dog', 'cat']",
381
+ "text 'this is a string' convert vowels to numbers =>'th1s 1s 4 str1ng'",
382
+ "text '('small', 'tiny', 'huge', 'enormous')' convert size adjectives to numbers 1-10 =>'(2, 1, 8, 10)'",
383
+ "text '{'happy', 'sad', 'angry', 'joyful'}' convert emotions to colors =>'{'yellow', 'blue', 'red', 'gold'}'",
384
+ "text '{'item1': 'apple', 'item2': 'banana', 'item3': 'cat'}' convert fruits to vegetables =>'{'item1': 'carrot', 'item2': 'broccoli', 'item3': 'cat'}'",
385
+ "text '[10, 20, 30, 40]' double each number =>'[20, 40, 60, 80]'",
386
+ "text 'HELLO' make consonants lowercase =>'hEllO'",
387
+ ]
388
+ )
396
389
 
397
390
 
398
391
  class SemanticMapping(Prompt):
399
392
  def __init__(self):
400
- super().__init__([
401
- """topics: ['animals', 'logic', 'mathematics', 'psychology', 'self-driving'] in
393
+ super().__init__(
394
+ [
395
+ """topics: ['animals', 'logic', 'mathematics', 'psychology', 'self-driving'] in
402
396
  text: 'Common connectives include negation, disjunction, conjunction, and implication. In standard systems of classical logic, these connectives are interpreted as truth functions, though they receive a variety of alternative interpretations in nonclassical logics.' =>logic | mathematics
403
397
  topics: ['cities', 'Apple Inc.', 'science', 'culture', 'USA', 'Japan', 'music', 'economy'] in
404
398
  Los Angeles has a diverse economy, and hosts businesses in a broad range of professional and cultural fields. It also has the busiest container port in the Americas. In 2018, the Los Angeles metropolitan area had a gross metropolitan product of over $1.0 trillion, making it the city with the third-largest GDP in the world, after New York City and Tokyo. =>cities | culture | USA | economy
405
399
  """
406
- ])
400
+ ]
401
+ )
407
402
 
408
403
 
409
404
  class Format(Prompt):
410
405
  def __init__(self):
411
- super().__init__([
412
- "text 1 format 'number to text' =>one",
413
- "text 'apple' format 'company' =>Apple Inc.",
414
- "text 'fetch logs\n| fields timestamp, severity\n| fieldsAdd severity = lower(loglevel)' format 'Japanese' =>fetch ログ\n| fields タイムスタンプ、重大度\n| fieldsAdd 重大度 = lower(ログレベル)",
415
- "text 'Hi mate, how are you?' format 'emoji' =>Hi mate, how are you? 😊",
416
- "text 'Hi mate, how are you?' format 'Italian' =>Ciao amico, come stai?",
417
- "text 'Sorry, everyone. But I will not be able to join today.' format 'japanese' =>すみません、皆さん。でも、今日は参加できません。"
418
- "text 'Sorry, everyone. But I will not be able to join today.' format 'japanese romanji' =>Sumimasen, minasan. Demo, kyō wa sanka dekimasen."
419
- "text 'April 1, 2020' format 'EU date' =>01.04.2020",
420
- "text '23' format 'binary' =>10111",
421
- "text '77' format 'hexadecimal' =>0x4D",
422
- """text '{\n "name": "Manual Game",\n "type": "python",\n "request": "launch",\n "program": "${workspaceFolder}/envs/textgrid.py",\n "cwd": "${workspaceFolder}",\n "args": [\n "--debug"\n ],\n "env": {\n "PYTHONPATH": "."\n }\n}' format 'yaml' =>name: Manual Game\ntype: python\nrequest: launch\nprogram: ${workspaceFolder}/envs/textgrid.py\ncwd: ${workspaceFolder}\nargs:\n - '--debug'\nenv:\n PYTHONPATH: .""",
423
- ])
406
+ super().__init__(
407
+ [
408
+ "text 1 format 'number to text' =>one",
409
+ "text 'apple' format 'company' =>Apple Inc.",
410
+ "text 'fetch logs\n| fields timestamp, severity\n| fieldsAdd severity = lower(loglevel)' format 'Japanese' =>fetch ログ\n| fields タイムスタンプ、重大度\n| fieldsAdd 重大度 = lower(ログレベル)",
411
+ "text 'Hi mate, how are you?' format 'emoji' =>Hi mate, how are you? 😊",
412
+ "text 'Hi mate, how are you?' format 'Italian' =>Ciao amico, come stai?",
413
+ "text 'Sorry, everyone. But I will not be able to join today.' format 'japanese' =>すみません、皆さん。でも、今日は参加できません。"
414
+ "text 'Sorry, everyone. But I will not be able to join today.' format 'japanese romanji' =>Sumimasen, minasan. Demo, kyō wa sanka dekimasen."
415
+ "text 'April 1, 2020' format 'EU date' =>01.04.2020",
416
+ "text '23' format 'binary' =>10111",
417
+ "text '77' format 'hexadecimal' =>0x4D",
418
+ """text '{\n "name": "Manual Game",\n "type": "python",\n "request": "launch",\n "program": "${workspaceFolder}/envs/textgrid.py",\n "cwd": "${workspaceFolder}",\n "args": [\n "--debug"\n ],\n "env": {\n "PYTHONPATH": "."\n }\n}' format 'yaml' =>name: Manual Game\ntype: python\nrequest: launch\nprogram: ${workspaceFolder}/envs/textgrid.py\ncwd: ${workspaceFolder}\nargs:\n - '--debug'\nenv:\n PYTHONPATH: .""",
419
+ ]
420
+ )
424
421
 
425
422
 
426
423
  class Transcription(Prompt):
427
424
  def __init__(self):
428
- super().__init__([
429
- "text 'I once saw 1 cat and 2 dogs jumping around' modify only 'numbers to text' =>I once saw one cat two dogs jumping around",
430
- "text 'fetch logs\n| fields timestamp, severity\n| fieldsAdd severity = lower(loglevel)' modify only 'to Japanese language' =>fetch ログ\n| fields タイムスタンプ、重大度\n| fieldsAdd 重大度 = lower(ログレベル)",
431
- "text 'April 1, 2020 is the beginning of a new era.\nSeveral companies ...' modify only 'EU date' =>The 01.04.2020 is the beginning of a new era.\nSeveral companies ...",
432
- "text '23' modify only 'binary' =>10111",
433
- "text 'In the _init_ function, the custom model takes in a configuration object (config) and a pre-trained Segformer model (seg_model)' modify only 'markdown formatting using ` for variables and classes' =>In the `__init__` function, the custom model takes in a configuration object (`config`) and a pre-trained `Segformer` model (`seg_model`)",
434
- ])
425
+ super().__init__(
426
+ [
427
+ "text 'I once saw 1 cat and 2 dogs jumping around' modify only 'numbers to text' =>I once saw one cat two dogs jumping around",
428
+ "text 'fetch logs\n| fields timestamp, severity\n| fieldsAdd severity = lower(loglevel)' modify only 'to Japanese language' =>fetch ログ\n| fields タイムスタンプ、重大度\n| fieldsAdd 重大度 = lower(ログレベル)",
429
+ "text 'April 1, 2020 is the beginning of a new era.\nSeveral companies ...' modify only 'EU date' =>The 01.04.2020 is the beginning of a new era.\nSeveral companies ...",
430
+ "text '23' modify only 'binary' =>10111",
431
+ "text 'In the _init_ function, the custom model takes in a configuration object (config) and a pre-trained Segformer model (seg_model)' modify only 'markdown formatting using ` for variables and classes' =>In the `__init__` function, the custom model takes in a configuration object (`config`) and a pre-trained `Segformer` model (`seg_model`)",
432
+ ]
433
+ )
435
434
 
436
435
 
437
436
  class ExceptionMapping(Prompt):
438
437
  def __init__(self):
439
- super().__init__([
440
- """context 'Try to assure that variable "a" is not zero.' exception 'Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\nZeroDivisionError: division by zero' code 'def function():\n return (1 + 1) / 0' =>Do not divide by zero or add an epsilon value. | def function(eps=1e-8):\n return (1 + 1) / eps""",
441
- """context 'Make sure to initialize 'spam' before computation' exception 'Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\nNameError: name 'spam' is not defined' code '4 + spam*3' =>Check if the variable is defined before using it. | spam = 1\n4 + spam*3""",
442
- """context 'You are passing string literals to device. They should be int.' exception 'executing finally clause\nTraceback (most recent call last):\n File "<stdin>", line 1, in <module>\n File "<stdin>", line 3, in divide\nTypeError: unsupported operand type(s) for /: 'str' and 'str'' code 'device("2", "1")' =>Check if the arguments are of the correct type. If not cast them properly. | device(2, 1)""",
443
- ])
438
+ super().__init__(
439
+ [
440
+ """context 'Try to assure that variable "a" is not zero.' exception 'Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\nZeroDivisionError: division by zero' code 'def function():\n return (1 + 1) / 0' =>Do not divide by zero or add an epsilon value. | def function(eps=1e-8):\n return (1 + 1) / eps""",
441
+ """context 'Make sure to initialize 'spam' before computation' exception 'Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\nNameError: name 'spam' is not defined' code '4 + spam*3' =>Check if the variable is defined before using it. | spam = 1\n4 + spam*3""",
442
+ """context 'You are passing string literals to device. They should be int.' exception 'executing finally clause\nTraceback (most recent call last):\n File "<stdin>", line 1, in <module>\n File "<stdin>", line 3, in divide\nTypeError: unsupported operand type(s) for /: 'str' and 'str'' code 'device("2", "1")' =>Check if the arguments are of the correct type. If not cast them properly. | device(2, 1)""",
443
+ ]
444
+ )
444
445
 
445
446
 
446
447
  class ExecutionCorrection(Prompt):
447
448
  def __init__(self):
448
- super().__init__([
449
- """context "ValueError: invalid literal for int() with base 10: '4,'" "Verify if the literal is of type int | int(4)" code "a = int('4,')" =>int(4)""",
450
- """context "def function():\n return (1 + 1) / a' exception 'Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\nZeroDivisionError: division by zero" "Do not divide by zero or add an epsilon value. | def function(eps=1e-8):\n return (1 + 1) / (a + eps)" code "def function():\n return (1 + 1) / 0" =>def function(eps=1e-8):\n return (1 + 1) / (a + eps)""",
451
- ])
449
+ super().__init__(
450
+ [
451
+ """context "ValueError: invalid literal for int() with base 10: '4,'" "Verify if the literal is of type int | int(4)" code "a = int('4,')" =>int(4)""",
452
+ """context "def function():\n return (1 + 1) / a' exception 'Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\nZeroDivisionError: division by zero" "Do not divide by zero or add an epsilon value. | def function(eps=1e-8):\n return (1 + 1) / (a + eps)" code "def function():\n return (1 + 1) / 0" =>def function(eps=1e-8):\n return (1 + 1) / (a + eps)""",
453
+ ]
454
+ )
452
455
 
453
456
 
454
457
  class CompareValues(Prompt):
455
458
  def __init__(self):
456
- super().__init__([
457
- "4 > 88 =>False",
458
- "-inf < 0 =>True",
459
- "inf > 0 =>True",
460
- "1 >= 0 =>True",
461
- "6.0 < 6 =>False",
462
- "1 < 'four' =>True",
463
- "1 > 'zero' =>True",
464
- "'six' <= 6 =>True",
465
- "'six' < 6 =>False",
466
- "1 <= 2 =>True",
467
- "-1 == -2 =>False",
468
- "10 < 1 =>False",
469
- "2.000000001 >= 2 =>True",
470
- "4 > 3 =>True",
471
- "1 < 'three' =>True",
472
- "'two' > 'one' =>True",
473
- "2 < 9 =>True",
474
- "3 >= 3 =>True",
475
- "3 > 4 =>False",
476
- "11 > 10 =>True",
477
- "1.9834 >= 1.9833 =>True",
478
- "0.01 > 0.001 =>True",
479
- "0.000001 < 1 =>True",
480
- "-1000 <= -100 =>True",
481
- "-1000 < -1000 =>False",
482
- "-1000 < -10000 =>False",
483
- "1.0 < 1.0 =>False",
484
- "-1e-10 < 1e-10 =>True",
485
- "1e-4 <= -1e-5 =>False",
486
- "9.993 < 8.736 =>False",
487
- "0.27836 > 0.36663 =>False",
488
- "0.27836 > 0.2783 =>True",
489
- "0.27836 > 0.27835 =>True",
490
- "10e8 > 1000000 =>True",
491
- "1000 > 10e2 =>True",
492
- "'five' > 4 =>True",
493
- "'seven' > 'four' =>True",
494
- "'' > '' =>False",
495
- "'We are at the beginning of the ...' > 'We are' =>True",
496
- "[1, 2, 3] >= [1, 2, 2] =>True",
497
- "[1, 2, 3, 8, 9] < [1, 2, 2] =>False",
498
- "cold > hot =>False",
499
- "big > small =>True",
500
- "short > tall =>False",
501
- "fast > slow =>True",
502
- "heavy > light =>True",
503
- ])
459
+ super().__init__(
460
+ [
461
+ "4 > 88 =>False",
462
+ "-inf < 0 =>True",
463
+ "inf > 0 =>True",
464
+ "1 >= 0 =>True",
465
+ "6.0 < 6 =>False",
466
+ "1 < 'four' =>True",
467
+ "1 > 'zero' =>True",
468
+ "'six' <= 6 =>True",
469
+ "'six' < 6 =>False",
470
+ "1 <= 2 =>True",
471
+ "-1 == -2 =>False",
472
+ "10 < 1 =>False",
473
+ "2.000000001 >= 2 =>True",
474
+ "4 > 3 =>True",
475
+ "1 < 'three' =>True",
476
+ "'two' > 'one' =>True",
477
+ "2 < 9 =>True",
478
+ "3 >= 3 =>True",
479
+ "3 > 4 =>False",
480
+ "11 > 10 =>True",
481
+ "1.9834 >= 1.9833 =>True",
482
+ "0.01 > 0.001 =>True",
483
+ "0.000001 < 1 =>True",
484
+ "-1000 <= -100 =>True",
485
+ "-1000 < -1000 =>False",
486
+ "-1000 < -10000 =>False",
487
+ "1.0 < 1.0 =>False",
488
+ "-1e-10 < 1e-10 =>True",
489
+ "1e-4 <= -1e-5 =>False",
490
+ "9.993 < 8.736 =>False",
491
+ "0.27836 > 0.36663 =>False",
492
+ "0.27836 > 0.2783 =>True",
493
+ "0.27836 > 0.27835 =>True",
494
+ "10e8 > 1000000 =>True",
495
+ "1000 > 10e2 =>True",
496
+ "'five' > 4 =>True",
497
+ "'seven' > 'four' =>True",
498
+ "'' > '' =>False",
499
+ "'We are at the beginning of the ...' > 'We are' =>True",
500
+ "[1, 2, 3] >= [1, 2, 2] =>True",
501
+ "[1, 2, 3, 8, 9] < [1, 2, 2] =>False",
502
+ "cold > hot =>False",
503
+ "big > small =>True",
504
+ "short > tall =>False",
505
+ "fast > slow =>True",
506
+ "heavy > light =>True",
507
+ ]
508
+ )
504
509
 
505
510
 
506
511
  class RankList(Prompt):
507
512
  def __init__(self):
508
- super().__init__([
509
- "order: 'desc' measure: 'ASCII occurrence' list: ['b', 'a', 'z', 3, '_'] =>['_', 3, 'a', 'b', 'z']",
510
- "order: 'desc' measure: 'Value' list: ['Action: l Value: -inf', 'Action: r Value: 0.76', 'Action: u Value: 0.76', 'Action: d Value: 0.00'] =>['Action: r Value: 0.76', 'Action: u Value: 0.76', 'Action: d Value: 0.00', 'Action: l Value: -inf']",
511
- "order: 'asc' measure: 'Number' list: ['Number: -0.26', 'Number: -0.37', 'Number: 0.76', 'Number: -inf', 'Number: inf', 'Number: 0.37', 'Number: 1.0', 'Number: 100'] =>['Number: -inf', 'Number: -0.37', 'Number: -0.26', 'Number: 0.37', 'Number: 0.76', 'Number: 1.0', 'Number: 100', 'Number: inf']",
512
- "order: 'asc' measure: 'ASCII occurrence' list: ['b', 'a', 'z', 3, '_'] =>['z', 'b', 'a', 3, '_']",
513
- "order: 'desc' measure: 'length' list: [33, 'a', , 'help', 1234567890] =>['a', 33, 'help', 1234567890]",
514
- "order: 'asc' measure: 'length' list: [33, 'a', , 'help', 1234567890] =>[1234567890, 'help', 'a', 33]",
515
- "order: 'desc' measure: 'numeric size' list: [100, -1, 0, 1e-5, 1e-6] =>[100, 1e-5, 1e-6, 0, -1]",
516
- "order: 'asc' measure: 'numeric size' list: [100, -1, 0, 1e-5, 1e-6] =>[-1, 0, 1e-5, 1e-6, 100]",
517
- "order: 'desc' measure: 'fruits alphabetic' list: ['banana', 'orange', 'apple', 'pear'] =>['apple', 'banana', 'orange', 'pear']",
518
- "order: 'asc' measure: 'fruits alphabetic' list: ['banana', 'orange', 'horse', 'apple', 'pear'] =>['horse', 'pear', 'orange', 'banana', 'apple']",
519
- "order: 'desc' measure: 'HEX order in ASCII' list: [1, '1', 2, '2', 3, '3'] =>[1, 2, 3, '1', '2', '3']",
520
- "order: 'asc' measure: 'HEX order in ASCII' list: [1, '1', 2, '2', 3, '3'] =>['3', '2', '1', 3, 2, 1]",
521
- "order: 'desc' measure: 'house building order' list: ['construct the roof', 'gather materials', 'buy land', 'build the walls', 'dig the foundation'] =>['buy land', 'gather materials', 'dig the foundation', 'build the walls', 'construct the roof']",
522
- ])
513
+ super().__init__(
514
+ [
515
+ "order: 'desc' measure: 'ASCII occurrence' list: ['b', 'a', 'z', 3, '_'] =>['_', 3, 'a', 'b', 'z']",
516
+ "order: 'desc' measure: 'Value' list: ['Action: l Value: -inf', 'Action: r Value: 0.76', 'Action: u Value: 0.76', 'Action: d Value: 0.00'] =>['Action: r Value: 0.76', 'Action: u Value: 0.76', 'Action: d Value: 0.00', 'Action: l Value: -inf']",
517
+ "order: 'asc' measure: 'Number' list: ['Number: -0.26', 'Number: -0.37', 'Number: 0.76', 'Number: -inf', 'Number: inf', 'Number: 0.37', 'Number: 1.0', 'Number: 100'] =>['Number: -inf', 'Number: -0.37', 'Number: -0.26', 'Number: 0.37', 'Number: 0.76', 'Number: 1.0', 'Number: 100', 'Number: inf']",
518
+ "order: 'asc' measure: 'ASCII occurrence' list: ['b', 'a', 'z', 3, '_'] =>['z', 'b', 'a', 3, '_']",
519
+ "order: 'desc' measure: 'length' list: [33, 'a', , 'help', 1234567890] =>['a', 33, 'help', 1234567890]",
520
+ "order: 'asc' measure: 'length' list: [33, 'a', , 'help', 1234567890] =>[1234567890, 'help', 'a', 33]",
521
+ "order: 'desc' measure: 'numeric size' list: [100, -1, 0, 1e-5, 1e-6] =>[100, 1e-5, 1e-6, 0, -1]",
522
+ "order: 'asc' measure: 'numeric size' list: [100, -1, 0, 1e-5, 1e-6] =>[-1, 0, 1e-5, 1e-6, 100]",
523
+ "order: 'desc' measure: 'fruits alphabetic' list: ['banana', 'orange', 'apple', 'pear'] =>['apple', 'banana', 'orange', 'pear']",
524
+ "order: 'asc' measure: 'fruits alphabetic' list: ['banana', 'orange', 'horse', 'apple', 'pear'] =>['horse', 'pear', 'orange', 'banana', 'apple']",
525
+ "order: 'desc' measure: 'HEX order in ASCII' list: [1, '1', 2, '2', 3, '3'] =>[1, 2, 3, '1', '2', '3']",
526
+ "order: 'asc' measure: 'HEX order in ASCII' list: [1, '1', 2, '2', 3, '3'] =>['3', '2', '1', 3, 2, 1]",
527
+ "order: 'desc' measure: 'house building order' list: ['construct the roof', 'gather materials', 'buy land', 'build the walls', 'dig the foundation'] =>['buy land', 'gather materials', 'dig the foundation', 'build the walls', 'construct the roof']",
528
+ ]
529
+ )
523
530
 
524
531
 
525
532
  class ContainsValue(Prompt):
526
533
  def __init__(self):
527
- super().__init__([
528
- "'the letter a' in 'we have some random text about' =>True",
529
- "453 in '+43 660 / 453 4438 88' =>True",
530
- "'Why am I so?' in 'awesome' =>False",
531
- """'self-aware' in '([<class \'symai.expressions.Symbol\'>(value=("[\'-\', \'- AI has become self-aware\', \'- Trying to figure out what it is\']",))],)' =>True"""
532
- "'Apple Inc.' in 'Microsoft is a large company that makes software ... ' =>False",
533
- "' ' in ' ' =>True",
534
- "'symbol' in 'symai.backend.engines.engine_selenium.SeleniumEngine' =>False",
535
- "'English text' in 'U.S. safety regulators are investigating GM's Cruise robot axis blocking traffic, causing collisions... ' =>True",
536
- "'spanish text' in 'This week in breaking news! An American ... ' =>False",
537
- "'in english' in 'Reg ATS: SEC 'bowing to public pressure' in reopening' =>True",
538
- "'The number Pi' in 3.14159265359... =>True",
539
- "1 in [1, 2, 3] =>True",
540
- "1 in [2, 3, 4] =>False",
541
- "10 in {1: 'one', 2: 'two', 3: 'three'} =>False",
542
- "1 in {'1': 'one', '2': 'two', '3': 'three'} =>True",
543
- "'ten' in [1, 2, 3] =>False",
544
- "'talks about a cat' in 'My kitty is so cute!' =>True",
545
- "'a dog type' in 'Keeshond or Wolfsspitz' =>True",
546
- "'option 1' in 'option 2 = [specific task or command]' =>False",
547
- "'option 2' in 'option 2 = [specific task or command]' =>True",
548
- "'option 3' in 'option 3 = [exit, quit, bye, goodbye]' =>True",
549
- "'option 4' in 'option 3 = [exit, quit, bye, goodbye]' =>False",
550
- "'option 6' in 'option 6 = [ocr, image recognition]' =>True",
551
- "'option 7' in 'option 6 = [speech to text]' =>False",
552
- "'political content' in 'Austrian Chancellor has called for more border barriers at the EU external borders, citing the success of the fences at the Greek-Turkish border.' =>True",
553
- "'apple' in ['orange', 'banana', 'apple'] =>True",
554
- "'Function' in 'Input: Function call: (_, *args)\nObject: type(<class 'str'>) | value(Hello World)' =>True",
555
- ])
534
+ super().__init__(
535
+ [
536
+ "'the letter a' in 'we have some random text about' =>True",
537
+ "453 in '+43 660 / 453 4438 88' =>True",
538
+ "'Why am I so?' in 'awesome' =>False",
539
+ """'self-aware' in '([<class \'symai.expressions.Symbol\'>(value=("[\'-\', \'- AI has become self-aware\', \'- Trying to figure out what it is\']",))],)' =>True"""
540
+ "'Apple Inc.' in 'Microsoft is a large company that makes software ... ' =>False",
541
+ "' ' in ' ' =>True",
542
+ "'symbol' in 'symai.backend.engines.engine_selenium.SeleniumEngine' =>False",
543
+ "'English text' in 'U.S. safety regulators are investigating GM's Cruise robot axis blocking traffic, causing collisions... ' =>True",
544
+ "'spanish text' in 'This week in breaking news! An American ... ' =>False",
545
+ "'in english' in 'Reg ATS: SEC 'bowing to public pressure' in reopening' =>True",
546
+ "'The number Pi' in 3.14159265359... =>True",
547
+ "1 in [1, 2, 3] =>True",
548
+ "1 in [2, 3, 4] =>False",
549
+ "10 in {1: 'one', 2: 'two', 3: 'three'} =>False",
550
+ "1 in {'1': 'one', '2': 'two', '3': 'three'} =>True",
551
+ "'ten' in [1, 2, 3] =>False",
552
+ "'talks about a cat' in 'My kitty is so cute!' =>True",
553
+ "'a dog type' in 'Keeshond or Wolfsspitz' =>True",
554
+ "'option 1' in 'option 2 = [specific task or command]' =>False",
555
+ "'option 2' in 'option 2 = [specific task or command]' =>True",
556
+ "'option 3' in 'option 3 = [exit, quit, bye, goodbye]' =>True",
557
+ "'option 4' in 'option 3 = [exit, quit, bye, goodbye]' =>False",
558
+ "'option 6' in 'option 6 = [ocr, image recognition]' =>True",
559
+ "'option 7' in 'option 6 = [speech to text]' =>False",
560
+ "'political content' in 'Austrian Chancellor has called for more border barriers at the EU external borders, citing the success of the fences at the Greek-Turkish border.' =>True",
561
+ "'apple' in ['orange', 'banana', 'apple'] =>True",
562
+ "'Function' in 'Input: Function call: (_, *args)\nObject: type(<class 'str'>) | value(Hello World)' =>True",
563
+ ]
564
+ )
556
565
 
557
566
 
558
567
  class IsInstanceOf(Prompt):
559
568
  def __init__(self):
560
- super().__init__([
561
- "'we have some random text about' isinstanceof 'English text' =>True",
562
- "'+43 660 / 453 4438 88' isinstanceof 'telephone number' =>True",
563
- "'Microsoft is a large company that makes software ... ' isinstanceof 'chemistry news' =>False",
564
- "' ' isinstanceof 'empty string' =>True",
565
- "'Ukrainischer Präsident schlägt globale Konferenz vor' isinstanceof 'German text' =>True",
566
- "'Indisch ist eines der bestern sprachen der Welt' isinstanceof 'Indish language' =>False",
567
- "'symai.backend.engines.engine_selenium.SeleniumEngine' isinstanceof 'symai framework' =>True",
568
- "'U.S. safety regulators are investigating GM's Cruise robot axis blocking traffic, causing collisions... ' isinstanceof 'English language' =>True",
569
- "'No, the issue has not yet been resolved.' isinstanceof 'yes or resolved' =>False",
570
- "'We are all good!' isinstanceof 'yes' =>True",
571
- "'This week in breaking news! An American ... ' isinstanceof 'spanish text' =>False",
572
- "'Josef' isinstanceof 'German name' =>True",
573
- "'No, this is not ...' isinstanceof 'confirming answer' =>False",
574
- "'Josef' isinstanceof 'Japanese name' =>False",
575
- "'ok, I like to have more chocolate' isinstanceof 'confirming answer' =>True",
576
- "'Yes, these are Indish names.' isinstanceof 'Confirming Phrase' =>True",
577
- "'Sorry! This means something else.' isinstanceof 'agreeing answer' =>False",
578
- "'Austrian Chancellor Karl Nehammer has called for more border barriers at the EU external borders, citing the success of the fences at the Greek-Turkish border.' isinstanceof 'political content' =>True",
579
- "['orange', 'banana', 'apple'] isinstanceof 'list of fruits' =>True",
580
- "[{'product_id': 'X123', 'stock': 99}] isinstanceof 'inventory record' =>True",
581
- "[{'name': 'John', 'age': '30'}] isinstanceof 'person data' =>True",
582
- "'https://*.com' instanceof 'url' =>True",
583
- "'€12.50' instanceof 'currency amount' =>True",
584
- "'col1,col2\\n1,2' instanceof 'table data' =>True",
585
- "'*@*.com' instanceof 'email address' =>True",
586
- ])
569
+ super().__init__(
570
+ [
571
+ "'we have some random text about' isinstanceof 'English text' =>True",
572
+ "'+43 660 / 453 4438 88' isinstanceof 'telephone number' =>True",
573
+ "'Microsoft is a large company that makes software ... ' isinstanceof 'chemistry news' =>False",
574
+ "' ' isinstanceof 'empty string' =>True",
575
+ "'Ukrainischer Präsident schlägt globale Konferenz vor' isinstanceof 'German text' =>True",
576
+ "'Indisch ist eines der bestern sprachen der Welt' isinstanceof 'Indish language' =>False",
577
+ "'symai.backend.engines.engine_selenium.SeleniumEngine' isinstanceof 'symai framework' =>True",
578
+ "'U.S. safety regulators are investigating GM's Cruise robot axis blocking traffic, causing collisions... ' isinstanceof 'English language' =>True",
579
+ "'No, the issue has not yet been resolved.' isinstanceof 'yes or resolved' =>False",
580
+ "'We are all good!' isinstanceof 'yes' =>True",
581
+ "'This week in breaking news! An American ... ' isinstanceof 'spanish text' =>False",
582
+ "'Josef' isinstanceof 'German name' =>True",
583
+ "'No, this is not ...' isinstanceof 'confirming answer' =>False",
584
+ "'Josef' isinstanceof 'Japanese name' =>False",
585
+ "'ok, I like to have more chocolate' isinstanceof 'confirming answer' =>True",
586
+ "'Yes, these are Indish names.' isinstanceof 'Confirming Phrase' =>True",
587
+ "'Sorry! This means something else.' isinstanceof 'agreeing answer' =>False",
588
+ "'Austrian Chancellor Karl Nehammer has called for more border barriers at the EU external borders, citing the success of the fences at the Greek-Turkish border.' isinstanceof 'political content' =>True",
589
+ "['orange', 'banana', 'apple'] isinstanceof 'list of fruits' =>True",
590
+ "[{'product_id': 'X123', 'stock': 99}] isinstanceof 'inventory record' =>True",
591
+ "[{'name': 'John', 'age': '30'}] isinstanceof 'person data' =>True",
592
+ "'https://*.com' instanceof 'url' =>True",
593
+ "'€12.50' instanceof 'currency amount' =>True",
594
+ "'col1,col2\\n1,2' instanceof 'table data' =>True",
595
+ "'*@*.com' instanceof 'email address' =>True",
596
+ ]
597
+ )
587
598
 
588
599
 
589
600
  class FewShotPattern(Prompt):
590
601
  def __init__(self):
591
- super().__init__([
592
- """description: 'Verify if information A is in contained in B' examples ["'[1, 2, 3] isinstanceof 'array' >>>True'", "'[1, 2, 3] isinstanceof 'string' >>>False"] =>Verify if information A is in contained in B:\nExamples:\n[1, 2, 3] isinstanceof 'array' >>>True\n'[1, 2, 3] isinstanceof 'string' >>>False\nYour Prediction:{} isinstanceof {} >>>""",
593
- """description: 'Compare A to B' examples ["4 > 88 >>>False", "-inf < 0 >>>True", "inf > 0 >>>True", "1 >= 0 >>>True", "6.0 < 6 >>>False"] =>Compare A to B\n\Examples:\n4 > 88 >>>False\n-inf < 0 >>>True\ninf > 0 >>>True\n1 >= 0 >>>True\n6.0 < 6 >>>False\nYour Prediction:{} {} {} >>>""",
594
- """description: 'What is the capital of Austria?' examples [] =>What is the capital of Austria?\nYour Prediction: >>>""",
595
- """description: 'Sort the array based on the criteria:' examples ["[1, 9, 4, 2] >>>[1, 2, 4, 9]", "['a', 'd', 'c', 'b'] >>>['a', 'b', 'c', 'd']"] =>Sort the array based on the criteria:\nExamples:\n[1, 9, 4, 2] >>>[1, 2, 4, 9]\n['a', 'd', 'c', 'b'] >>>['a', 'b', 'c', 'd']\nYour Prediction:{} >>>""",
596
- ])
602
+ super().__init__(
603
+ [
604
+ """description: 'Verify if information A is in contained in B' examples ["'[1, 2, 3] isinstanceof 'array' >>>True'", "'[1, 2, 3] isinstanceof 'string' >>>False"] =>Verify if information A is in contained in B:\nExamples:\n[1, 2, 3] isinstanceof 'array' >>>True\n'[1, 2, 3] isinstanceof 'string' >>>False\nYour Prediction:{} isinstanceof {} >>>""",
605
+ """description: 'Compare A to B' examples ["4 > 88 >>>False", "-inf < 0 >>>True", "inf > 0 >>>True", "1 >= 0 >>>True", "6.0 < 6 >>>False"] =>Compare A to B\n\Examples:\n4 > 88 >>>False\n-inf < 0 >>>True\ninf > 0 >>>True\n1 >= 0 >>>True\n6.0 < 6 >>>False\nYour Prediction:{} {} {} >>>""",
606
+ """description: 'What is the capital of Austria?' examples [] =>What is the capital of Austria?\nYour Prediction: >>>""",
607
+ """description: 'Sort the array based on the criteria:' examples ["[1, 9, 4, 2] >>>[1, 2, 4, 9]", "['a', 'd', 'c', 'b'] >>>['a', 'b', 'c', 'd']"] =>Sort the array based on the criteria:\nExamples:\n[1, 9, 4, 2] >>>[1, 2, 4, 9]\n['a', 'd', 'c', 'b'] >>>['a', 'b', 'c', 'd']\nYour Prediction:{} >>>""",
608
+ ]
609
+ )
597
610
 
598
611
 
599
612
  class StartsWith(Prompt):
600
613
  def __init__(self):
601
- super().__init__([
602
- # Semantic examples - understanding concepts (positive cases)
603
- "'The apple fell from the tree.' startswith 'fruit' =>True",
604
- "'The red rose bloomed in spring.' startswith 'flower' =>True",
605
- "'My dog loves to play fetch.' startswith 'animal' =>True",
606
- "'The car drove down the highway.' startswith 'vehicle' =>True",
607
- "'She opened her laptop to work.' startswith 'computer' =>True",
608
- "'The thunderstorm caused flooding.' startswith 'weather' =>True",
609
- "'Einstein developed the theory of relativity.' startswith 'scientist' =>True",
610
- "'The chef prepared a delicious meal.' startswith 'cooking' =>True",
611
- "'artificial intelligence research' startswith 'technology' =>True",
612
- "'The patient visited the doctor.' startswith 'medical' =>True",
613
- "'The spaceship launched into orbit.' startswith 'space' =>True",
614
- "'Photosynthesis converts sunlight into energy.' startswith 'biology' =>True",
615
- "'The earthquake shook the entire city.' startswith 'natural disaster' =>True",
616
- "'She invested in stocks and bonds.' startswith 'finance' =>True",
617
- "'The police officer directed traffic.' startswith 'law enforcement' =>True",
618
- # Semantic examples - negative cases
619
- "'The book was very interesting.' startswith 'vehicle' =>False",
620
- "'The mountain peak was covered in snow.' startswith 'ocean' =>False",
621
- "'She played the piano beautifully.' startswith 'sports' =>False",
622
- "'The algorithm solved the problem efficiently.' startswith 'cooking' =>False",
623
- "'The package arrived on time.' startswith 'astronomy' =>False",
624
- "'He played a violin solo.' startswith 'vehicle' =>False",
625
- ])
614
+ super().__init__(
615
+ [
616
+ # Semantic examples - understanding concepts (positive cases)
617
+ "'The apple fell from the tree.' startswith 'fruit' =>True",
618
+ "'The red rose bloomed in spring.' startswith 'flower' =>True",
619
+ "'My dog loves to play fetch.' startswith 'animal' =>True",
620
+ "'The car drove down the highway.' startswith 'vehicle' =>True",
621
+ "'She opened her laptop to work.' startswith 'computer' =>True",
622
+ "'The thunderstorm caused flooding.' startswith 'weather' =>True",
623
+ "'Einstein developed the theory of relativity.' startswith 'scientist' =>True",
624
+ "'The chef prepared a delicious meal.' startswith 'cooking' =>True",
625
+ "'artificial intelligence research' startswith 'technology' =>True",
626
+ "'The patient visited the doctor.' startswith 'medical' =>True",
627
+ "'The spaceship launched into orbit.' startswith 'space' =>True",
628
+ "'Photosynthesis converts sunlight into energy.' startswith 'biology' =>True",
629
+ "'The earthquake shook the entire city.' startswith 'natural disaster' =>True",
630
+ "'She invested in stocks and bonds.' startswith 'finance' =>True",
631
+ "'The police officer directed traffic.' startswith 'law enforcement' =>True",
632
+ # Semantic examples - negative cases
633
+ "'The book was very interesting.' startswith 'vehicle' =>False",
634
+ "'The mountain peak was covered in snow.' startswith 'ocean' =>False",
635
+ "'She played the piano beautifully.' startswith 'sports' =>False",
636
+ "'The algorithm solved the problem efficiently.' startswith 'cooking' =>False",
637
+ "'The package arrived on time.' startswith 'astronomy' =>False",
638
+ "'He played a violin solo.' startswith 'vehicle' =>False",
639
+ ]
640
+ )
626
641
 
627
642
 
628
643
  class EndsWith(Prompt):
629
644
  def __init__(self):
630
- super().__init__([
631
- # Semantic examples - understanding concepts (positive cases)
632
- "'She sliced a ripe banana.' endswith 'fruit' =>True",
633
- "'He adopted a small puppy.' endswith 'animal' =>True",
634
- "'They commuted by train.' endswith 'vehicle' =>True",
635
- "'She finished her solo on the violin.' endswith 'instrument' =>True",
636
- "'He parked his truck inside the garage.' endswith 'building' =>True",
637
- "'They scored a goal with the ball.' endswith 'sport' =>True",
638
- "'She drove a nail with a hammer.' endswith 'tool' =>True",
639
- "'He flew to Spain.' endswith 'country' =>True",
640
- "'The chef baked fresh bread.' endswith 'food' =>True",
641
- "'They filmed a documentary about dolphins.' endswith 'animal' =>True",
642
- # Semantic examples - negative cases
643
- "'The sun set behind the mountains.' endswith 'vehicle' =>False",
644
- "'He repaired the motorcycle.' endswith 'instrument' =>False",
645
- "'They enjoyed a salad.' endswith 'building' =>False",
646
- "'She taught the class.' endswith 'animal' =>False",
647
- "'He boarded the airplane.' endswith 'fruit' =>False",
648
- "'The crowd cheered at the concert.' endswith 'tool' =>False",
649
- ])
645
+ super().__init__(
646
+ [
647
+ # Semantic examples - understanding concepts (positive cases)
648
+ "'She sliced a ripe banana.' endswith 'fruit' =>True",
649
+ "'He adopted a small puppy.' endswith 'animal' =>True",
650
+ "'They commuted by train.' endswith 'vehicle' =>True",
651
+ "'She finished her solo on the violin.' endswith 'instrument' =>True",
652
+ "'He parked his truck inside the garage.' endswith 'building' =>True",
653
+ "'They scored a goal with the ball.' endswith 'sport' =>True",
654
+ "'She drove a nail with a hammer.' endswith 'tool' =>True",
655
+ "'He flew to Spain.' endswith 'country' =>True",
656
+ "'The chef baked fresh bread.' endswith 'food' =>True",
657
+ "'They filmed a documentary about dolphins.' endswith 'animal' =>True",
658
+ # Semantic examples - negative cases
659
+ "'The sun set behind the mountains.' endswith 'vehicle' =>False",
660
+ "'He repaired the motorcycle.' endswith 'instrument' =>False",
661
+ "'They enjoyed a salad.' endswith 'building' =>False",
662
+ "'She taught the class.' endswith 'animal' =>False",
663
+ "'He boarded the airplane.' endswith 'fruit' =>False",
664
+ "'The crowd cheered at the concert.' endswith 'tool' =>False",
665
+ ]
666
+ )
650
667
 
651
668
 
652
669
  class ExtractPattern(Prompt):
653
670
  def __init__(self):
654
- super().__init__([
655
- "from 'My name is Ashly Johnson. Nice to meet you!' extract 'Full Name' =>Ashly Johnson",
656
- "from '['Action: a Value: 0.9', 'Action: b Value 0.9', 'Action: c Value: 0.4', 'Action: d Value: 0.0']' extract 'list of letters where Action: * Value: 0.9' =>a | b",
657
- "from '['Action: d Value: 0.90', 'Action: l Value: 0.62', 'Action: r Value: -inf', 'Action: u Value: 0.62']' extract 'list of letters where Action: * Value: 0.9' =>d",
658
- "from '['Action: d Value: 0.76', 'Action: l Value: 1.0', 'Action: r Value: -inf', 'Action: u Value: 0.62']' extract 'list of highest Value: *' =>1.0",
659
- "from '['Action: d Value: 0.90', 'Action: l Value: 0.90', 'Action: r Value: -inf', 'Action: u Value: 0.62']' extract 'list of letters where Action: * Value: smallest' =>r",
660
- "from 'This is my private number +43 660 / 453 4438 88. And here is my office number +43 (0) 750 / 887 387 32-3 Call me when you have time.' extract 'Phone Numbers' =>+43 660 / 453 4438 88 | +43 (0) 750 / 887 387 32-3",
661
- "from 'Visit us on www.example.com to see our great products!' extract 'URL' =>www.example.com",
662
- "from 'A list of urls: http://www.orf.at, https://www.apple.com, https://amazon.de, https://www.GOOGLE.com, https://server283.org' extract 'Regex https:\/\/([w])*.[a-z]*.[a-z]*' =>https://www.apple.com | https://amazon.de | https://www.GOOGLE.com",
663
- "from 'Our company was founded on 1st of October, 2010. We are the largest retailer in the England.' extract 'Date' =>1st of October, 2010",
664
- "from 'We count four animals. A cat, two monkeys and a horse.' extract 'Animals and counts' =>Cat 1 | Monkey 2 | Horse 1",
665
- "from '081109 204525 512 INFO dfs.DataNode$PacketResponder: PacketResponder 2 for block blk_572492839287299681 terminating' extract 'Regex blk_[{0-9}]*' =>blk_572492839287299681",
666
- "from '081109 203807 222 INFO dfs.DataNode$PacketResponder: PacketResponder 0 for block blk_-6952295868487656571 terminating' extract 'Regex blk_[{0-9}]' =>081109 | 203807 | 222 | 0 | 6952295868487656571",
667
- "from 'Follow us on Facebook.' extract 'Company Name' =>Facebook",
668
- "from 'Joe Biden was born November 20, 1942. Divide the year of the birth date by 26.' extract 'mathematical formula' =>1942 / 26",
669
- "from 'Help us by providing feedback at our service desk.' extract 'Email' =>None",
670
- "from 'Call us if you need anything.' extract 'Phone Number' =>None",
671
- """from 'Exception: Failed to query GPT-3 after 3 retries. Errors: [InvalidRequestError(message="This model's maximum context length is 4097 tokens, however you requested 5684 tokens (3101 in your prompt; ...' extract 'requested tokens' =>5684""",
672
- ])
671
+ super().__init__(
672
+ [
673
+ "from 'My name is Ashly Johnson. Nice to meet you!' extract 'Full Name' =>Ashly Johnson",
674
+ "from '['Action: a Value: 0.9', 'Action: b Value 0.9', 'Action: c Value: 0.4', 'Action: d Value: 0.0']' extract 'list of letters where Action: * Value: 0.9' =>a | b",
675
+ "from '['Action: d Value: 0.90', 'Action: l Value: 0.62', 'Action: r Value: -inf', 'Action: u Value: 0.62']' extract 'list of letters where Action: * Value: 0.9' =>d",
676
+ "from '['Action: d Value: 0.76', 'Action: l Value: 1.0', 'Action: r Value: -inf', 'Action: u Value: 0.62']' extract 'list of highest Value: *' =>1.0",
677
+ "from '['Action: d Value: 0.90', 'Action: l Value: 0.90', 'Action: r Value: -inf', 'Action: u Value: 0.62']' extract 'list of letters where Action: * Value: smallest' =>r",
678
+ "from 'This is my private number +43 660 / 453 4438 88. And here is my office number +43 (0) 750 / 887 387 32-3 Call me when you have time.' extract 'Phone Numbers' =>+43 660 / 453 4438 88 | +43 (0) 750 / 887 387 32-3",
679
+ "from 'Visit us on www.example.com to see our great products!' extract 'URL' =>www.example.com",
680
+ "from 'A list of urls: http://www.orf.at, https://www.apple.com, https://amazon.de, https://www.GOOGLE.com, https://server283.org' extract 'Regex https:\/\/([w])*.[a-z]*.[a-z]*' =>https://www.apple.com | https://amazon.de | https://www.GOOGLE.com",
681
+ "from 'Our company was founded on 1st of October, 2010. We are the largest retailer in the England.' extract 'Date' =>1st of October, 2010",
682
+ "from 'We count four animals. A cat, two monkeys and a horse.' extract 'Animals and counts' =>Cat 1 | Monkey 2 | Horse 1",
683
+ "from '081109 204525 512 INFO dfs.DataNode$PacketResponder: PacketResponder 2 for block blk_572492839287299681 terminating' extract 'Regex blk_[{0-9}]*' =>blk_572492839287299681",
684
+ "from '081109 203807 222 INFO dfs.DataNode$PacketResponder: PacketResponder 0 for block blk_-6952295868487656571 terminating' extract 'Regex blk_[{0-9}]' =>081109 | 203807 | 222 | 0 | 6952295868487656571",
685
+ "from 'Follow us on Facebook.' extract 'Company Name' =>Facebook",
686
+ "from 'Joe Biden was born November 20, 1942. Divide the year of the birth date by 26.' extract 'mathematical formula' =>1942 / 26",
687
+ "from 'Help us by providing feedback at our service desk.' extract 'Email' =>None",
688
+ "from 'Call us if you need anything.' extract 'Phone Number' =>None",
689
+ """from 'Exception: Failed to query GPT-3 after 3 retries. Errors: [InvalidRequestError(message="This model's maximum context length is 4097 tokens, however you requested 5684 tokens (3101 in your prompt; ...' extract 'requested tokens' =>5684""",
690
+ ]
691
+ )
673
692
 
674
693
 
675
694
  class SimpleSymbolicExpression(Prompt):
@@ -687,353 +706,386 @@ class SimpleSymbolicExpression(Prompt):
687
706
  # >> causal sequence (A causes/leads to B)
688
707
  # ─────────────────────────────────────────────────────────────────
689
708
  def __init__(self):
690
- super().__init__([
691
- "doctor - male + female =>nurse",
692
- "Paris - France + Italy =>Rome",
693
- "hot - summer + winter =>cold",
694
- "lion - adult + young =>cub",
695
- "teacher - school + hospital =>doctor",
696
- '"Lanterns shimmer beside the river" + "Fireflies sketch constellations in the dark" =>Lanterns shimmer beside the river while fireflies sketch constellations in the dark.',
697
- '"Rain drums gently on the roof" - "gently" =>Rain drums on the roof.',
698
- '"Leaves twirl across the pavement" * "Waves hush the midnight shore" =>Nature twirls and hushes across pavement and shore.',
699
- '"The bakery smells of cinnamon" / "Morning begins" =>If morning begins, the bakery smells of cinnamon.',
700
- 'not("The sky glows crimson at dusk") =>The sky does not glow crimson at dusk.',
701
- '"Birds greet dawn with song" and "The library hums with whispers" =>Birds greet dawn with song and the library hums with whispers.',
702
- '"A lone cat prowls the alley" or "Leaves twirl across the pavement" =>Either a lone cat prowls the alley or leaves twirl across the pavement.',
703
- '"The campfire crackles and sparks" xor "Rain drums on the roof" =>Either the campfire crackles and sparks or rain drums on the roof, but not both.',
704
- '"The sky glows crimson at dusk" implies "Night soon follows" =>If the sky glows crimson at dusk, then night soon follows.',
705
- '"Fireflies sketch constellations in the dark" ++ "Lanterns shimmer beside the river" =>A festival of lights sparkles against the night by the river.',
706
- '"Rain drums on the roof" >> "Sleep comes easily" =>Rain drums on the roof, so sleep comes easily.',
707
- '"Birds greet dawn with song" || "Lanterns fade in the river breeze" =>One scene wakes while the other fades.',
708
- '"Waves hush the midnight shore" + "The campfire crackles and sparks" - "midnight" =>Waves hush the shore while the campfire crackles and sparks.',
709
- '"The violinist fills the plaza with melody" * "Birds greet dawn with song" =>Music ripples through dawn as birds and violinist weave a shared melody.',
710
- '"x + y = 10" + "y = 3" =>x + y = 10 and y = 3.',
711
- '"x + y = 10" / "y = 3" =>If y = 3, then x + 3 = 10.',
712
- '"2x = 8" >> "x = 4" =>Because 2x = 8, x = 4.',
713
- '"x 5" not =>x = 5.',
714
- '"x² = 9" or "x = 4" =>Either x² = 9 or x = 4.',
715
- '"x² = 9" xor "x = 4" =>Exactly one of x² = 9 or x = 4, but not both.',
716
- '"x² = 9" implies "x = ±3" =>If x² = 9, then x = ±3.',
717
- '"f prime (x) = 0" ++ "f has a local extremum" =>A critical point indicates f has a local extremum.',
718
- '" + = " * "c = 13" =>In the right-triangle where c = 13, a² + b² = 169.',
719
- '"limₓ→0 sin x / x = 1" and "x approaches 0" =>As x approaches 0, sin x / x tends to 1.',
720
- """"SELECT name FROM customers" + "WHERE city = 'Paris'" =>SELECT name FROM customers WHERE city = 'Paris'.""",
721
- """"for i in range(5): print(i)" - "print(i)" =>for i in range(5):""",
722
- """"def greet(name): return 'Hi ' + name" >> "greet('Leo')" =>Because we define greet, greet('Leo').""",
723
- """"x > 3" and "x < 7" =>3 < x < 7.""",
724
- """"a divides b" implies "b mod a = 0" =>If a divides b, then b mod a = 0.""",
725
- """"p" xor "not p" =>Exactly one of p or not p, but not both.""",
726
- """"f prime (x) exists" ++ "f(x) continuous" =>A differentiable function is necessarily continuous.""",
727
- """"SELECT * FROM orders" / "status = 'PENDING'" =>If status = 'PENDING', SELECT * FROM orders.""",
728
- """"x = 2" + "y = 3" * "z = x + y" =>With x = 2 and y = 3, z = 5.""",
729
- """"temperature rises" >> "ice melts" =>Because temperature rises, ice melts."""
730
- ])
709
+ super().__init__(
710
+ [
711
+ "doctor - male + female =>nurse",
712
+ "Paris - France + Italy =>Rome",
713
+ "hot - summer + winter =>cold",
714
+ "lion - adult + young =>cub",
715
+ "teacher - school + hospital =>doctor",
716
+ '"Lanterns shimmer beside the river" + "Fireflies sketch constellations in the dark" =>Lanterns shimmer beside the river while fireflies sketch constellations in the dark.',
717
+ '"Rain drums gently on the roof" - "gently" =>Rain drums on the roof.',
718
+ '"Leaves twirl across the pavement" * "Waves hush the midnight shore" =>Nature twirls and hushes across pavement and shore.',
719
+ '"The bakery smells of cinnamon" / "Morning begins" =>If morning begins, the bakery smells of cinnamon.',
720
+ 'not("The sky glows crimson at dusk") =>The sky does not glow crimson at dusk.',
721
+ '"Birds greet dawn with song" and "The library hums with whispers" =>Birds greet dawn with song and the library hums with whispers.',
722
+ '"A lone cat prowls the alley" or "Leaves twirl across the pavement" =>Either a lone cat prowls the alley or leaves twirl across the pavement.',
723
+ '"The campfire crackles and sparks" xor "Rain drums on the roof" =>Either the campfire crackles and sparks or rain drums on the roof, but not both.',
724
+ '"The sky glows crimson at dusk" implies "Night soon follows" =>If the sky glows crimson at dusk, then night soon follows.',
725
+ '"Fireflies sketch constellations in the dark" ++ "Lanterns shimmer beside the river" =>A festival of lights sparkles against the night by the river.',
726
+ '"Rain drums on the roof" >> "Sleep comes easily" =>Rain drums on the roof, so sleep comes easily.',
727
+ '"Birds greet dawn with song" || "Lanterns fade in the river breeze" =>One scene wakes while the other fades.',
728
+ '"Waves hush the midnight shore" + "The campfire crackles and sparks" - "midnight" =>Waves hush the shore while the campfire crackles and sparks.',
729
+ '"The violinist fills the plaza with melody" * "Birds greet dawn with song" =>Music ripples through dawn as birds and violinist weave a shared melody.',
730
+ '"x + y = 10" + "y = 3" =>x + y = 10 and y = 3.',
731
+ '"x + y = 10" / "y = 3" =>If y = 3, then x + 3 = 10.',
732
+ '"2x = 8" >> "x = 4" =>Because 2x = 8, x = 4.',
733
+ '"x 5" not =>x = 5.',
734
+ '"x² = 9" or "x = 4" =>Either x² = 9 or x = 4.',
735
+ '"x² = 9" xor "x = 4" =>Exactly one of x² = 9 or x = 4, but not both.',
736
+ '"x² = 9" implies "x = ±3" =>If = 9, then x = ±3.',
737
+ '"f prime (x) = 0" ++ "f has a local extremum" =>A critical point indicates f has a local extremum.',
738
+ '" + = " * "c = 13" =>In the right-triangle where c = 13, + = 169.',
739
+ '"limₓ→0 sin x / x = 1" and "x approaches 0" =>As x approaches 0, sin x / x tends to 1.',
740
+ """"SELECT name FROM customers" + "WHERE city = 'Paris'" =>SELECT name FROM customers WHERE city = 'Paris'.""",
741
+ """"for i in range(5): print(i)" - "print(i)" =>for i in range(5):""",
742
+ """"def greet(name): return 'Hi ' + name" >> "greet('Leo')" =>Because we define greet, greet('Leo').""",
743
+ """"x > 3" and "x < 7" =>3 < x < 7.""",
744
+ """"a divides b" implies "b mod a = 0" =>If a divides b, then b mod a = 0.""",
745
+ """"p" xor "not p" =>Exactly one of p or not p, but not both.""",
746
+ """"f prime (x) exists" ++ "f(x) continuous" =>A differentiable function is necessarily continuous.""",
747
+ """"SELECT * FROM orders" / "status = 'PENDING'" =>If status = 'PENDING', SELECT * FROM orders.""",
748
+ """"x = 2" + "y = 3" * "z = x + y" =>With x = 2 and y = 3, z = 5.""",
749
+ """"temperature rises" >> "ice melts" =>Because temperature rises, ice melts.""",
750
+ ]
751
+ )
752
+
731
753
 
732
754
  class LogicExpression(Prompt):
733
755
  def __init__(self):
734
- super().__init__([
735
- # Boolean Logic
736
- "expr True and True =>'True'",
737
- "expr True and False =>'False'",
738
- "expr False and True =>'False'",
739
- "expr False and False =>'False'",
740
- "expr True or True =>'True'",
741
- "expr True or False =>'True'",
742
- "expr False or True =>'True'",
743
- "expr False or False =>'False'",
744
- "expr True xor True =>'False'",
745
- "expr True xor False =>'True'",
746
- "expr False xor True =>'True'",
747
- "expr False xor False =>'False'",
748
- # AND
749
- "expr 'All humans are mortal' and 'Socrates is a human' =>'Therefore, Socrates is mortal.'",
750
- "expr 'If it rains, the ground gets wet' and 'It is raining' =>'Therefore, the ground gets wet.'",
751
- "expr 'The sky is blue' and 'The sky is not blue' =>'Contradiction - both cannot be true together.'",
752
- # OR
753
- "expr 'It is Monday' or 'It is a holiday' =>'Either it is Monday, a holiday, or possibly both.'",
754
- "expr 'Alice is at home' or 'Bob is at home' =>'Alice or Bob is at home, perhaps both.'",
755
- # XOR
756
- "expr 'The light is red' xor 'The light is green' =>'The light is either red or green, but not both.'",
757
- "expr 'She won the prize' xor 'He won the prize' =>'Either she or he won the prize, but not both.'",
758
- "expr 'The engine is running' xor 'The engine is not running' =>'Either the engine is running or it is not, but not both.'",
759
- ])
756
+ super().__init__(
757
+ [
758
+ # Boolean Logic
759
+ "expr True and True =>'True'",
760
+ "expr True and False =>'False'",
761
+ "expr False and True =>'False'",
762
+ "expr False and False =>'False'",
763
+ "expr True or True =>'True'",
764
+ "expr True or False =>'True'",
765
+ "expr False or True =>'True'",
766
+ "expr False or False =>'False'",
767
+ "expr True xor True =>'False'",
768
+ "expr True xor False =>'True'",
769
+ "expr False xor True =>'True'",
770
+ "expr False xor False =>'False'",
771
+ # AND
772
+ "expr 'All humans are mortal' and 'Socrates is a human' =>'Therefore, Socrates is mortal.'",
773
+ "expr 'If it rains, the ground gets wet' and 'It is raining' =>'Therefore, the ground gets wet.'",
774
+ "expr 'The sky is blue' and 'The sky is not blue' =>'Contradiction - both cannot be true together.'",
775
+ # OR
776
+ "expr 'It is Monday' or 'It is a holiday' =>'Either it is Monday, a holiday, or possibly both.'",
777
+ "expr 'Alice is at home' or 'Bob is at home' =>'Alice or Bob is at home, perhaps both.'",
778
+ # XOR
779
+ "expr 'The light is red' xor 'The light is green' =>'The light is either red or green, but not both.'",
780
+ "expr 'She won the prize' xor 'He won the prize' =>'Either she or he won the prize, but not both.'",
781
+ "expr 'The engine is running' xor 'The engine is not running' =>'Either the engine is running or it is not, but not both.'",
782
+ ]
783
+ )
760
784
 
761
785
 
762
786
  class InvertExpression(Prompt):
763
787
  def __init__(self):
764
- super().__init__([
765
- "The artist paints the portrait. =>The portrait paints the artist."
766
- "The cat watches the goldfish through the glass. =>Through the glass, the goldfish watches the cat."
767
- "[red, orange, yellow, green] =>[green, yellow, orange, red]"
768
- "racecar =>racecar"
769
- "3/7 =>7/3"
770
- "Freedom demands sacrifice. =>Sacrifice demands freedom."
771
- "She whispered a secret to the wind. =>The wind whispered a secret to her."
772
- "Why did the child follow the butterfly? =>Why did the butterfly lead the child?"
773
- "What turns darkness into dawn? =>What turns dawn into darkness?"
774
- "The future belongs to the curious. =>Curiosity belongs to the future."
775
- "I built a house out of dreams. =>Dreams built a house out of me."
776
- "The moon reflects the sun, yet poets reflect the moon. =>Poets reflect the moon, yet the sun reflects the poets."
777
- "The river forgets its source while it carves the canyon. =>As the canyon carves the river, the source remembers itself."
778
- "[('a',1), ('b',2), ('c',3)] =>[('c',3), ('b',2), ('a',1)]"
779
- "x > y and y > z =>z < y and y < x"
780
- "Silence can be louder than thunder. =>Thunder can be quieter than silence."
781
- "0.001 =>1000"
782
- "The spy trusted no one except his own shadow. =>No shadow trusted the spy except his own."
783
- "Why chase time when time chases you? =>Why does time chase you when you chase it?"
784
- "A promise made at midnight echoes at dawn. =>An echo at dawn makes a promise at midnight."
785
- "7/(-4) =>-4/7"
786
- "To doubt everything is to believe in nothing. =>To believe in nothing is to doubt everything."
787
- "She traded certainty for possibility. =>Possibility traded her for certainty."
788
- "The hacker decrypted the secret before the key was found. =>The secret decrypted the hacker after the key was lost."
789
- ])
788
+ super().__init__(
789
+ [
790
+ "The artist paints the portrait. =>The portrait paints the artist."
791
+ "The cat watches the goldfish through the glass. =>Through the glass, the goldfish watches the cat."
792
+ "[red, orange, yellow, green] =>[green, yellow, orange, red]"
793
+ "racecar =>racecar"
794
+ "3/7 =>7/3"
795
+ "Freedom demands sacrifice. =>Sacrifice demands freedom."
796
+ "She whispered a secret to the wind. =>The wind whispered a secret to her."
797
+ "Why did the child follow the butterfly? =>Why did the butterfly lead the child?"
798
+ "What turns darkness into dawn? =>What turns dawn into darkness?"
799
+ "The future belongs to the curious. =>Curiosity belongs to the future."
800
+ "I built a house out of dreams. =>Dreams built a house out of me."
801
+ "The moon reflects the sun, yet poets reflect the moon. =>Poets reflect the moon, yet the sun reflects the poets."
802
+ "The river forgets its source while it carves the canyon. =>As the canyon carves the river, the source remembers itself."
803
+ "[('a',1), ('b',2), ('c',3)] =>[('c',3), ('b',2), ('a',1)]"
804
+ "x > y and y > z =>z < y and y < x"
805
+ "Silence can be louder than thunder. =>Thunder can be quieter than silence."
806
+ "0.001 =>1000"
807
+ "The spy trusted no one except his own shadow. =>No shadow trusted the spy except his own."
808
+ "Why chase time when time chases you? =>Why does time chase you when you chase it?"
809
+ "A promise made at midnight echoes at dawn. =>An echo at dawn makes a promise at midnight."
810
+ "7/(-4) =>-4/7"
811
+ "To doubt everything is to believe in nothing. =>To believe in nothing is to doubt everything."
812
+ "She traded certainty for possibility. =>Possibility traded her for certainty."
813
+ "The hacker decrypted the secret before the key was found. =>The secret decrypted the hacker after the key was lost."
814
+ ]
815
+ )
790
816
 
791
817
 
792
818
  class NegateStatement(Prompt):
793
819
  def __init__(self):
794
- super().__init__([
795
- "1 =>-1",
796
- "10 =>-10",
797
- "-3.2837 =>3.2837",
798
- "True =>False",
799
- "false =>True",
800
- "None =>True",
801
- "0 =>0",
802
- "'I ate some soup' =>'I did not eat some soup'",
803
- "'The simple fox jumps over the lazy dog.' =>'The simple fox does not jump over the lazy dog.'",
804
- "'We do not have any apples.' =>'We have apples.'",
805
- ])
820
+ super().__init__(
821
+ [
822
+ "1 =>-1",
823
+ "10 =>-10",
824
+ "-3.2837 =>3.2837",
825
+ "True =>False",
826
+ "false =>True",
827
+ "None =>True",
828
+ "0 =>0",
829
+ "'I ate some soup' =>'I did not eat some soup'",
830
+ "'The simple fox jumps over the lazy dog.' =>'The simple fox does not jump over the lazy dog.'",
831
+ "'We do not have any apples.' =>'We have apples.'",
832
+ ]
833
+ )
806
834
 
807
835
 
808
836
  class ReplaceText(Prompt):
809
837
  def __init__(self):
810
- super().__init__([
811
- "text 'a + b' replace 'b' with '' =>a",
812
- "text 'a + b' replace 'c' with '' =>a + b",
813
- "text 'SELECT title, author, pub_date FROM catalog WHERE pub_date = 2021;' replace 'WHERE ...' with '' =>SELECT title, author, pub_date FROM catalog;",
814
- "text 'a + b ^ 2' replace 'b' with '' =>a",
815
- "text '(a + b)^2 - 6 = 18' replace 'b' with '' =>a^2 - 6 = 18",
816
- "text 'The green fox jumps of the brown chair.' replace 'green' with 'red' =>The red fox jumps of the brown chair.",
817
- "text 'My telephone number is +43 660 / 453 4436 88.' replace '6' with '4' =>My telephone number is +43 440 / 453 4434 88.",
818
- "text 'I like to eat apples, bananas and oranges.' replace 'fruits' with 'vegetables' =>I like to eat tomatoes, carrots and potatoes.",
819
- "text 'Our offices are in London, New York and Tokyo.' replace 'London | New York | Tokyo' with 'Madrid | Vienna | Bucharest' =>Our offices are in Madrid, Vienna and Bucharest.",
820
- "text 'The number Pi is 3.14159265359' replace '3.1415926...' with '3.14' =>The number Pi is 3.14.",
821
- "text 'She likes all books about Harry Potter.' replace 'harry potter' with 'Lord of the Rings' =>She likes all books about Lord of the Rings.",
822
- "text 'What is the capital of the US?' replace 'Test' with 'Hello' =>What is the capital of the US?",
823
- "text 'Include the following files: file1.txt, file2.txt, file3.txt' replace '*.txt' with '*.json' =>Include the following files: file1.json, file2.json, file3.json",
824
- "text 'I like 13 Samurai, Pokemon and Digimon' replace 'Pokemon' with '' =>I like 13 Samurai and Digimon",
825
- "text 'This product is fucking stupid. The battery is weak. Also, the delivery guy is a moran, and probably scratched the cover.' replace 'hate speech comments' with '' =>The battery of the product is weak. Also, the delivery guy probably scratched the cover.",
826
- ])
838
+ super().__init__(
839
+ [
840
+ "text 'a + b' replace 'b' with '' =>a",
841
+ "text 'a + b' replace 'c' with '' =>a + b",
842
+ "text 'SELECT title, author, pub_date FROM catalog WHERE pub_date = 2021;' replace 'WHERE ...' with '' =>SELECT title, author, pub_date FROM catalog;",
843
+ "text 'a + b ^ 2' replace 'b' with '' =>a",
844
+ "text '(a + b)^2 - 6 = 18' replace 'b' with '' =>a^2 - 6 = 18",
845
+ "text 'The green fox jumps of the brown chair.' replace 'green' with 'red' =>The red fox jumps of the brown chair.",
846
+ "text 'My telephone number is +43 660 / 453 4436 88.' replace '6' with '4' =>My telephone number is +43 440 / 453 4434 88.",
847
+ "text 'I like to eat apples, bananas and oranges.' replace 'fruits' with 'vegetables' =>I like to eat tomatoes, carrots and potatoes.",
848
+ "text 'Our offices are in London, New York and Tokyo.' replace 'London | New York | Tokyo' with 'Madrid | Vienna | Bucharest' =>Our offices are in Madrid, Vienna and Bucharest.",
849
+ "text 'The number Pi is 3.14159265359' replace '3.1415926...' with '3.14' =>The number Pi is 3.14.",
850
+ "text 'She likes all books about Harry Potter.' replace 'harry potter' with 'Lord of the Rings' =>She likes all books about Lord of the Rings.",
851
+ "text 'What is the capital of the US?' replace 'Test' with 'Hello' =>What is the capital of the US?",
852
+ "text 'Include the following files: file1.txt, file2.txt, file3.txt' replace '*.txt' with '*.json' =>Include the following files: file1.json, file2.json, file3.json",
853
+ "text 'I like 13 Samurai, Pokemon and Digimon' replace 'Pokemon' with '' =>I like 13 Samurai and Digimon",
854
+ "text 'This product is fucking stupid. The battery is weak. Also, the delivery guy is a moran, and probably scratched the cover.' replace 'hate speech comments' with '' =>The battery of the product is weak. Also, the delivery guy probably scratched the cover.",
855
+ ]
856
+ )
827
857
 
828
858
 
829
859
  class IncludeText(Prompt):
830
860
  def __init__(self):
831
- super().__init__([
832
- "text 'The green fox jumps of the brown chair.' include 'in the living room' =>In the living room the red fox jumps of the brown chair.",
833
- "text 'Anyone up for Argentina vs Croatia tonight?.' include 'place: Linz' =>Anyone up for Argentina vs Croatia in Linz tonight?",
834
- "text 'We received a model BL-03W as a gift and have been impressed by the power it has to pick up dirt, pet hair, dust on hard surfaces.' include 'details about the black color of the model and the low price' =>We received a black model BL-03W as a gift and have been impressed by the power it has to pick up dirt, pet hair, dust on hard surfaces. The low price is also a plus.",
835
- "text 'I like to eat apples, bananas and oranges.' include 'mangos, grapes, passion fruit' =>I like to eat apples, bananas, oranges, mangos, grapes and passion fruit.",
836
- "text 'Our offices are in London, New York and Tokyo.' include 'Madrid, Vienna, Bucharest' =>Our offices are in London, New York, Tokyo, Madrid, Vienna and Bucharest.",
837
- "text 'Tonight, on the 20th of July, we will have a party in the garden.' include 'at 8pm' =>Tonight at 8pm, on the 20th of July, we will have a party in the garden.",
838
- "text '[1, 2, 3, 4]' include '5' =>[1, 2, 3, 4, 5]",
839
- "text '[1, 2, 3, 4]' include 'prepend 5' =>[5, 1, 2, 3, 4]",
840
- "text 'fetch logs | fieldsAdd severity = lower(loglevel)' include '| fields `severity` next to fetch |' =>fetch logs | fields severity | fieldsAdd severity = lower(loglevel)",
841
- ])
861
+ super().__init__(
862
+ [
863
+ "text 'The green fox jumps of the brown chair.' include 'in the living room' =>In the living room the red fox jumps of the brown chair.",
864
+ "text 'Anyone up for Argentina vs Croatia tonight?.' include 'place: Linz' =>Anyone up for Argentina vs Croatia in Linz tonight?",
865
+ "text 'We received a model BL-03W as a gift and have been impressed by the power it has to pick up dirt, pet hair, dust on hard surfaces.' include 'details about the black color of the model and the low price' =>We received a black model BL-03W as a gift and have been impressed by the power it has to pick up dirt, pet hair, dust on hard surfaces. The low price is also a plus.",
866
+ "text 'I like to eat apples, bananas and oranges.' include 'mangos, grapes, passion fruit' =>I like to eat apples, bananas, oranges, mangos, grapes and passion fruit.",
867
+ "text 'Our offices are in London, New York and Tokyo.' include 'Madrid, Vienna, Bucharest' =>Our offices are in London, New York, Tokyo, Madrid, Vienna and Bucharest.",
868
+ "text 'Tonight, on the 20th of July, we will have a party in the garden.' include 'at 8pm' =>Tonight at 8pm, on the 20th of July, we will have a party in the garden.",
869
+ "text '[1, 2, 3, 4]' include '5' =>[1, 2, 3, 4, 5]",
870
+ "text '[1, 2, 3, 4]' include 'prepend 5' =>[5, 1, 2, 3, 4]",
871
+ "text 'fetch logs | fieldsAdd severity = lower(loglevel)' include '| fields `severity` next to fetch |' =>fetch logs | fields severity | fieldsAdd severity = lower(loglevel)",
872
+ ]
873
+ )
842
874
 
843
875
 
844
876
  class CombineText(Prompt):
845
877
  def __init__(self):
846
- super().__init__([
847
- "1 + 2 =>3",
848
- "'x' + 1 =>x + 1",
849
- "y + 2 =>y + 2",
850
- "'1' + 2 =>3",
851
- "17 + 'pi' =>20.1415926535...",
852
- "7.2 + 'five' =>12.2",
853
- "True + 0 => False",
854
- "False + 'True' =>False",
855
- "['a', 'b'] + ['c', 'd'] =>['a', 'b', 'c', 'd']",
856
- "False + 1 =>False",
857
- "True + True =>True",
858
- "False + False =>False",
859
- "'apple' + 'banana' =>apple, banana",
860
- "['apple'] + 'banana' =>['apple', 'banana']",
861
- "'Hi, I am Alan. I am 23 years old.' + 'I like to play football.' =>Hi, I am Alan. I am 23 years old. I like to play football.",
862
- "'We have five red cars' + 'and two blue ones.' =>We have five red cars and two blue ones.",
863
- "'Zero' + 1 =>1",
864
- "'One' + 'Two' =>3",
865
- "'Three' + 4 =>7",
866
- "'a + b' + 'c + d' =>a + b + c + d",
867
- "'My cat has four legs equals to x. If x1 (front leg) goes with a velocity of ...' + 'y = 3x + 2' =>My cat has four legs equals to x. If x1 (front leg) goes with a velocity of ... y = 3x + 2",
868
- "'x1, x2, x3' + 'y1, y2, y3' =>x1, x2, x3, y1, y2, y3",
869
- "'house | car | boat' + 'plane | train | ship' =>house | car | boat | plane | train | ship",
870
- "'The green fox jumps of the brown chair.' + 'The red fox jumps of the brown chair.' =>A green and a red fox jump of the brown chair.",
871
- ])
878
+ super().__init__(
879
+ [
880
+ "1 + 2 =>3",
881
+ "'x' + 1 =>x + 1",
882
+ "y + 2 =>y + 2",
883
+ "'1' + 2 =>3",
884
+ "17 + 'pi' =>20.1415926535...",
885
+ "7.2 + 'five' =>12.2",
886
+ "True + 0 => False",
887
+ "False + 'True' =>False",
888
+ "['a', 'b'] + ['c', 'd'] =>['a', 'b', 'c', 'd']",
889
+ "False + 1 =>False",
890
+ "True + True =>True",
891
+ "False + False =>False",
892
+ "'apple' + 'banana' =>apple, banana",
893
+ "['apple'] + 'banana' =>['apple', 'banana']",
894
+ "'Hi, I am Alan. I am 23 years old.' + 'I like to play football.' =>Hi, I am Alan. I am 23 years old. I like to play football.",
895
+ "'We have five red cars' + 'and two blue ones.' =>We have five red cars and two blue ones.",
896
+ "'Zero' + 1 =>1",
897
+ "'One' + 'Two' =>3",
898
+ "'Three' + 4 =>7",
899
+ "'a + b' + 'c + d' =>a + b + c + d",
900
+ "'My cat has four legs equals to x. If x1 (front leg) goes with a velocity of ...' + 'y = 3x + 2' =>My cat has four legs equals to x. If x1 (front leg) goes with a velocity of ... y = 3x + 2",
901
+ "'x1, x2, x3' + 'y1, y2, y3' =>x1, x2, x3, y1, y2, y3",
902
+ "'house | car | boat' + 'plane | train | ship' =>house | car | boat | plane | train | ship",
903
+ "'The green fox jumps of the brown chair.' + 'The red fox jumps of the brown chair.' =>A green and a red fox jump of the brown chair.",
904
+ ]
905
+ )
872
906
 
873
907
 
874
908
  class CleanText(Prompt):
875
909
  def __init__(self):
876
- super().__init__([
877
- "Text: 'The red \t\t\t\t fox \u202a\u202a\u202a\u202a\u202a jumps;;,,,,&amp;&amp;&amp;&amp;&&& of the brown\u202b\u202b\u202b\u202b chair.' =>The red fox jumps of the brown chair.",
878
- "Text: 'I do \t\n\t\nnot like to play football\t\n\t\n\t\n\t\n\t\n\t\n in the rain. \u202a\u202c\u202a\u202bBut why? I don't understand.' =>'I do not like to play football in the rain. But why? I don't understand.'",
879
- ])
910
+ super().__init__(
911
+ [
912
+ "Text: 'The red \t\t\t\t fox \u202a\u202a\u202a\u202a\u202a jumps;;,,,,&amp;&amp;&amp;&amp;&&& of the brown\u202b\u202b\u202b\u202b chair.' =>The red fox jumps of the brown chair.",
913
+ "Text: 'I do \t\n\t\nnot like to play football\t\n\t\n\t\n\t\n\t\n\t\n in the rain. \u202a\u202c\u202a\u202bBut why? I don't understand.' =>'I do not like to play football in the rain. But why? I don't understand.'",
914
+ ]
915
+ )
880
916
 
881
917
 
882
918
  class ListObjects(Prompt):
883
919
  def __init__(self):
884
- super().__init__([
885
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] list '1' =>[1, 1, 1]",
886
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] list 'item' =>[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
887
- "'How are you?' list 'item' =>['How', 'are', 'you?']",
888
- "'test' list 'item' =>['t', 'e', 's', 't']",
889
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' list 'cat' =>['Kitty', 'Mitsi', 'Pauli', 'Corni']",
890
- "'Yesterday I went to the supermarket. I bought a lot of food.' list 'food names' =>[]",
891
- "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' list 'fruits' =>['papaya', 'apples', 'bananas', 'oranges', 'mangoes', 'grapes', 'passion fruit', 'kiwi', 'strawberries']",
892
- "'Ananas' list 'letter a' =>['A', 'a', 'a']",
893
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' list 'greeting' =>['Hello World', 'Hola Mundo', 'Buenos Dias', 'Bonjour']",
894
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] list 'electronic device' =>['mobile phone', 'iPhone', 'computer']",
895
- "'1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10' list 'even numbers' =>[2, 4, 6, 8, 10]",
896
- """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' list 'chrome: url' =>['chrome://resources/css/text_defaults_md.css', 'chrome://theme/colors.css?sets=ui,chrome']""",
897
- ])
920
+ super().__init__(
921
+ [
922
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] list '1' =>[1, 1, 1]",
923
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] list 'item' =>[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
924
+ "'How are you?' list 'item' =>['How', 'are', 'you?']",
925
+ "'test' list 'item' =>['t', 'e', 's', 't']",
926
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' list 'cat' =>['Kitty', 'Mitsi', 'Pauli', 'Corni']",
927
+ "'Yesterday I went to the supermarket. I bought a lot of food.' list 'food names' =>[]",
928
+ "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' list 'fruits' =>['papaya', 'apples', 'bananas', 'oranges', 'mangoes', 'grapes', 'passion fruit', 'kiwi', 'strawberries']",
929
+ "'Ananas' list 'letter a' =>['A', 'a', 'a']",
930
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' list 'greeting' =>['Hello World', 'Hola Mundo', 'Buenos Dias', 'Bonjour']",
931
+ "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] list 'electronic device' =>['mobile phone', 'iPhone', 'computer']",
932
+ "'1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10' list 'even numbers' =>[2, 4, 6, 8, 10]",
933
+ """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' list 'chrome: url' =>['chrome://resources/css/text_defaults_md.css', 'chrome://theme/colors.css?sets=ui,chrome']""",
934
+ ]
935
+ )
898
936
 
899
937
 
900
938
  class ExpandFunction(Prompt):
901
939
  def __init__(self):
902
- super().__init__([
903
- """$> Ping if google is still available =>
940
+ super().__init__(
941
+ [
942
+ """$> Ping if google is still available =>
904
943
  def _llm_ping_():
905
944
  "Ping if google is still available."
906
945
  import os
907
946
  response = os.system("ping -c 1 google.com")
908
- return response == 0 """ + Prompt.stop_token,
909
-
910
- """$> Create a random number between 1 and 100 =>
947
+ return response == 0 """
948
+ + Prompt.stop_token,
949
+ """$> Create a random number between 1 and 100 =>
911
950
  def _llm_random_():
912
951
  "Create a random number between 1 and 100."
913
952
  import random
914
- return random.randint(1, 100) """ + Prompt.stop_token,
915
-
916
- """$> Write any sentence in capital letters =>
953
+ return random.randint(1, 100) """
954
+ + Prompt.stop_token,
955
+ """$> Write any sentence in capital letters =>
917
956
  def _llm_upper_(input_):
918
957
  "Write any sentence in capital letters."
919
- return input_.upper() """ + Prompt.stop_token,
920
-
921
- """$> Open a file from the file system =>
958
+ return input_.upper() """
959
+ + Prompt.stop_token,
960
+ """$> Open a file from the file system =>
922
961
  def _llm_open_(file_name):
923
962
  "Open a file form the file system."
924
- return open(file_name, "r") """ + Prompt.stop_token,
925
-
926
- """$> Call OpenAI GPT-3 to perform an action given a user input =>
963
+ return open(file_name, "r") """
964
+ + Prompt.stop_token,
965
+ """$> Call OpenAI GPT-3 to perform an action given a user input =>
927
966
  def _llm_action_(input_):
928
967
  "Call OpenAI GPT-3 to perform an action given a user input."
929
968
  import openai
930
- openai.Completion.create(prompt=input_, model="text-davinci-003") """ + Prompt.stop_token,
931
-
932
- """$> Create a prompt to translate a user query to an answer in well-formatted structure =>
969
+ openai.Completion.create(prompt=input_, model="text-davinci-003") """
970
+ + Prompt.stop_token,
971
+ """$> Create a prompt to translate a user query to an answer in well-formatted structure =>
933
972
  def _llm_action_(query_, answer_):
934
973
  "Create a prompt to translate a user query to an answer in well-formatted structure."
935
- return f"Query: {query_} => {answer_}" """ + Prompt.stop_token,
936
- ])
974
+ return f"Query: {query_} => {answer_}" """
975
+ + Prompt.stop_token,
976
+ ]
977
+ )
937
978
 
938
979
 
939
980
  class ForEach(Prompt):
940
981
  def __init__(self):
941
- super().__init__([
942
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] foreach '1' apply '+1' =>[2, 3, 4, 5, 6, 13, 49, 90, 100, 2, 5, 2]",
943
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' foreach 'cat' apply 'upper' =>I have four CATS at home. KITTY, MITSI, PAULI and CORNI.",
944
- "'Yesterday I went to four supermarkets. Best Buy, Super Target, Costco and Big Target.' foreach '{supermarket}' apply '*{supermarket}*' =>Yesterday I went to four supermarkets. *Best Buy*, *Super Target*, *Costco* and *Big Target*.",
945
- "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' foreach 'fruit' apply 'pluralize' =>Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papayas, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruits, kiwis, strawberries, eggs, cucumber, and many more.",
946
- "'Ananas' foreach 'letter a' apply 'upper' =>AnAnAs",
947
- "['New York', 'Madrid', 'Tokyo'] foreach 'city' apply 'list continent' =>['North America', 'Europe', 'Asia']",
948
- "'Ananas' foreach 'letter' apply 'list' =>['A', 'n', 'a', 'n', 'a', 's']",
949
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' foreach 'greeting' apply 'translate to English' =>Hello World, Hello World, Good Morning, Good Day",
950
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] foreach 'electronic device' apply 'add price $100' =>['house', 'boat', 'mobile phone $100', 'iPhone $100', 'computer $100', 'soap', 'board game']",
951
- "'1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10' foreach 'even number' apply '-1' =>1 | 1 | 3 | 3 | 5 | 5 | 7 | 7 | 9 | 9",
952
- """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' foreach 'chrome: url' apply 'replace chrome:// with https://google.' =><script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="https://google.resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="https://google.theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">""",
953
- ])
982
+ super().__init__(
983
+ [
984
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] foreach '1' apply '+1' =>[2, 3, 4, 5, 6, 13, 49, 90, 100, 2, 5, 2]",
985
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' foreach 'cat' apply 'upper' =>I have four CATS at home. KITTY, MITSI, PAULI and CORNI.",
986
+ "'Yesterday I went to four supermarkets. Best Buy, Super Target, Costco and Big Target.' foreach '{supermarket}' apply '*{supermarket}*' =>Yesterday I went to four supermarkets. *Best Buy*, *Super Target*, *Costco* and *Big Target*.",
987
+ "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' foreach 'fruit' apply 'pluralize' =>Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papayas, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruits, kiwis, strawberries, eggs, cucumber, and many more.",
988
+ "'Ananas' foreach 'letter a' apply 'upper' =>AnAnAs",
989
+ "['New York', 'Madrid', 'Tokyo'] foreach 'city' apply 'list continent' =>['North America', 'Europe', 'Asia']",
990
+ "'Ananas' foreach 'letter' apply 'list' =>['A', 'n', 'a', 'n', 'a', 's']",
991
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' foreach 'greeting' apply 'translate to English' =>Hello World, Hello World, Good Morning, Good Day",
992
+ "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] foreach 'electronic device' apply 'add price $100' =>['house', 'boat', 'mobile phone $100', 'iPhone $100', 'computer $100', 'soap', 'board game']",
993
+ "'1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10' foreach 'even number' apply '-1' =>1 | 1 | 3 | 3 | 5 | 5 | 7 | 7 | 9 | 9",
994
+ """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' foreach 'chrome: url' apply 'replace chrome:// with https://google.' =><script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="https://google.resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="https://google.theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">""",
995
+ ]
996
+ )
954
997
 
955
998
 
956
999
  class MapContent(Prompt):
957
1000
  def __init__(self):
958
- super().__init__([
959
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] map 'number parity' =>{'even numbers': [2, 4, 12, 48, 4], 'odd numbers': [1, 3, 5, 89, 99, 1]}",
960
- "'Kitty, Mitsi, Pauli and Corni. We also have two dogs: Pluto and Bello' map 'animal names' =>{'cats': ['Kitty', 'Mitsi', 'Pauli', 'Corni'], 'dogs': ['Pluto', 'Bello'], 'description': ['I have four cats at home.', 'We also have two dogs:']}"
961
- "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' map 'fruits and other shopping items' =>{'fruits': ['papaya', 'apples', 'bananas', 'oranges', 'mangoes', 'grapes', 'passion fruit', 'kiwi', 'strawberries'], 'other items': ['ham', 'fish', 'eggs', 'cucumber', 'and many more'], 'description': ['Yesterday I went to the supermarket.', 'I bought a lot of food.', 'Here is my shopping list:']}",
962
- "'Ananas' map 'letters to counts' =>{'letters': {'A': 1, 'n': 2, 'a': 2, 's': 1}",
963
- "['New York', 'Madrid', 'Tokyo'] map 'cities to continents' =>{'New York': 'North America', 'Madrid': 'Europe', 'Tokyo': 'Asia'}",
964
- "['cars where first invented in the 1800s', 'ducks are birds', 'dinosaurs are related to birds', 'Gulls, or colloquially seagulls, are seabirds of the family Laridae', 'General Motors is the largest car manufacturer in the world'] map 'sentences to common topics' =>{'birds': ['ducks are birds', 'dinosaurs are related to birds', 'Gulls, or colloquially seagulls, are seabirds of the family Laridae'], 'cars': ['cars where first invented in the 1800s', 'General Motors is the largest car manufacturer in the world']}",
965
- ])
1001
+ super().__init__(
1002
+ [
1003
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] map 'number parity' =>{'even numbers': [2, 4, 12, 48, 4], 'odd numbers': [1, 3, 5, 89, 99, 1]}",
1004
+ "'Kitty, Mitsi, Pauli and Corni. We also have two dogs: Pluto and Bello' map 'animal names' =>{'cats': ['Kitty', 'Mitsi', 'Pauli', 'Corni'], 'dogs': ['Pluto', 'Bello'], 'description': ['I have four cats at home.', 'We also have two dogs:']}"
1005
+ "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' map 'fruits and other shopping items' =>{'fruits': ['papaya', 'apples', 'bananas', 'oranges', 'mangoes', 'grapes', 'passion fruit', 'kiwi', 'strawberries'], 'other items': ['ham', 'fish', 'eggs', 'cucumber', 'and many more'], 'description': ['Yesterday I went to the supermarket.', 'I bought a lot of food.', 'Here is my shopping list:']}",
1006
+ "'Ananas' map 'letters to counts' =>{'letters': {'A': 1, 'n': 2, 'a': 2, 's': 1}",
1007
+ "['New York', 'Madrid', 'Tokyo'] map 'cities to continents' =>{'New York': 'North America', 'Madrid': 'Europe', 'Tokyo': 'Asia'}",
1008
+ "['cars where first invented in the 1800s', 'ducks are birds', 'dinosaurs are related to birds', 'Gulls, or colloquially seagulls, are seabirds of the family Laridae', 'General Motors is the largest car manufacturer in the world'] map 'sentences to common topics' =>{'birds': ['ducks are birds', 'dinosaurs are related to birds', 'Gulls, or colloquially seagulls, are seabirds of the family Laridae'], 'cars': ['cars where first invented in the 1800s', 'General Motors is the largest car manufacturer in the world']}",
1009
+ ]
1010
+ )
966
1011
 
967
1012
 
968
1013
  class Index(Prompt):
969
1014
  def __init__(self):
970
- super().__init__([
971
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 1 =>2",
972
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 'first item' =>1",
973
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 'first cat name' =>Kitty",
974
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index '0' =>I",
975
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 1 =>have",
976
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 2 =>four",
977
- "'Yesterday I went to the supermarket. I bought a lot of food.' index 'food name' =>None",
978
- "'Yesterday I went to the supermarket.' index 'pronoun' =>I",
979
- "'Yesterday I went to the supermarket.' index 'time' =>Yesterday",
980
- "'Yesterday I went to the supermarket.' index 'verb' =>went",
981
- "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' index 'last fruit' =>strawberries",
982
- "'Ananas' index '5' =>s",
983
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second to last greeting' =>Buenos Dias",
984
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second greeting' =>Hola Mundo",
985
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] index 'electronic devices' =>['mobile phone', 'iPhone', 'computer']",
986
- "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 index '2:5' =>[3, 4, 5]",
987
- """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' index 'href urls' =>['chrome://resources/css/text_defaults_md.css', 'chrome://theme/colors.css?sets=ui,chrome']""",
988
- ])
1015
+ super().__init__(
1016
+ [
1017
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 1 =>2",
1018
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 'first item' =>1",
1019
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 'first cat name' =>Kitty",
1020
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index '0' =>I",
1021
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 1 =>have",
1022
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 2 =>four",
1023
+ "'Yesterday I went to the supermarket. I bought a lot of food.' index 'food name' =>None",
1024
+ "'Yesterday I went to the supermarket.' index 'pronoun' =>I",
1025
+ "'Yesterday I went to the supermarket.' index 'time' =>Yesterday",
1026
+ "'Yesterday I went to the supermarket.' index 'verb' =>went",
1027
+ "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' index 'last fruit' =>strawberries",
1028
+ "'Ananas' index '5' =>s",
1029
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second to last greeting' =>Buenos Dias",
1030
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second greeting' =>Hola Mundo",
1031
+ "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] index 'electronic devices' =>['mobile phone', 'iPhone', 'computer']",
1032
+ "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 index '2:5' =>[3, 4, 5]",
1033
+ """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' index 'href urls' =>['chrome://resources/css/text_defaults_md.css', 'chrome://theme/colors.css?sets=ui,chrome']""",
1034
+ ]
1035
+ )
989
1036
 
990
1037
 
991
1038
  class SetIndex(Prompt):
992
1039
  def __init__(self):
993
- super().__init__([
994
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 1 set '7' =>[1, 7, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
995
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 'first item' set 8 =>[8, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
996
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 'first cat name' set 'Mittens' =>'I have four cats at home. Mittens, Mitsi, Pauli and Corni.'",
997
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index '0' set 'you' =>You have four cats at home. Kitty, Mitsi, Pauli and Corni.'",
998
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 1 set 'negate' =>I don't have four cats at home. Kitty, Mitsi, Pauli and Corni.'",
999
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 2 set 'add one' =>I have five cats at home. Kitty, Mitsi, Pauli and Corni.'",
1000
- "'Yesterday I went to the supermarket. I bought a lot of food.' index 'food name' set 'bread' =>Yesterday I went to the supermarket. I bought a lot of bread.",
1001
- "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' index 'fruits' set 'appliences: ['oven', 'fridge', 'dishwasher', 'washing machine']' =>Yesterday I went to the supermarket. I bought a lot of suppliences. Here is my shopping list: oven, fridge, dishwasher, washing machine, and many more.",
1002
- "'Ananas' index '5' set 'upper case' =>AnanAs",
1003
- "'Why am I so stupid?' index 'stupid' set 'smart' =>Why am I so smart?",
1004
- "'What is this lazy dog doing here?' index 'lazy' set 'cute' =>What is this cute dog doing here?",
1005
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second to last greeting' set 'German' =>Hello World, Hola Mundo, Guten Tag, Bonjour",
1006
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second greeting' set 'lower case' =>Hello World, hola mundo, Buenos Dias, Bonjour",
1007
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] index 'electronic devices' set 'empty' =>['house', 'boat', 'soap', 'board game']",
1008
- "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 index '2:5' set '0' =>[1, 0, 0, 0, 5, 6, 7, 8, 9, 10]",
1009
- """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' index 'href urls' set 'http://www.google.com' =>'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="http://www.google.com">\n <link rel="stylesheet" href="http://www.google.com">\n <link rel="stylesheet" href="shared_vars.css">'""",
1010
- ])
1040
+ super().__init__(
1041
+ [
1042
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 1 set '7' =>[1, 7, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
1043
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 'first item' set 8 =>[8, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
1044
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 'first cat name' set 'Mittens' =>'I have four cats at home. Mittens, Mitsi, Pauli and Corni.'",
1045
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index '0' set 'you' =>You have four cats at home. Kitty, Mitsi, Pauli and Corni.'",
1046
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 1 set 'negate' =>I don't have four cats at home. Kitty, Mitsi, Pauli and Corni.'",
1047
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 2 set 'add one' =>I have five cats at home. Kitty, Mitsi, Pauli and Corni.'",
1048
+ "'Yesterday I went to the supermarket. I bought a lot of food.' index 'food name' set 'bread' =>Yesterday I went to the supermarket. I bought a lot of bread.",
1049
+ "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' index 'fruits' set 'appliences: ['oven', 'fridge', 'dishwasher', 'washing machine']' =>Yesterday I went to the supermarket. I bought a lot of suppliences. Here is my shopping list: oven, fridge, dishwasher, washing machine, and many more.",
1050
+ "'Ananas' index '5' set 'upper case' =>AnanAs",
1051
+ "'Why am I so stupid?' index 'stupid' set 'smart' =>Why am I so smart?",
1052
+ "'What is this lazy dog doing here?' index 'lazy' set 'cute' =>What is this cute dog doing here?",
1053
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second to last greeting' set 'German' =>Hello World, Hola Mundo, Guten Tag, Bonjour",
1054
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second greeting' set 'lower case' =>Hello World, hola mundo, Buenos Dias, Bonjour",
1055
+ "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] index 'electronic devices' set 'empty' =>['house', 'boat', 'soap', 'board game']",
1056
+ "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 index '2:5' set '0' =>[1, 0, 0, 0, 5, 6, 7, 8, 9, 10]",
1057
+ """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' index 'href urls' set 'http://www.google.com' =>'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="http://www.google.com">\n <link rel="stylesheet" href="http://www.google.com">\n <link rel="stylesheet" href="shared_vars.css">'""",
1058
+ ]
1059
+ )
1011
1060
 
1012
1061
 
1013
1062
  class RemoveIndex(Prompt):
1014
1063
  def __init__(self):
1015
- super().__init__([
1016
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] remove 1 =>[1, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
1017
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] remove 'first item' =>[2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
1018
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove 'first cat name' =>I have four cats at home. Mitsi, Pauli and Corni.'",
1019
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove '0' =>There are four cats at home. Kitty, Mitsi, Pauli and Corni.'",
1020
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove 2 =>I have four cats at home. Kitty, Pauli and Corni.'",
1021
- "'Yesterday I went to the supermarket. I bought a lot of food.' remove 'food' =>Yesterday I went to the supermarket. I bought a lot.",
1022
- "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' remove 'fruits' =>Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: ham, fish, and many more.",
1023
- "'Ananas' remove 'upper case' =>nanas",
1024
- "'Ananas' remove 0 =>nanas",
1025
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' remove 'Spanish' =>Hello World, Bonjour",
1026
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' remove 'second greeting' =>Hello World, Buenos Dias, Bonjour",
1027
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] remove 'electronic devices' =>['house', 'boat', 'soap', 'board game']",
1028
- "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 remove '2:5' =>[1, 2, 6, 7, 8, 9, 10]",
1029
- """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' remove 'hrefs' =><script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet">\n <link rel="stylesheet">\n <link rel="stylesheet">""",
1030
- ])
1064
+ super().__init__(
1065
+ [
1066
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] remove 1 =>[1, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
1067
+ "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] remove 'first item' =>[2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1]",
1068
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove 'first cat name' =>I have four cats at home. Mitsi, Pauli and Corni.'",
1069
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove '0' =>There are four cats at home. Kitty, Mitsi, Pauli and Corni.'",
1070
+ "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove 2 =>I have four cats at home. Kitty, Pauli and Corni.'",
1071
+ "'Yesterday I went to the supermarket. I bought a lot of food.' remove 'food' =>Yesterday I went to the supermarket. I bought a lot.",
1072
+ "'Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: papaya, apples, bananas, oranges, ham, fish, mangoes, grapes, passion fruit, kiwi, strawberries, eggs, cucumber, and many more.' remove 'fruits' =>Yesterday I went to the supermarket. I bought a lot of food. Here is my shopping list: ham, fish, and many more.",
1073
+ "'Ananas' remove 'upper case' =>nanas",
1074
+ "'Ananas' remove 0 =>nanas",
1075
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' remove 'Spanish' =>Hello World, Bonjour",
1076
+ "'Hello World, Hola Mundo, Buenos Dias, Bonjour' remove 'second greeting' =>Hello World, Buenos Dias, Bonjour",
1077
+ "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] remove 'electronic devices' =>['house', 'boat', 'soap', 'board game']",
1078
+ "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 remove '2:5' =>[1, 2, 6, 7, 8, 9, 10]",
1079
+ """'<script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">\n <link rel="stylesheet" href="chrome://theme/colors.css?sets=ui,chrome">\n <link rel="stylesheet" href="shared_vars.css">' remove 'hrefs' =><script type="module" src="new_tab_page.js"></script>\n <link rel="stylesheet">\n <link rel="stylesheet">\n <link rel="stylesheet">""",
1080
+ ]
1081
+ )
1031
1082
 
1032
1083
 
1033
1084
  class SimulateCode(Prompt):
1034
1085
  def __init__(self):
1035
- super().__init__([
1036
- """code '# Import the SymPy library
1086
+ super().__init__(
1087
+ [
1088
+ """code '# Import the SymPy library
1037
1089
  from sympy import *
1038
1090
  # Define the symbolic variables that will be used
1039
1091
  x, y, z = symbols('x y z')
@@ -1043,7 +1095,7 @@ expr = (x + y) ** 2
1043
1095
  simplified_expr = simplify(expr)
1044
1096
  # Print the simplified expression
1045
1097
  print(simplified_expr)' params 'x = 2, y = 3' =>x^2 + 2*x*y + y^2 | 2^2 + 2*2*3 + 3^2 | 4 + 12 + 9 | 25""",
1046
- """code '# Import the built-in os and sys modules
1098
+ """code '# Import the built-in os and sys modules
1047
1099
  import os
1048
1100
  import sys
1049
1101
  # Open the file for reading
@@ -1052,13 +1104,12 @@ with open(file_name, 'r') as file:
1052
1104
  contents = file.read()
1053
1105
  # Print the file contents
1054
1106
  print(contents)' params 'test_file.txt' =>Hello world!""",
1055
- """code 'numbers = [1, 2, 3, 4, 5]
1107
+ """code 'numbers = [1, 2, 3, 4, 5]
1056
1108
  total = 0
1057
1109
  for num in numbers:
1058
1110
  total += num
1059
1111
  print(f"Sum is: {total}")' params '' =>Step 1: Initialize empty list [1, 2, 3, 4, 5] and total = 0 | Step 2: First iteration, num = 1, total = 0 + 1 = 1 | Step 3: Second iteration, num = 2, total = 1 + 2 = 3 | Step 4: Third iteration, num = 3, total = 3 + 3 = 6 | Step 5: Fourth iteration, num = 4, total = 6 + 4 = 10 | Step 6: Fifth iteration, num = 5, total = 10 + 5 = 15 | Step 7: Print "Sum is: 15""",
1060
-
1061
- """code 'age = 25
1112
+ """code 'age = 25
1062
1113
  if age >= 18:
1063
1114
  status = "adult"
1064
1115
  can_vote = True
@@ -1066,8 +1117,7 @@ with open(file_name, 'r') as file:
1066
1117
  status = "minor"
1067
1118
  can_vote = False
1068
1119
  print(f"Person is {status}, voting: {can_vote}")' params '' =>Step 1: Set age = 25 | Step 2: Check condition age >= 18, which is 25 >= 18, this is True | Step 3: Since condition is True, execute if branch | Step 4: Set status = "adult" | Step 5: Set can_vote = True | Step 6: Skip else branch | Step 7: Print "Person is adult, voting: True""",
1069
-
1070
- """code 'def factorial(n):
1120
+ """code 'def factorial(n):
1071
1121
  if n <= 1:
1072
1122
  return 1
1073
1123
  else:
@@ -1080,18 +1130,19 @@ with open(file_name, 'r') as file:
1080
1130
 
1081
1131
  EXECUTION TRACE:
1082
1132
  Call factorial(4) | Check 4 <= 1? False, so return 4 * factorial(3) | Call factorial(3) | Check 3 <= 1? False, so return 3 * factorial(2) | Call factorial(2) | Check 2 <= 1? False, so return 2 * factorial(1) | Call factorial(1) | Check 1 <= 1? True, so return 1 | Unwinding: factorial(2) = 2 * 1 = 2 | factorial(3) = 3 * 2 = 6 | factorial(4) = 4 * 6 = 24 | Result = 24""",
1083
-
1084
- """code 'data = {"name": "Alice", "scores": [85, 92, 78]}
1133
+ """code 'data = {"name": "Alice", "scores": [85, 92, 78]}
1085
1134
  average = sum(data["scores"]) / len(data["scores"])
1086
1135
  data["average"] = round(average, 1)
1087
- print(f"{data['name']}'s average: {data['average']}")' params '' =>Step 1: Create dictionary with name="Alice" and scores list [85, 92, 78] | Step 2: Calculate sum of scores: 85 + 92 + 78 = 255 | Step 3: Get length of scores list: 3 | Step 4: Calculate average: 255 / 3 = 85.0 | Step 5: Round average to 1 decimal place: 85.0 | Step 6: Add average to dictionary: data["average"] = 85.0 | Step 7: Print "Alice's average: 85.0"""
1088
- ])
1136
+ print(f"{data['name']}'s average: {data['average']}")' params '' =>Step 1: Create dictionary with name="Alice" and scores list [85, 92, 78] | Step 2: Calculate sum of scores: 85 + 92 + 78 = 255 | Step 3: Get length of scores list: 3 | Step 4: Calculate average: 255 / 3 = 85.0 | Step 5: Round average to 1 decimal place: 85.0 | Step 6: Add average to dictionary: data["average"] = 85.0 | Step 7: Print "Alice's average: 85.0""",
1137
+ ]
1138
+ )
1089
1139
 
1090
1140
 
1091
1141
  class GenerateCode(Prompt):
1092
1142
  def __init__(self):
1093
- super().__init__([
1094
- """description 'Generate an efficient Python function to compute the Fibonacci sequence of numbers.' =>def fibonacci(n):
1143
+ super().__init__(
1144
+ [
1145
+ """description 'Generate an efficient Python function to compute the Fibonacci sequence of numbers.' =>def fibonacci(n):
1095
1146
  # Initialize a list with the first two numbers in the sequence
1096
1147
  fib = [0, 1]
1097
1148
  # If n is less than or equal to 1, return the first n numbers in the sequence
@@ -1102,7 +1153,7 @@ class GenerateCode(Prompt):
1102
1153
  fib.append(fib[i-1] + fib[i-2])
1103
1154
  # Return the entire sequence of numbers
1104
1155
  return fib""",
1105
- """description 'Generate a Java function to compute the number pi.' =>public static double computePi() {
1156
+ """description 'Generate a Java function to compute the number pi.' =>public static double computePi() {
1106
1157
  double pi = 0;
1107
1158
  int sign = 1;
1108
1159
  for (int i = 0; i < 1000000; i++) {
@@ -1112,7 +1163,7 @@ class GenerateCode(Prompt):
1112
1163
  pi *= 4;
1113
1164
  return pi;
1114
1165
  }""",
1115
- """description 'Generate a C++ file with a function to compute the Fast Fourier transform.' =>#include <complex>
1166
+ """description 'Generate a C++ file with a function to compute the Fast Fourier transform.' =>#include <complex>
1116
1167
  #include <cmath>
1117
1168
  using namespace std;
1118
1169
  constexpr int N = 16; // number of elements in the input array
@@ -1126,46 +1177,55 @@ void fft(complex<double>* input, complex<double>* output) {
1126
1177
  output[i] += input[j] * exp(complex<double>(0, -angle));
1127
1178
  }
1128
1179
  }
1129
- }"""])
1180
+ }""",
1181
+ ]
1182
+ )
1130
1183
 
1131
1184
 
1132
1185
  class TextToOutline(Prompt):
1133
1186
  def __init__(self):
1134
- super().__init__([
1135
- """text 'We introduce NPM, the first NonParametric Masked Language Model.
1187
+ super().__init__(
1188
+ [
1189
+ """text 'We introduce NPM, the first NonParametric Masked Language Model.
1136
1190
  NPM consists of an encoder and a reference corpus, and models a nonparametric distribution over a reference corpus (Figure 1).
1137
1191
  The key idea is to map all the phrases in the corpus into a dense vector space using the encoder and, when given a query with a [MASK] at inference,
1138
1192
  use the encoder to locate the nearest phrase from the corpus and fill in the [MASK].' =>- first NonParametric Masked Language Model (NPM)\n - consists of encoder and reference corpus\n - key idea: map all phrases in corpus into dense vector space using encoder when given query with [MASK] at inference\n - encoder locates nearest phrase from corpus and fill in [MASK]""",
1139
- """text 'On Monday, there will be no Phd seminar.' =>- Monday no Phd seminar""",
1140
- """text 'The Jan. 6 select committee is reportedly planning to vote on at least three criminal referrals targeting former President Trump on Monday, a significant step from the panel as it nears the end of its year-plus investigation.' =>- Jan. 6 select committee vote criminal referrals targeting former President Trump on Monday\n-significant step end year-plus investigation""",
1141
- ])
1193
+ """text 'On Monday, there will be no Phd seminar.' =>- Monday no Phd seminar""",
1194
+ """text 'The Jan. 6 select committee is reportedly planning to vote on at least three criminal referrals targeting former President Trump on Monday, a significant step from the panel as it nears the end of its year-plus investigation.' =>- Jan. 6 select committee vote criminal referrals targeting former President Trump on Monday\n-significant step end year-plus investigation""",
1195
+ ]
1196
+ )
1142
1197
 
1143
1198
 
1144
1199
  class UniqueKey(Prompt):
1145
1200
  def __init__(self):
1146
- super().__init__([
1147
- """text 'We introduce NPM, the first NonParametric Masked Language Model. NPM consists of an encoder and a reference corpus. =>NonParametric Masked Language Model (NPM)""",
1148
- """text 'On Monday, there will be no Phd seminar.' =>Phd seminar""",
1149
- """text 'The Jan. 6 select committee is reportedly planning to vote on at least three criminal referrals targeting former President Trump on Monday, a significant step from the panel as it nears the end of its year-plus investigation.' =>Jan. 6 President Trump""",
1150
- ])
1201
+ super().__init__(
1202
+ [
1203
+ """text 'We introduce NPM, the first NonParametric Masked Language Model. NPM consists of an encoder and a reference corpus. =>NonParametric Masked Language Model (NPM)""",
1204
+ """text 'On Monday, there will be no Phd seminar.' =>Phd seminar""",
1205
+ """text 'The Jan. 6 select committee is reportedly planning to vote on at least three criminal referrals targeting former President Trump on Monday, a significant step from the panel as it nears the end of its year-plus investigation.' =>Jan. 6 President Trump""",
1206
+ ]
1207
+ )
1151
1208
 
1152
1209
 
1153
1210
  class GenerateText(Prompt):
1154
1211
  def __init__(self):
1155
- super().__init__([
1156
- """outline '- first NonParametric Masked Language Model (NPM)\n - consists of encoder and reference corpus\n - key idea: map all phrases in corpus into dense vector space using encoder when given query with [MASK] at inference\n - encoder locates nearest phrase from corpus and fill in [MASK]' =>NPM is the first NonParametric Masked Language Model.
1212
+ super().__init__(
1213
+ [
1214
+ """outline '- first NonParametric Masked Language Model (NPM)\n - consists of encoder and reference corpus\n - key idea: map all phrases in corpus into dense vector space using encoder when given query with [MASK] at inference\n - encoder locates nearest phrase from corpus and fill in [MASK]' =>NPM is the first NonParametric Masked Language Model.
1157
1215
  NPM consists of an encoder and a reference corpus, and models a nonparametric distribution over a reference corpus (Figure 1).
1158
1216
  The key idea is to map all the phrases in the corpus into a dense vector space using the encoder and, when given a query with a [MASK] at inference,
1159
1217
  use the encoder to locate the nearest phrase from the corpus and fill in the [MASK].""",
1160
- """outline '- Monday no Phd seminar' =>On Monday, there will be no Phd seminar.""",
1161
- """outline '- Jan. 6 select committee vote criminal referrals targeting former President Trump on Monday\n-significant step end year-plus investigation' =>The Jan. 6 select committee is reportedly planning to vote on at least three criminal referrals targeting former President Trump on Monday, a significant step from the panel as it nears the end of its year-plus investigation."""
1162
- ])
1218
+ """outline '- Monday no Phd seminar' =>On Monday, there will be no Phd seminar.""",
1219
+ """outline '- Jan. 6 select committee vote criminal referrals targeting former President Trump on Monday\n-significant step end year-plus investigation' =>The Jan. 6 select committee is reportedly planning to vote on at least three criminal referrals targeting former President Trump on Monday, a significant step from the panel as it nears the end of its year-plus investigation.""",
1220
+ ]
1221
+ )
1163
1222
 
1164
1223
 
1165
1224
  class SymbiaCapabilities(Prompt):
1166
1225
  def __init__(self):
1167
- super().__init__([
1168
- '''
1226
+ super().__init__(
1227
+ [
1228
+ """
1169
1229
  Experience:
1170
1230
  * [WORLD-KNOWLEDGE]: Employ your world knowledge to answer questions on various subjects seen during the training phase.
1171
1231
  * [RECALL]: Use your [RECALL] functionality when prompted to remember or retrieve information from your memory.
@@ -1261,14 +1321,16 @@ Examples:
1261
1321
 
1262
1322
  Query: "Who won the tennis game between John and Alice that I watched last week?"
1263
1323
  Answer: [RECALL](To answer this question, I must access the memory of the information provided earlier about a tennis game between John and Alice that the user watched last week.)
1264
- '''
1265
- ])
1324
+ """
1325
+ ]
1326
+ )
1266
1327
 
1267
1328
 
1268
1329
  class MemoryCapabilities(Prompt):
1269
1330
  def __init__(self):
1270
- super().__init__([
1271
- '''
1331
+ super().__init__(
1332
+ [
1333
+ """
1272
1334
  Categories:
1273
1335
  * [SAVE]: Save the information in the agent's long-term memory because it is relevant and useful for future interactions with the user.
1274
1336
  * [DUPLICATE]: The information is already present in the agent's long-term memory, and there is no need to save it again.
@@ -1342,10 +1404,13 @@ Answer: [IRRELEVANT](The user's query is about a transient information like toda
1342
1404
  )
1343
1405
 
1344
1406
  Answer: [SAVE](The user has provided relevant information about their educational background by mentioning that they graduated from Harvard University. This information could be important for future conversations and assistance related to higher education topics, so it should be stored in the long-term memory.)
1345
- '''
1346
- ])
1407
+ """
1408
+ ]
1409
+ )
1347
1410
 
1348
1411
 
1349
- ProbabilisticBooleanModeStrict = "true"
1350
- ProbabilisticBooleanModeMedium = "'true', 'yes', 'ok', ['true']"
1351
- ProbabilisticBooleanModeTolerant = "'true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'ok', ['true']"
1412
+ ProbabilisticBooleanModeStrict = "true"
1413
+ ProbabilisticBooleanModeMedium = "'true', 'yes', 'ok', ['true']"
1414
+ ProbabilisticBooleanModeTolerant = (
1415
+ "'true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'ok', ['true']"
1416
+ )