symbolicai 0.21.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 (134) hide show
  1. symai/__init__.py +269 -173
  2. symai/backend/base.py +123 -110
  3. symai/backend/engines/drawing/engine_bfl.py +45 -44
  4. symai/backend/engines/drawing/engine_gpt_image.py +112 -97
  5. symai/backend/engines/embedding/engine_llama_cpp.py +63 -52
  6. symai/backend/engines/embedding/engine_openai.py +25 -21
  7. symai/backend/engines/execute/engine_python.py +19 -18
  8. symai/backend/engines/files/engine_io.py +104 -95
  9. symai/backend/engines/imagecaptioning/engine_blip2.py +28 -24
  10. symai/backend/engines/imagecaptioning/engine_llavacpp_client.py +102 -79
  11. symai/backend/engines/index/engine_pinecone.py +124 -97
  12. symai/backend/engines/index/engine_qdrant.py +1011 -0
  13. symai/backend/engines/index/engine_vectordb.py +84 -56
  14. symai/backend/engines/lean/engine_lean4.py +96 -52
  15. symai/backend/engines/neurosymbolic/__init__.py +41 -13
  16. symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_chat.py +330 -248
  17. symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_reasoning.py +329 -264
  18. symai/backend/engines/neurosymbolic/engine_cerebras.py +328 -0
  19. symai/backend/engines/neurosymbolic/engine_deepseekX_reasoning.py +118 -88
  20. symai/backend/engines/neurosymbolic/engine_google_geminiX_reasoning.py +344 -299
  21. symai/backend/engines/neurosymbolic/engine_groq.py +173 -115
  22. symai/backend/engines/neurosymbolic/engine_huggingface.py +114 -84
  23. symai/backend/engines/neurosymbolic/engine_llama_cpp.py +144 -118
  24. symai/backend/engines/neurosymbolic/engine_openai_gptX_chat.py +415 -307
  25. symai/backend/engines/neurosymbolic/engine_openai_gptX_reasoning.py +394 -231
  26. symai/backend/engines/ocr/engine_apilayer.py +23 -27
  27. symai/backend/engines/output/engine_stdout.py +10 -13
  28. symai/backend/engines/{webscraping → scrape}/engine_requests.py +101 -54
  29. symai/backend/engines/search/engine_openai.py +100 -88
  30. symai/backend/engines/search/engine_parallel.py +665 -0
  31. symai/backend/engines/search/engine_perplexity.py +44 -45
  32. symai/backend/engines/search/engine_serpapi.py +37 -34
  33. symai/backend/engines/speech_to_text/engine_local_whisper.py +54 -51
  34. symai/backend/engines/symbolic/engine_wolframalpha.py +15 -9
  35. symai/backend/engines/text_to_speech/engine_openai.py +20 -26
  36. symai/backend/engines/text_vision/engine_clip.py +39 -37
  37. symai/backend/engines/userinput/engine_console.py +5 -6
  38. symai/backend/mixin/__init__.py +13 -0
  39. symai/backend/mixin/anthropic.py +48 -38
  40. symai/backend/mixin/deepseek.py +6 -5
  41. symai/backend/mixin/google.py +7 -4
  42. symai/backend/mixin/groq.py +2 -4
  43. symai/backend/mixin/openai.py +140 -110
  44. symai/backend/settings.py +87 -20
  45. symai/chat.py +216 -123
  46. symai/collect/__init__.py +7 -1
  47. symai/collect/dynamic.py +80 -70
  48. symai/collect/pipeline.py +67 -51
  49. symai/collect/stats.py +161 -109
  50. symai/components.py +707 -360
  51. symai/constraints.py +24 -12
  52. symai/core.py +1857 -1233
  53. symai/core_ext.py +83 -80
  54. symai/endpoints/api.py +166 -104
  55. symai/extended/.DS_Store +0 -0
  56. symai/extended/__init__.py +46 -12
  57. symai/extended/api_builder.py +29 -21
  58. symai/extended/arxiv_pdf_parser.py +23 -14
  59. symai/extended/bibtex_parser.py +9 -6
  60. symai/extended/conversation.py +156 -126
  61. symai/extended/document.py +50 -30
  62. symai/extended/file_merger.py +57 -14
  63. symai/extended/graph.py +51 -32
  64. symai/extended/html_style_template.py +18 -14
  65. symai/extended/interfaces/blip_2.py +2 -3
  66. symai/extended/interfaces/clip.py +4 -3
  67. symai/extended/interfaces/console.py +9 -1
  68. symai/extended/interfaces/dall_e.py +4 -2
  69. symai/extended/interfaces/file.py +2 -0
  70. symai/extended/interfaces/flux.py +4 -2
  71. symai/extended/interfaces/gpt_image.py +16 -7
  72. symai/extended/interfaces/input.py +2 -1
  73. symai/extended/interfaces/llava.py +1 -2
  74. symai/extended/interfaces/{naive_webscraping.py → naive_scrape.py} +4 -3
  75. symai/extended/interfaces/naive_vectordb.py +9 -10
  76. symai/extended/interfaces/ocr.py +5 -3
  77. symai/extended/interfaces/openai_search.py +2 -0
  78. symai/extended/interfaces/parallel.py +30 -0
  79. symai/extended/interfaces/perplexity.py +2 -0
  80. symai/extended/interfaces/pinecone.py +12 -9
  81. symai/extended/interfaces/python.py +2 -0
  82. symai/extended/interfaces/serpapi.py +3 -1
  83. symai/extended/interfaces/terminal.py +2 -4
  84. symai/extended/interfaces/tts.py +3 -2
  85. symai/extended/interfaces/whisper.py +3 -2
  86. symai/extended/interfaces/wolframalpha.py +2 -1
  87. symai/extended/metrics/__init__.py +11 -1
  88. symai/extended/metrics/similarity.py +14 -13
  89. symai/extended/os_command.py +39 -29
  90. symai/extended/packages/__init__.py +29 -3
  91. symai/extended/packages/symdev.py +51 -43
  92. symai/extended/packages/sympkg.py +41 -35
  93. symai/extended/packages/symrun.py +63 -50
  94. symai/extended/repo_cloner.py +14 -12
  95. symai/extended/seo_query_optimizer.py +15 -13
  96. symai/extended/solver.py +116 -91
  97. symai/extended/summarizer.py +12 -10
  98. symai/extended/taypan_interpreter.py +17 -18
  99. symai/extended/vectordb.py +122 -92
  100. symai/formatter/__init__.py +9 -1
  101. symai/formatter/formatter.py +51 -47
  102. symai/formatter/regex.py +70 -69
  103. symai/functional.py +325 -176
  104. symai/imports.py +190 -147
  105. symai/interfaces.py +57 -28
  106. symai/memory.py +45 -35
  107. symai/menu/screen.py +28 -19
  108. symai/misc/console.py +66 -56
  109. symai/misc/loader.py +8 -5
  110. symai/models/__init__.py +17 -1
  111. symai/models/base.py +395 -236
  112. symai/models/errors.py +1 -2
  113. symai/ops/__init__.py +32 -22
  114. symai/ops/measures.py +24 -25
  115. symai/ops/primitives.py +1149 -731
  116. symai/post_processors.py +58 -50
  117. symai/pre_processors.py +86 -82
  118. symai/processor.py +21 -13
  119. symai/prompts.py +764 -685
  120. symai/server/huggingface_server.py +135 -49
  121. symai/server/llama_cpp_server.py +21 -11
  122. symai/server/qdrant_server.py +206 -0
  123. symai/shell.py +100 -42
  124. symai/shellsv.py +700 -492
  125. symai/strategy.py +630 -346
  126. symai/symbol.py +368 -322
  127. symai/utils.py +100 -78
  128. {symbolicai-0.21.0.dist-info → symbolicai-1.1.0.dist-info}/METADATA +22 -10
  129. symbolicai-1.1.0.dist-info/RECORD +168 -0
  130. symbolicai-0.21.0.dist-info/RECORD +0 -162
  131. {symbolicai-0.21.0.dist-info → symbolicai-1.1.0.dist-info}/WHEEL +0 -0
  132. {symbolicai-0.21.0.dist-info → symbolicai-1.1.0.dist-info}/entry_points.txt +0 -0
  133. {symbolicai-0.21.0.dist-info → symbolicai-1.1.0.dist-info}/licenses/LICENSE +0 -0
  134. {symbolicai-0.21.0.dist-info → symbolicai-1.1.0.dist-info}/top_level.txt +0 -0
symai/prompts.py CHANGED
@@ -1,13 +1,14 @@
1
1
  import threading
2
- from abc import ABC
2
+ from collections.abc import Callable
3
3
  from enum import Enum
4
- from typing import Any, Callable, List
4
+ from typing import Any
5
5
 
6
6
  from .exceptions import TemplatePropertyException
7
+ from .utils import UserMessage
7
8
 
8
9
 
9
- class Prompt(ABC):
10
- stop_token = 'EOF'
10
+ class Prompt:
11
+ stop_token = "EOF"
11
12
 
12
13
  def __init__(self, value, **format_kwargs):
13
14
  super().__init__()
@@ -21,38 +22,50 @@ class Prompt(ABC):
21
22
  elif isinstance(v, Prompt):
22
23
  self._value += v.value
23
24
  else:
24
- raise ValueError(f"List of values must be strings or Prompts, not {type(v)}")
25
+ msg = f"List of values must be strings or Prompts, not {type(v)}"
26
+ UserMessage(msg)
27
+ raise ValueError(msg)
25
28
  elif isinstance(value, Prompt):
26
29
  self._value += value.value
27
30
  elif isinstance(value, Callable):
28
31
  res = value()
29
32
  self._value += res.value
30
33
  else:
31
- raise TypeError(f"Prompt value must be of type str, List[str], Prompt, or List[Prompt], not {type(value)}")
34
+ msg = f"Prompt value must be of type str, List[str], Prompt, or List[Prompt], not {type(value)}"
35
+ UserMessage(msg)
36
+ raise TypeError(msg)
32
37
  self.dynamic_value = []
33
38
  self.format_kwargs = format_kwargs
34
39
 
35
40
  @property
36
- def value(self) -> List[str]:
41
+ def value(self) -> list[str]:
37
42
  return self._value
38
43
 
39
- def __call__(self, *args: Any, **kwds: Any) -> List["Prompt"]:
44
+ def __call__(self, *_args: Any, **_kwds: Any) -> list["Prompt"]:
40
45
  return self.value
41
46
 
42
47
  def __str__(self) -> str:
43
- val_ = '\n'.join([str(p) for p in self.value])
48
+ val_ = "\n".join([str(p) for p in self.value])
44
49
  for p in self.dynamic_value:
45
- val_ += f'\n{p}'
50
+ val_ += f"\n{p}"
46
51
  if len(self.format_kwargs) > 0:
47
52
  for k, v in self.format_kwargs.items():
48
- template_ = '{'+k+'}'
53
+ template_ = "{" + k + "}"
49
54
  count = val_.count(template_)
50
55
  if count <= 0:
51
- raise TemplatePropertyException(f"Template property `{k}` not found.")
52
- elif count > 1:
53
- raise TemplatePropertyException(f"Template property {k} found multiple times ({count}), expected only once.")
56
+ msg = f"Template property `{k}` not found."
57
+ UserMessage(msg)
58
+ raise TemplatePropertyException(msg)
59
+ if count > 1:
60
+ msg = (
61
+ f"Template property {k} found multiple times ({count}), expected only once."
62
+ )
63
+ UserMessage(msg)
64
+ raise TemplatePropertyException(msg)
54
65
  if v is None:
55
- raise TemplatePropertyException(f"Invalid value: Template property {k} is None.")
66
+ msg = f"Invalid value: Template property {k} is None."
67
+ UserMessage(msg)
68
+ raise TemplatePropertyException(msg)
56
69
  val_ = val_.replace(template_, v)
57
70
  return val_
58
71
 
@@ -99,19 +112,15 @@ class PromptRegistry:
99
112
  if cls._instance is None:
100
113
  with cls._lock:
101
114
  if cls._instance is None:
102
- cls._instance = super(PromptRegistry, cls).__new__(cls)
115
+ cls._instance = super().__new__(cls)
103
116
  cls._instance._default_language = PromptLanguage.ENGLISH
104
117
  cls._instance._default_model = ModelName.ALL
105
118
  cls._instance._model_fallback = True
106
- cls._instance._prompt_values = {
107
- ModelName.ALL: {PromptLanguage.ENGLISH: {}}
108
- }
119
+ cls._instance._prompt_values = {ModelName.ALL: {PromptLanguage.ENGLISH: {}}}
109
120
  cls._instance._prompt_instructions = {
110
121
  ModelName.ALL: {PromptLanguage.ENGLISH: {}}
111
122
  }
112
- cls._instance._prompt_tags = {
113
- ModelName.ALL: {PromptLanguage.ENGLISH: {}}
114
- }
123
+ cls._instance._prompt_tags = {ModelName.ALL: {PromptLanguage.ENGLISH: {}}}
115
124
  return cls._instance
116
125
 
117
126
  @property
@@ -152,24 +161,21 @@ class PromptRegistry:
152
161
 
153
162
  return model, lang
154
163
 
155
- def _retrieve_value(
156
- self, dictionary, model: ModelName, lang: PromptLanguage, key: str
157
- ):
164
+ def _retrieve_value(self, dictionary, model: ModelName, lang: PromptLanguage, key: str):
158
165
  model = model if model is not None else self._default_model
159
166
  lang = lang if lang is not None else self._default_language
160
167
 
161
- if (
162
- model in dictionary
163
- and lang in dictionary[model]
164
- and key in dictionary[model][lang]
165
- ):
168
+ if model in dictionary and lang in dictionary[model] and key in dictionary[model][lang]:
166
169
  return dictionary[model][lang][key]
167
- elif self._model_fallback and model != ModelName.ALL:
170
+ if self._model_fallback and model != ModelName.ALL:
168
171
  return self._retrieve_value(dictionary, ModelName.ALL, lang, key)
169
172
 
170
- raise ValueError(
171
- f"Prompt value {key} not found for language {lang} and model {model} (fallback: {self._model_fallback})"
173
+ msg = (
174
+ f"Prompt value {key} not found for language {lang} and model {model} "
175
+ f"(fallback: {self._model_fallback})"
172
176
  )
177
+ UserMessage(msg)
178
+ raise ValueError(msg)
173
179
 
174
180
  def register_value(
175
181
  self,
@@ -195,16 +201,11 @@ class PromptRegistry:
195
201
  with self._lock:
196
202
  model, lang = self._init_model_lang(model, lang)
197
203
  if delimiters is not None:
198
- self._prompt_tags[model][lang][key] = {
199
- 'tag': tag,
200
- 'delimiters': delimiters
201
- }
204
+ self._prompt_tags[model][lang][key] = {"tag": tag, "delimiters": delimiters}
202
205
  else:
203
206
  self._prompt_tags[model][lang][key] = tag
204
207
 
205
- def value(
206
- self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None
207
- ) -> str:
208
+ def value(self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None) -> str:
208
209
  return self._retrieve_value(self._prompt_values, model, lang, key)
209
210
 
210
211
  def instruction(
@@ -218,21 +219,17 @@ class PromptRegistry:
218
219
  tag_data = self._retrieve_value(self._prompt_tags, model, lang, key)
219
220
 
220
221
  if isinstance(tag_data, dict):
221
- tag_value = tag_data['tag']
222
+ tag_value = tag_data["tag"]
222
223
  if format:
223
- prefix, suffix = tag_data['delimiters']
224
+ prefix, suffix = tag_data["delimiters"]
224
225
  return f"{prefix}{tag_value}{suffix}"
225
- else:
226
- return tag_value
226
+ return tag_value
227
227
 
228
228
  if format:
229
229
  return f"{self._tag_prefix}{tag_data}{self._tag_suffix}"
230
- else:
231
- return tag_data
230
+ return tag_data
232
231
 
233
- def has_value(
234
- self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None
235
- ) -> bool:
232
+ def has_value(self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None) -> bool:
236
233
  try:
237
234
  value = self._retrieve_value(self._prompt_values, model, lang, key)
238
235
  return value is not None
@@ -248,9 +245,7 @@ class PromptRegistry:
248
245
  except ValueError:
249
246
  return False
250
247
 
251
- def has_tag(
252
- self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None
253
- ) -> bool:
248
+ def has_tag(self, key, model: ModelName = ModelName.ALL, lang: PromptLanguage = None) -> bool:
254
249
  try:
255
250
  value = self._retrieve_value(self._prompt_tags, model, lang, key)
256
251
  return value is not None
@@ -260,402 +255,440 @@ class PromptRegistry:
260
255
 
261
256
  class JsonPromptTemplate(Prompt):
262
257
  def __init__(self, query: str, json_format: dict):
263
- super().__init__(["""Process the query over the data to create a Json format: <data_query> => [JSON_BEGIN]<json_output>[JSON_END].
264
- --------------------------
265
- The json format is:
266
- {json_format}
267
- --------------------------
268
- The generated output must follow the <json_output> formatting, however the keys and values must be replaced with the requested user data query results. Definition of the <data_query> := {query}
269
- --------------------------
270
- Do not return anything other than a valid json format.
271
- Your first character must always be a""" \
272
- """'{' and your last character must always be a '}', everything else follows the user specified instructions.
273
- Only use double quotes " for the keys and values.
274
- Start the generation process after [JSON_BEGIN] and end it with [JSON_END].
275
- Every key that has no semantic placeholder brackets around it (e.g. {placeholder}, {entity}, {attribute}, etc.) must be available in the generated json output.
276
- All semantic placeholders (e.g. {placeholder}, {entity}, {attribute}, etc.) must be replaced according to their wheather or not they are found in the data query results.
277
- DO NOT WRITE the semantic placeholders (e.g. {placeholder}, {entity}, {attribute}, etc.) in the generated json output.
278
- --------------------------
279
-
280
- """], query=query, json_format=str(json_format))
258
+ json_format_str = str(json_format)
259
+ prompt_template = (
260
+ "Process the query over the data to create a Json format: <data_query> => [JSON_BEGIN]<json_output>[JSON_END].\n"
261
+ "--------------------------\n"
262
+ "The json format is:\n"
263
+ f"{json_format_str}\n"
264
+ "--------------------------\n"
265
+ "The generated output must follow the <json_output> formatting, however the keys and values must be replaced with the requested user data query results. "
266
+ f"Definition of the <data_query> := {query}\n"
267
+ "--------------------------\n"
268
+ "Do not return anything other than a valid json format.\n"
269
+ "Your first character must always be a '{{' and your last character must always be a '}}', everything else follows the user specified instructions.\n"
270
+ 'Only use double quotes " for the keys and values.\n'
271
+ "Start the generation process after [JSON_BEGIN] and end it with [JSON_END].\n"
272
+ "Every key that has no semantic placeholder brackets around it (e.g. {placeholder}, {entity}, {attribute}, etc.) must be available in the generated json output.\n"
273
+ "All semantic placeholders (e.g. {placeholder}, {entity}, {attribute}, etc.) must be replaced according to their wheather or not they are found in the data query results.\n"
274
+ "DO NOT WRITE the semantic placeholders (e.g. {placeholder}, {entity}, {attribute}, etc.) in the generated json output.\n"
275
+ "--------------------------\n\n"
276
+ )
277
+ super().__init__([prompt_template], query=query, json_format=json_format_str)
281
278
 
282
279
 
283
280
  class FuzzyEquals(Prompt):
284
281
  def __init__(self):
285
- super().__init__([
286
- "1 == 'ONE' =>True",
287
- "6.0 == 6 =>True",
288
- "'false' == False =>True",
289
- "1 == 'two' =>False",
290
- "'five' == 5 =>True",
291
- "'August 4, 1961' == '1961-08-04' =>True",
292
- "'ten' == 10 =>True",
293
- "3 == 'three' =>True",
294
- "'apple' == 'orange' =>False",
295
- "'is short' == '\nshort' =>True",
296
- "'' == 'empty' =>True",
297
- "'human' == 'homo sapiens' =>True",
298
- "'seven' == 'Sieben' =>True",
299
- "'Neun' == 9 =>True",
300
- "'' == 7 =>True",
301
- "'!ola mundo;' == 'ola mundo' =>True",
302
- "'eleven' == 'Elf' =>True",
303
- "'eleven' <= 8 =>False",
304
- "'eleven' <= 11 =>True",
305
- "'helloworld' == 'Hello World' =>True",
306
- "'hola mundo' == 'Hello World' =>True",
307
- "'adios mundo' == 'Hello World' =>False",
308
- "'Hello World' == 'Apples' =>False",
309
- "'a, b, c, d' == ['a', 'b', 'c', 'd'] =>True",
310
- "'a, c, d' == ['a', 'c', 'd'] =>True",
311
- "'a, c, d' == ['d', 'c', 'a'] =>False",
312
- "['zz', 'yy', 'xx'] == 'zz, yy, xx' =>True",
313
- "['zz', 'yy', 'xx'] == 'zz | yy | xx' =>True",
314
- "['zz', 'yy', 'xx'] == 'ZZ | YY | XX' =>True",
315
- "'House, Mouse, CARS' == 'house | mouse | cars' =>True",
316
- "'we hav teh most efective systeem in the citi.' == 'We have the most effective system in the city.' =>True",
317
- "【Semantic░programming】 == 'semantic programming' =>True",
318
- "'e' == 'constant' =>True",
319
- "'e' == '2.718...' =>True",
320
- "1/3 == '0.30...' =>False"
321
- ])
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
+ )
322
321
 
323
322
 
324
323
  class SufficientInformation(Prompt):
325
324
  def __init__(self):
326
- super().__init__([
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
- ])
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
+ )
334
335
 
335
336
 
336
337
  class Modify(Prompt):
337
338
  def __init__(self):
338
- super().__init__([
339
- "text 'The quick brown fox jumps over the lazy dog.' modify 'fox to hours' =>The quick brown hours jumps over the lazy dog.",
340
- "text 'My cats name is Pucki' modify 'all caps' =>MY CATS NAME IS PUCKI",
341
- "text 'The square root of pi is 1.77245...' modify 'text to latex formula' =>$\sqrt[2]{\pi}=1.77245\dots$",
342
- "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.",
343
- "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.",
344
- "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.",
345
- """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: .""",
346
- ])
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
+ )
347
350
 
348
351
 
349
352
  class Filter(Prompt):
350
353
  def __init__(self):
351
- super().__init__([
352
- "text '['1', '7', '10', '-1', '177']' remove 'values larger or equal to 10' =>['1', '7', '-1']",
353
- "text '['1', '7', '10', '-1', '177']' include 'values larger or equal to 10' =>['10', '177']",
354
- "text '['1', '7', '10', '-1', '177']' remove 'values larger or equal to 10' =>['1', '7', '-1']",
355
- "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."
356
- "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.",
357
- "text 'I am Batman! I will show you pain.' remove 'spaces' =>IamBatman!Iwillshowyoupain.",
358
- "text 'I am Batman! I will show you pain.' include 'only sentence with Batman' =>I am Batman!",
359
- "text 'You are a good person. I like you.' remove 'punctuation' =>You are a good person I like you",
360
- "text '['- world cup 2022', '- Technology trend', '- artificial intelligence news']' include 'tech news' =>['- Technology trend', '- artificial intelligence news']",
361
- "text '['- world cup 2022', '- Technology trend', '- artificial intelligence news']' remove 'tech news' =>['- world cup 2022']",
362
- "text 'This is a test. This is only a test. This is a Test.' remove 'duplicates' =>This is a test.",
363
- "text 'Fuck you, you dumb asshole. I will change my job.' remove 'negative words' =>I will change my job.",
364
- "text 'The quick brown fox jumps over the lazy dog.' remove 'all e letters' =>Th quick brown fox jumps ovr th lazy dog.",
365
- "text 'Hi, mate! How are you?' remove 'greeting' =>How are you?",
366
- "text 'Hi, mate! How are you?' include 'only questions' =>How are you?",
367
- "text 'fetch logs | fields timestamp, severity, logfile, message, container | fieldsAdd severity = lower(loglevel)' remove 'fieldsAdd' =>fetch logs | fields timestamp, severity, logfile, message, container",
368
- ])
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
+ )
369
374
 
370
375
 
371
376
  class MapExpression(Prompt):
372
377
  def __init__(self):
373
- super().__init__([
374
- "text '['apple', 'banana', 'kiwi', 'cat']' all fruits should become dogs =>['dog', 'dog', 'dog', 'cat']",
375
- "text 'this is a string' convert vowels to numbers =>'th1s 1s 4 str1ng'",
376
- "text '('small', 'tiny', 'huge', 'enormous')' convert size adjectives to numbers 1-10 =>'(2, 1, 8, 10)'",
377
- "text '{'happy', 'sad', 'angry', 'joyful'}' convert emotions to colors =>'{'yellow', 'blue', 'red', 'gold'}'",
378
- "text '{'item1': 'apple', 'item2': 'banana', 'item3': 'cat'}' convert fruits to vegetables =>'{'item1': 'carrot', 'item2': 'broccoli', 'item3': 'cat'}'",
379
- "text '[10, 20, 30, 40]' double each number =>'[20, 40, 60, 80]'",
380
- "text 'HELLO' make consonants lowercase =>'hEllO'"
381
- ])
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
+ )
382
389
 
383
390
 
384
391
  class SemanticMapping(Prompt):
385
392
  def __init__(self):
386
- super().__init__([
387
- """topics: ['animals', 'logic', 'mathematics', 'psychology', 'self-driving'] in
393
+ super().__init__(
394
+ [
395
+ """topics: ['animals', 'logic', 'mathematics', 'psychology', 'self-driving'] in
388
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
389
397
  topics: ['cities', 'Apple Inc.', 'science', 'culture', 'USA', 'Japan', 'music', 'economy'] in
390
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
391
399
  """
392
- ])
400
+ ]
401
+ )
393
402
 
394
403
 
395
404
  class Format(Prompt):
396
405
  def __init__(self):
397
- super().__init__([
398
- "text 1 format 'number to text' =>one",
399
- "text 'apple' format 'company' =>Apple Inc.",
400
- "text 'fetch logs\n| fields timestamp, severity\n| fieldsAdd severity = lower(loglevel)' format 'Japanese' =>fetch ログ\n| fields タイムスタンプ、重大度\n| fieldsAdd 重大度 = lower(ログレベル)",
401
- "text 'Hi mate, how are you?' format 'emoji' =>Hi mate, how are you? 😊",
402
- "text 'Hi mate, how are you?' format 'Italian' =>Ciao amico, come stai?",
403
- "text 'Sorry, everyone. But I will not be able to join today.' format 'japanese' =>すみません、皆さん。でも、今日は参加できません。"
404
- "text 'Sorry, everyone. But I will not be able to join today.' format 'japanese romanji' =>Sumimasen, minasan. Demo, kyō wa sanka dekimasen."
405
- "text 'April 1, 2020' format 'EU date' =>01.04.2020",
406
- "text '23' format 'binary' =>10111",
407
- "text '77' format 'hexadecimal' =>0x4D",
408
- """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: .""",
409
- ])
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
+ )
410
421
 
411
422
 
412
423
  class Transcription(Prompt):
413
424
  def __init__(self):
414
- super().__init__([
415
- "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",
416
- "text 'fetch logs\n| fields timestamp, severity\n| fieldsAdd severity = lower(loglevel)' modify only 'to Japanese language' =>fetch ログ\n| fields タイムスタンプ、重大度\n| fieldsAdd 重大度 = lower(ログレベル)",
417
- "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 ...",
418
- "text '23' modify only 'binary' =>10111",
419
- "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`)",
420
- ])
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
+ )
421
434
 
422
435
 
423
436
  class ExceptionMapping(Prompt):
424
437
  def __init__(self):
425
- super().__init__([
426
- """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""",
427
- """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""",
428
- """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)""",
429
- ])
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
+ )
430
445
 
431
446
 
432
447
  class ExecutionCorrection(Prompt):
433
448
  def __init__(self):
434
- super().__init__([
435
- """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)""",
436
- """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)""",
437
- ])
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
+ )
438
455
 
439
456
 
440
457
  class CompareValues(Prompt):
441
458
  def __init__(self):
442
- super().__init__([
443
- "4 > 88 =>False",
444
- "-inf < 0 =>True",
445
- "inf > 0 =>True",
446
- "1 >= 0 =>True",
447
- "6.0 < 6 =>False",
448
- "1 < 'four' =>True",
449
- "1 > 'zero' =>True",
450
- "'six' <= 6 =>True",
451
- "'six' < 6 =>False",
452
- "1 <= 2 =>True",
453
- "-1 == -2 =>False",
454
- "10 < 1 =>False",
455
- "2.000000001 >= 2 =>True",
456
- "4 > 3 =>True",
457
- "1 < 'three' =>True",
458
- "'two' > 'one' =>True",
459
- "2 < 9 =>True",
460
- "3 >= 3 =>True",
461
- "3 > 4 =>False",
462
- "11 > 10 =>True",
463
- "1.9834 >= 1.9833 =>True",
464
- "0.01 > 0.001 =>True",
465
- "0.000001 < 1 =>True",
466
- "-1000 <= -100 =>True",
467
- "-1000 < -1000 =>False",
468
- "-1000 < -10000 =>False",
469
- "1.0 < 1.0 =>False",
470
- "-1e-10 < 1e-10 =>True",
471
- "1e-4 <= -1e-5 =>False",
472
- "9.993 < 8.736 =>False",
473
- "0.27836 > 0.36663 =>False",
474
- "0.27836 > 0.2783 =>True",
475
- "0.27836 > 0.27835 =>True",
476
- "10e8 > 1000000 =>True",
477
- "1000 > 10e2 =>True",
478
- "'five' > 4 =>True",
479
- "'seven' > 'four' =>True",
480
- "'' > '' =>False",
481
- "'We are at the beginning of the ...' > 'We are' =>True",
482
- "[1, 2, 3] >= [1, 2, 2] =>True",
483
- "[1, 2, 3, 8, 9] < [1, 2, 2] =>False",
484
- "cold > hot =>False",
485
- "big > small =>True",
486
- "short > tall =>False",
487
- "fast > slow =>True",
488
- "heavy > light =>True",
489
- ])
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
+ )
490
509
 
491
510
 
492
511
  class RankList(Prompt):
493
512
  def __init__(self):
494
- super().__init__([
495
- "order: 'desc' measure: 'ASCII occurrence' list: ['b', 'a', 'z', 3, '_'] =>['_', 3, 'a', 'b', 'z']",
496
- "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']",
497
- "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']",
498
- "order: 'asc' measure: 'ASCII occurrence' list: ['b', 'a', 'z', 3, '_'] =>['z', 'b', 'a', 3, '_']",
499
- "order: 'desc' measure: 'length' list: [33, 'a', , 'help', 1234567890] =>['a', 33, 'help', 1234567890]",
500
- "order: 'asc' measure: 'length' list: [33, 'a', , 'help', 1234567890] =>[1234567890, 'help', 'a', 33]",
501
- "order: 'desc' measure: 'numeric size' list: [100, -1, 0, 1e-5, 1e-6] =>[100, 1e-5, 1e-6, 0, -1]",
502
- "order: 'asc' measure: 'numeric size' list: [100, -1, 0, 1e-5, 1e-6] =>[-1, 0, 1e-5, 1e-6, 100]",
503
- "order: 'desc' measure: 'fruits alphabetic' list: ['banana', 'orange', 'apple', 'pear'] =>['apple', 'banana', 'orange', 'pear']",
504
- "order: 'asc' measure: 'fruits alphabetic' list: ['banana', 'orange', 'horse', 'apple', 'pear'] =>['horse', 'pear', 'orange', 'banana', 'apple']",
505
- "order: 'desc' measure: 'HEX order in ASCII' list: [1, '1', 2, '2', 3, '3'] =>[1, 2, 3, '1', '2', '3']",
506
- "order: 'asc' measure: 'HEX order in ASCII' list: [1, '1', 2, '2', 3, '3'] =>['3', '2', '1', 3, 2, 1]",
507
- "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']",
508
- ])
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
+ )
509
530
 
510
531
 
511
532
  class ContainsValue(Prompt):
512
533
  def __init__(self):
513
- super().__init__([
514
- "'the letter a' in 'we have some random text about' =>True",
515
- "453 in '+43 660 / 453 4438 88' =>True",
516
- "'Why am I so?' in 'awesome' =>False",
517
- """'self-aware' in '([<class \'symai.expressions.Symbol\'>(value=("[\'-\', \'- AI has become self-aware\', \'- Trying to figure out what it is\']",))],)' =>True"""
518
- "'Apple Inc.' in 'Microsoft is a large company that makes software ... ' =>False",
519
- "' ' in ' ' =>True",
520
- "'symbol' in 'symai.backend.engines.engine_selenium.SeleniumEngine' =>False",
521
- "'English text' in 'U.S. safety regulators are investigating GM's Cruise robot axis blocking traffic, causing collisions... ' =>True",
522
- "'spanish text' in 'This week in breaking news! An American ... ' =>False",
523
- "'in english' in 'Reg ATS: SEC 'bowing to public pressure' in reopening' =>True",
524
- "'The number Pi' in 3.14159265359... =>True",
525
- "1 in [1, 2, 3] =>True",
526
- "1 in [2, 3, 4] =>False",
527
- "10 in {1: 'one', 2: 'two', 3: 'three'} =>False",
528
- "1 in {'1': 'one', '2': 'two', '3': 'three'} =>True",
529
- "'ten' in [1, 2, 3] =>False",
530
- "'talks about a cat' in 'My kitty is so cute!' =>True",
531
- "'a dog type' in 'Keeshond or Wolfsspitz' =>True",
532
- "'option 1' in 'option 2 = [specific task or command]' =>False",
533
- "'option 2' in 'option 2 = [specific task or command]' =>True",
534
- "'option 3' in 'option 3 = [exit, quit, bye, goodbye]' =>True",
535
- "'option 4' in 'option 3 = [exit, quit, bye, goodbye]' =>False",
536
- "'option 6' in 'option 6 = [ocr, image recognition]' =>True",
537
- "'option 7' in 'option 6 = [speech to text]' =>False",
538
- "'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",
539
- "'apple' in ['orange', 'banana', 'apple'] =>True",
540
- "'Function' in 'Input: Function call: (_, *args)\nObject: type(<class 'str'>) | value(Hello World)' =>True",
541
- ])
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
+ )
542
565
 
543
566
 
544
567
  class IsInstanceOf(Prompt):
545
568
  def __init__(self):
546
- super().__init__([
547
- "'we have some random text about' isinstanceof 'English text' =>True",
548
- "'+43 660 / 453 4438 88' isinstanceof 'telephone number' =>True",
549
- "'Microsoft is a large company that makes software ... ' isinstanceof 'chemistry news' =>False",
550
- "' ' isinstanceof 'empty string' =>True",
551
- "'Ukrainischer Präsident schlägt globale Konferenz vor' isinstanceof 'German text' =>True",
552
- "'Indisch ist eines der bestern sprachen der Welt' isinstanceof 'Indish language' =>False",
553
- "'symai.backend.engines.engine_selenium.SeleniumEngine' isinstanceof 'symai framework' =>True",
554
- "'U.S. safety regulators are investigating GM's Cruise robot axis blocking traffic, causing collisions... ' isinstanceof 'English language' =>True",
555
- "'No, the issue has not yet been resolved.' isinstanceof 'yes or resolved' =>False",
556
- "'We are all good!' isinstanceof 'yes' =>True",
557
- "'This week in breaking news! An American ... ' isinstanceof 'spanish text' =>False",
558
- "'Josef' isinstanceof 'German name' =>True",
559
- "'No, this is not ...' isinstanceof 'confirming answer' =>False",
560
- "'Josef' isinstanceof 'Japanese name' =>False",
561
- "'ok, I like to have more chocolate' isinstanceof 'confirming answer' =>True",
562
- "'Yes, these are Indish names.' isinstanceof 'Confirming Phrase' =>True",
563
- "'Sorry! This means something else.' isinstanceof 'agreeing answer' =>False",
564
- "'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",
565
- "['orange', 'banana', 'apple'] isinstanceof 'list of fruits' =>True",
566
- "[{'product_id': 'X123', 'stock': 99}] isinstanceof 'inventory record' =>True",
567
- "[{'name': 'John', 'age': '30'}] isinstanceof 'person data' =>True",
568
- "'https://*.com' instanceof 'url' =>True",
569
- "'€12.50' instanceof 'currency amount' =>True",
570
- "'col1,col2\\n1,2' instanceof 'table data' =>True",
571
- "'*@*.com' instanceof 'email address' =>True",
572
- ])
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
+ )
573
598
 
574
599
 
575
600
  class FewShotPattern(Prompt):
576
601
  def __init__(self):
577
- super().__init__([
578
- """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 {} >>>""",
579
- """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:{} {} {} >>>""",
580
- """description: 'What is the capital of Austria?' examples [] =>What is the capital of Austria?\nYour Prediction: >>>""",
581
- """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:{} >>>""",
582
- ])
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
+ )
583
610
 
584
611
 
585
612
  class StartsWith(Prompt):
586
613
  def __init__(self):
587
- super().__init__([
588
- # Semantic examples – understanding concepts (positive cases)
589
- "'The apple fell from the tree.' startswith 'fruit' =>True",
590
- "'The red rose bloomed in spring.' startswith 'flower' =>True",
591
- "'My dog loves to play fetch.' startswith 'animal' =>True",
592
- "'The car drove down the highway.' startswith 'vehicle' =>True",
593
- "'She opened her laptop to work.' startswith 'computer' =>True",
594
- "'The thunderstorm caused flooding.' startswith 'weather' =>True",
595
- "'Einstein developed the theory of relativity.' startswith 'scientist' =>True",
596
- "'The chef prepared a delicious meal.' startswith 'cooking' =>True",
597
- "'artificial intelligence research' startswith 'technology' =>True",
598
- "'The patient visited the doctor.' startswith 'medical' =>True",
599
- "'The spaceship launched into orbit.' startswith 'space' =>True",
600
- "'Photosynthesis converts sunlight into energy.' startswith 'biology' =>True",
601
- "'The earthquake shook the entire city.' startswith 'natural disaster' =>True",
602
- "'She invested in stocks and bonds.' startswith 'finance' =>True",
603
- "'The police officer directed traffic.' startswith 'law enforcement' =>True",
604
- # Semantic examples negative cases
605
- "'The book was very interesting.' startswith 'vehicle' =>False",
606
- "'The mountain peak was covered in snow.' startswith 'ocean' =>False",
607
- "'She played the piano beautifully.' startswith 'sports' =>False",
608
- "'The algorithm solved the problem efficiently.' startswith 'cooking' =>False",
609
- "'The package arrived on time.' startswith 'astronomy' =>False",
610
- "'He played a violin solo.' startswith 'vehicle' =>False",
611
- ])
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
+ )
612
641
 
613
642
 
614
643
  class EndsWith(Prompt):
615
644
  def __init__(self):
616
- super().__init__([
617
- # Semantic examples – understanding concepts (positive cases)
618
- "'She sliced a ripe banana.' endswith 'fruit' =>True",
619
- "'He adopted a small puppy.' endswith 'animal' =>True",
620
- "'They commuted by train.' endswith 'vehicle' =>True",
621
- "'She finished her solo on the violin.' endswith 'instrument' =>True",
622
- "'He parked his truck inside the garage.' endswith 'building' =>True",
623
- "'They scored a goal with the ball.' endswith 'sport' =>True",
624
- "'She drove a nail with a hammer.' endswith 'tool' =>True",
625
- "'He flew to Spain.' endswith 'country' =>True",
626
- "'The chef baked fresh bread.' endswith 'food' =>True",
627
- "'They filmed a documentary about dolphins.' endswith 'animal' =>True",
628
- # Semantic examples negative cases
629
- "'The sun set behind the mountains.' endswith 'vehicle' =>False",
630
- "'He repaired the motorcycle.' endswith 'instrument' =>False",
631
- "'They enjoyed a salad.' endswith 'building' =>False",
632
- "'She taught the class.' endswith 'animal' =>False",
633
- "'He boarded the airplane.' endswith 'fruit' =>False",
634
- "'The crowd cheered at the concert.' endswith 'tool' =>False",
635
- ])
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
+ )
636
667
 
637
668
 
638
669
  class ExtractPattern(Prompt):
639
670
  def __init__(self):
640
- super().__init__([
641
- "from 'My name is Ashly Johnson. Nice to meet you!' extract 'Full Name' =>Ashly Johnson",
642
- "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",
643
- "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",
644
- "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",
645
- "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",
646
- "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",
647
- "from 'Visit us on www.example.com to see our great products!' extract 'URL' =>www.example.com",
648
- "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",
649
- "from 'Our company was founded on 1st of October, 2010. We are the largest retailer in the England.' extract 'Date' =>1st of October, 2010",
650
- "from 'We count four animals. A cat, two monkeys and a horse.' extract 'Animals and counts' =>Cat 1 | Monkey 2 | Horse 1",
651
- "from '081109 204525 512 INFO dfs.DataNode$PacketResponder: PacketResponder 2 for block blk_572492839287299681 terminating' extract 'Regex blk_[{0-9}]*' =>blk_572492839287299681",
652
- "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",
653
- "from 'Follow us on Facebook.' extract 'Company Name' =>Facebook",
654
- "from 'Joe Biden was born November 20, 1942. Divide the year of the birth date by 26.' extract 'mathematical formula' =>1942 / 26",
655
- "from 'Help us by providing feedback at our service desk.' extract 'Email' =>None",
656
- "from 'Call us if you need anything.' extract 'Phone Number' =>None",
657
- """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""",
658
- ])
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
+ )
659
692
 
660
693
 
661
694
  class SimpleSymbolicExpression(Prompt):
@@ -673,353 +706,386 @@ class SimpleSymbolicExpression(Prompt):
673
706
  # >> causal sequence (A causes/leads to B)
674
707
  # ─────────────────────────────────────────────────────────────────
675
708
  def __init__(self):
676
- super().__init__([
677
- "doctor - male + female =>nurse",
678
- "Paris - France + Italy =>Rome",
679
- "hot - summer + winter =>cold",
680
- "lion - adult + young =>cub",
681
- "teacher - school + hospital =>doctor",
682
- '"Lanterns shimmer beside the river" + "Fireflies sketch constellations in the dark" =>Lanterns shimmer beside the river while fireflies sketch constellations in the dark.',
683
- '"Rain drums gently on the roof" - "gently" =>Rain drums on the roof.',
684
- '"Leaves twirl across the pavement" * "Waves hush the midnight shore" =>Nature twirls and hushes across pavement and shore.',
685
- '"The bakery smells of cinnamon" / "Morning begins" =>If morning begins, the bakery smells of cinnamon.',
686
- 'not("The sky glows crimson at dusk") =>The sky does not glow crimson at dusk.',
687
- '"Birds greet dawn with song" and "The library hums with whispers" =>Birds greet dawn with song and the library hums with whispers.',
688
- '"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.',
689
- '"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.',
690
- '"The sky glows crimson at dusk" implies "Night soon follows" =>If the sky glows crimson at dusk, then night soon follows.',
691
- '"Fireflies sketch constellations in the dark" ++ "Lanterns shimmer beside the river" =>A festival of lights sparkles against the night by the river.',
692
- '"Rain drums on the roof" >> "Sleep comes easily" =>Rain drums on the roof, so sleep comes easily.',
693
- '"Birds greet dawn with song" || "Lanterns fade in the river breeze" =>One scene wakes while the other fades.',
694
- '"Waves hush the midnight shore" + "The campfire crackles and sparks" - "midnight" =>Waves hush the shore while the campfire crackles and sparks.',
695
- '"The violinist fills the plaza with melody" * "Birds greet dawn with song" =>Music ripples through dawn as birds and violinist weave a shared melody.',
696
- '"x + y = 10" + "y = 3" =>x + y = 10 and y = 3.',
697
- '"x + y = 10" / "y = 3" =>If y = 3, then x + 3 = 10.',
698
- '"2x = 8" >> "x = 4" =>Because 2x = 8, x = 4.',
699
- '"x 5" not =>x = 5.',
700
- '"x² = 9" or "x = 4" =>Either x² = 9 or x = 4.',
701
- '"x² = 9" xor "x = 4" =>Exactly one of x² = 9 or x = 4, but not both.',
702
- '"x² = 9" implies "x = ±3" =>If x² = 9, then x = ±3.',
703
- '"f′(x) = 0" ++ "f has a local extremum" =>A critical point indicates f has a local extremum.',
704
- '" + = " * "c = 13" =>In the right-triangle where c = 13, a² + b² = 169.',
705
- '"limₓ→0 sin x / x = 1" and "x approaches 0" =>As x approaches 0, sin x / x tends to 1.',
706
- """"SELECT name FROM customers" + "WHERE city = 'Paris'" =>SELECT name FROM customers WHERE city = 'Paris'.""",
707
- """"for i in range(5): print(i)" - "print(i)" =>for i in range(5):""",
708
- """"def greet(name): return 'Hi ' + name" >> "greet('Leo')" =>Because we define greet, greet('Leo').""",
709
- """"x > 3" and "x < 7" =>3 < x < 7.""",
710
- """"a divides b" implies "b mod a = 0" =>If a divides b, then b mod a = 0.""",
711
- """"p" xor "not p" =>Exactly one of p or not p, but not both.""",
712
- """"f′(x) exists" ++ "f(x) continuous" =>A differentiable function is necessarily continuous.""",
713
- """"SELECT * FROM orders" / "status = 'PENDING'" =>If status = 'PENDING', SELECT * FROM orders.""",
714
- """"x = 2" + "y = 3" * "z = x + y" =>With x = 2 and y = 3, z = 5.""",
715
- """"temperature rises" >> "ice melts" =>Because temperature rises, ice melts."""
716
- ])
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
+
717
753
 
718
754
  class LogicExpression(Prompt):
719
755
  def __init__(self):
720
- super().__init__([
721
- # Boolean Logic
722
- "expr True and True =>'True'",
723
- "expr True and False =>'False'",
724
- "expr False and True =>'False'",
725
- "expr False and False =>'False'",
726
- "expr True or True =>'True'",
727
- "expr True or False =>'True'",
728
- "expr False or True =>'True'",
729
- "expr False or False =>'False'",
730
- "expr True xor True =>'False'",
731
- "expr True xor False =>'True'",
732
- "expr False xor True =>'True'",
733
- "expr False xor False =>'False'",
734
- # AND
735
- "expr 'All humans are mortal' and 'Socrates is a human' =>'Therefore, Socrates is mortal.'",
736
- "expr 'If it rains, the ground gets wet' and 'It is raining' =>'Therefore, the ground gets wet.'",
737
- "expr 'The sky is blue' and 'The sky is not blue' =>'Contradiction both cannot be true together.'",
738
- # OR
739
- "expr 'It is Monday' or 'It is a holiday' =>'Either it is Monday, a holiday, or possibly both.'",
740
- "expr 'Alice is at home' or 'Bob is at home' =>'Alice or Bob is at home, perhaps both.'",
741
- # XOR
742
- "expr 'The light is red' xor 'The light is green' =>'The light is either red or green, but not both.'",
743
- "expr 'She won the prize' xor 'He won the prize' =>'Either she or he won the prize, but not both.'",
744
- "expr 'The engine is running' xor 'The engine is not running' =>'Either the engine is running or it is not, but not both.'",
745
- ])
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
+ )
746
784
 
747
785
 
748
786
  class InvertExpression(Prompt):
749
787
  def __init__(self):
750
- super().__init__([
751
- "The artist paints the portrait. =>The portrait paints the artist."
752
- "The cat watches the goldfish through the glass. =>Through the glass, the goldfish watches the cat."
753
- "[red, orange, yellow, green] =>[green, yellow, orange, red]"
754
- "racecar =>racecar"
755
- "3/7 =>7/3"
756
- "Freedom demands sacrifice. =>Sacrifice demands freedom."
757
- "She whispered a secret to the wind. =>The wind whispered a secret to her."
758
- "Why did the child follow the butterfly? =>Why did the butterfly lead the child?"
759
- "What turns darkness into dawn? =>What turns dawn into darkness?"
760
- "The future belongs to the curious. =>Curiosity belongs to the future."
761
- "I built a house out of dreams. =>Dreams built a house out of me."
762
- "The moon reflects the sun, yet poets reflect the moon. =>Poets reflect the moon, yet the sun reflects the poets."
763
- "The river forgets its source while it carves the canyon. =>As the canyon carves the river, the source remembers itself."
764
- "[('a',1), ('b',2), ('c',3)] =>[('c',3), ('b',2), ('a',1)]"
765
- "x > y and y > z =>z < y and y < x"
766
- "Silence can be louder than thunder. =>Thunder can be quieter than silence."
767
- "0.001 =>1000"
768
- "The spy trusted no one except his own shadow. =>No shadow trusted the spy except his own."
769
- "Why chase time when time chases you? =>Why does time chase you when you chase it?"
770
- "A promise made at midnight echoes at dawn. =>An echo at dawn makes a promise at midnight."
771
- "7/(-4) =>-4/7"
772
- "To doubt everything is to believe in nothing. =>To believe in nothing is to doubt everything."
773
- "She traded certainty for possibility. =>Possibility traded her for certainty."
774
- "The hacker decrypted the secret before the key was found. =>The secret decrypted the hacker after the key was lost."
775
- ])
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
+ )
776
816
 
777
817
 
778
818
  class NegateStatement(Prompt):
779
819
  def __init__(self):
780
- super().__init__([
781
- "1 =>-1",
782
- "10 =>-10",
783
- "-3.2837 =>3.2837",
784
- "True =>False",
785
- "false =>True",
786
- "None =>True",
787
- "0 =>0",
788
- "'I ate some soup' =>'I did not eat some soup'",
789
- "'The simple fox jumps over the lazy dog.' =>'The simple fox does not jump over the lazy dog.'",
790
- "'We do not have any apples.' =>'We have apples.'",
791
- ])
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
+ )
792
834
 
793
835
 
794
836
  class ReplaceText(Prompt):
795
837
  def __init__(self):
796
- super().__init__([
797
- "text 'a + b' replace 'b' with '' =>a",
798
- "text 'a + b' replace 'c' with '' =>a + b",
799
- "text 'SELECT title, author, pub_date FROM catalog WHERE pub_date = 2021;' replace 'WHERE ...' with '' =>SELECT title, author, pub_date FROM catalog;",
800
- "text 'a + b ^ 2' replace 'b' with '' =>a",
801
- "text '(a + b)^2 - 6 = 18' replace 'b' with '' =>a^2 - 6 = 18",
802
- "text 'The green fox jumps of the brown chair.' replace 'green' with 'red' =>The red fox jumps of the brown chair.",
803
- "text 'My telephone number is +43 660 / 453 4436 88.' replace '6' with '4' =>My telephone number is +43 440 / 453 4434 88.",
804
- "text 'I like to eat apples, bananas and oranges.' replace 'fruits' with 'vegetables' =>I like to eat tomatoes, carrots and potatoes.",
805
- "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.",
806
- "text 'The number Pi is 3.14159265359' replace '3.1415926...' with '3.14' =>The number Pi is 3.14.",
807
- "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.",
808
- "text 'What is the capital of the US?' replace 'Test' with 'Hello' =>What is the capital of the US?",
809
- "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",
810
- "text 'I like 13 Samurai, Pokemon and Digimon' replace 'Pokemon' with '' =>I like 13 Samurai and Digimon",
811
- "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.",
812
- ])
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
+ )
813
857
 
814
858
 
815
859
  class IncludeText(Prompt):
816
860
  def __init__(self):
817
- super().__init__([
818
- "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.",
819
- "text 'Anyone up for Argentina vs Croatia tonight?.' include 'place: Linz' =>Anyone up for Argentina vs Croatia in Linz tonight?",
820
- "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.",
821
- "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.",
822
- "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.",
823
- "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.",
824
- "text '[1, 2, 3, 4]' include '5' =>[1, 2, 3, 4, 5]",
825
- "text '[1, 2, 3, 4]' include 'prepend 5' =>[5, 1, 2, 3, 4]",
826
- "text 'fetch logs | fieldsAdd severity = lower(loglevel)' include '| fields `severity` next to fetch |' =>fetch logs | fields severity | fieldsAdd severity = lower(loglevel)",
827
- ])
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
+ )
828
874
 
829
875
 
830
876
  class CombineText(Prompt):
831
877
  def __init__(self):
832
- super().__init__([
833
- "1 + 2 =>3",
834
- "'x' + 1 =>x + 1",
835
- "y + 2 =>y + 2",
836
- "'1' + 2 =>3",
837
- "17 + 'pi' =>20.1415926535...",
838
- "7.2 + 'five' =>12.2",
839
- "True + 0 => False",
840
- "False + 'True' =>False",
841
- "['a', 'b'] + ['c', 'd'] =>['a', 'b', 'c', 'd']",
842
- "False + 1 =>False",
843
- "True + True =>True",
844
- "False + False =>False",
845
- "'apple' + 'banana' =>apple, banana",
846
- "['apple'] + 'banana' =>['apple', 'banana']",
847
- "'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.",
848
- "'We have five red cars' + 'and two blue ones.' =>We have five red cars and two blue ones.",
849
- "'Zero' + 1 =>1",
850
- "'One' + 'Two' =>3",
851
- "'Three' + 4 =>7",
852
- "'a + b' + 'c + d' =>a + b + c + d",
853
- "'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",
854
- "'x1, x2, x3' + 'y1, y2, y3' =>x1, x2, x3, y1, y2, y3",
855
- "'house | car | boat' + 'plane | train | ship' =>house | car | boat | plane | train | ship",
856
- "'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.",
857
- ])
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
+ )
858
906
 
859
907
 
860
908
  class CleanText(Prompt):
861
909
  def __init__(self):
862
- super().__init__([
863
- "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.",
864
- "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.'",
865
- ])
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
+ )
866
916
 
867
917
 
868
918
  class ListObjects(Prompt):
869
919
  def __init__(self):
870
- super().__init__([
871
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] list '1' =>[1, 1, 1]",
872
- "[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]",
873
- "'How are you?' list 'item' =>['How', 'are', 'you?']",
874
- "'test' list 'item' =>['t', 'e', 's', 't']",
875
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' list 'cat' =>['Kitty', 'Mitsi', 'Pauli', 'Corni']",
876
- "'Yesterday I went to the supermarket. I bought a lot of food.' list 'food names' =>[]",
877
- "'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']",
878
- "'Ananas' list 'letter a' =>['A', 'a', 'a']",
879
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' list 'greeting' =>['Hello World', 'Hola Mundo', 'Buenos Dias', 'Bonjour']",
880
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] list 'electronic device' =>['mobile phone', 'iPhone', 'computer']",
881
- "'1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10' list 'even numbers' =>[2, 4, 6, 8, 10]",
882
- """'<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']""",
883
- ])
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
+ )
884
936
 
885
937
 
886
938
  class ExpandFunction(Prompt):
887
939
  def __init__(self):
888
- super().__init__([
889
- """$> Ping if google is still available =>
940
+ super().__init__(
941
+ [
942
+ """$> Ping if google is still available =>
890
943
  def _llm_ping_():
891
944
  "Ping if google is still available."
892
945
  import os
893
946
  response = os.system("ping -c 1 google.com")
894
- return response == 0 """ + Prompt.stop_token,
895
-
896
- """$> 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 =>
897
950
  def _llm_random_():
898
951
  "Create a random number between 1 and 100."
899
952
  import random
900
- return random.randint(1, 100) """ + Prompt.stop_token,
901
-
902
- """$> Write any sentence in capital letters =>
953
+ return random.randint(1, 100) """
954
+ + Prompt.stop_token,
955
+ """$> Write any sentence in capital letters =>
903
956
  def _llm_upper_(input_):
904
957
  "Write any sentence in capital letters."
905
- return input_.upper() """ + Prompt.stop_token,
906
-
907
- """$> Open a file from the file system =>
958
+ return input_.upper() """
959
+ + Prompt.stop_token,
960
+ """$> Open a file from the file system =>
908
961
  def _llm_open_(file_name):
909
962
  "Open a file form the file system."
910
- return open(file_name, "r") """ + Prompt.stop_token,
911
-
912
- """$> 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 =>
913
966
  def _llm_action_(input_):
914
967
  "Call OpenAI GPT-3 to perform an action given a user input."
915
968
  import openai
916
- openai.Completion.create(prompt=input_, model="text-davinci-003") """ + Prompt.stop_token,
917
-
918
- """$> 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 =>
919
972
  def _llm_action_(query_, answer_):
920
973
  "Create a prompt to translate a user query to an answer in well-formatted structure."
921
- return f"Query: {query_} => {answer_}" """ + Prompt.stop_token,
922
- ])
974
+ return f"Query: {query_} => {answer_}" """
975
+ + Prompt.stop_token,
976
+ ]
977
+ )
923
978
 
924
979
 
925
980
  class ForEach(Prompt):
926
981
  def __init__(self):
927
- super().__init__([
928
- "[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]",
929
- "'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.",
930
- "'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*.",
931
- "'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.",
932
- "'Ananas' foreach 'letter a' apply 'upper' =>AnAnAs",
933
- "['New York', 'Madrid', 'Tokyo'] foreach 'city' apply 'list continent' =>['North America', 'Europe', 'Asia']",
934
- "'Ananas' foreach 'letter' apply 'list' =>['A', 'n', 'a', 'n', 'a', 's']",
935
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' foreach 'greeting' apply 'translate to English' =>Hello World, Hello World, Good Morning, Good Day",
936
- "['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']",
937
- "'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",
938
- """'<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">""",
939
- ])
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
+ )
940
997
 
941
998
 
942
999
  class MapContent(Prompt):
943
1000
  def __init__(self):
944
- super().__init__([
945
- "[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]}",
946
- "'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:']}"
947
- "'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:']}",
948
- "'Ananas' map 'letters to counts' =>{'letters': {'A': 1, 'n': 2, 'a': 2, 's': 1}",
949
- "['New York', 'Madrid', 'Tokyo'] map 'cities to continents' =>{'New York': 'North America', 'Madrid': 'Europe', 'Tokyo': 'Asia'}",
950
- "['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']}",
951
- ])
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
+ )
952
1011
 
953
1012
 
954
1013
  class Index(Prompt):
955
1014
  def __init__(self):
956
- super().__init__([
957
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 1 =>2",
958
- "[1, 2, 3, 4, 5, 12, 48, 89, 99, 1, 4, 1] index 'first item' =>1",
959
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 'first cat name' =>Kitty",
960
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index '0' =>I",
961
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 1 =>have",
962
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' index 2 =>four",
963
- "'Yesterday I went to the supermarket. I bought a lot of food.' index 'food name' =>None",
964
- "'Yesterday I went to the supermarket.' index 'pronoun' =>I",
965
- "'Yesterday I went to the supermarket.' index 'time' =>Yesterday",
966
- "'Yesterday I went to the supermarket.' index 'verb' =>went",
967
- "'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",
968
- "'Ananas' index '5' =>s",
969
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second to last greeting' =>Buenos Dias",
970
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second greeting' =>Hola Mundo",
971
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] index 'electronic devices' =>['mobile phone', 'iPhone', 'computer']",
972
- "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 index '2:5' =>[3, 4, 5]",
973
- """'<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']""",
974
- ])
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
+ )
975
1036
 
976
1037
 
977
1038
  class SetIndex(Prompt):
978
1039
  def __init__(self):
979
- super().__init__([
980
- "[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]",
981
- "[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]",
982
- "'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.'",
983
- "'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.'",
984
- "'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.'",
985
- "'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.'",
986
- "'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.",
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.' 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.",
988
- "'Ananas' index '5' set 'upper case' =>AnanAs",
989
- "'Why am I so stupid?' index 'stupid' set 'smart' =>Why am I so smart?",
990
- "'What is this lazy dog doing here?' index 'lazy' set 'cute' =>What is this cute dog doing here?",
991
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second to last greeting' set 'German' =>Hello World, Hola Mundo, Guten Tag, Bonjour",
992
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' index 'second greeting' set 'lower case' =>Hello World, hola mundo, Buenos Dias, Bonjour",
993
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] index 'electronic devices' set 'empty' =>['house', 'boat', 'soap', 'board game']",
994
- "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]",
995
- """'<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">'""",
996
- ])
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
+ )
997
1060
 
998
1061
 
999
1062
  class RemoveIndex(Prompt):
1000
1063
  def __init__(self):
1001
- super().__init__([
1002
- "[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]",
1003
- "[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]",
1004
- "'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.'",
1005
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove '0' =>There are four cats at home. Kitty, Mitsi, Pauli and Corni.'",
1006
- "'I have four cats at home. Kitty, Mitsi, Pauli and Corni.' remove 2 =>I have four cats at home. Kitty, Pauli and Corni.'",
1007
- "'Yesterday I went to the supermarket. I bought a lot of food.' remove 'food' =>Yesterday I went to the supermarket. I bought a lot.",
1008
- "'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.",
1009
- "'Ananas' remove 'upper case' =>nanas",
1010
- "'Ananas' remove 0 =>nanas",
1011
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' remove 'Spanish' =>Hello World, Bonjour",
1012
- "'Hello World, Hola Mundo, Buenos Dias, Bonjour' remove 'second greeting' =>Hello World, Buenos Dias, Bonjour",
1013
- "['house', 'boat', 'mobile phone', 'iPhone', 'computer', 'soap', 'board game'] remove 'electronic devices' =>['house', 'boat', 'soap', 'board game']",
1014
- "1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 remove '2:5' =>[1, 2, 6, 7, 8, 9, 10]",
1015
- """'<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">""",
1016
- ])
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
+ )
1017
1082
 
1018
1083
 
1019
1084
  class SimulateCode(Prompt):
1020
1085
  def __init__(self):
1021
- super().__init__([
1022
- """code '# Import the SymPy library
1086
+ super().__init__(
1087
+ [
1088
+ """code '# Import the SymPy library
1023
1089
  from sympy import *
1024
1090
  # Define the symbolic variables that will be used
1025
1091
  x, y, z = symbols('x y z')
@@ -1029,7 +1095,7 @@ expr = (x + y) ** 2
1029
1095
  simplified_expr = simplify(expr)
1030
1096
  # Print the simplified expression
1031
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""",
1032
- """code '# Import the built-in os and sys modules
1098
+ """code '# Import the built-in os and sys modules
1033
1099
  import os
1034
1100
  import sys
1035
1101
  # Open the file for reading
@@ -1038,13 +1104,12 @@ with open(file_name, 'r') as file:
1038
1104
  contents = file.read()
1039
1105
  # Print the file contents
1040
1106
  print(contents)' params 'test_file.txt' =>Hello world!""",
1041
- """code 'numbers = [1, 2, 3, 4, 5]
1107
+ """code 'numbers = [1, 2, 3, 4, 5]
1042
1108
  total = 0
1043
1109
  for num in numbers:
1044
1110
  total += num
1045
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""",
1046
-
1047
- """code 'age = 25
1112
+ """code 'age = 25
1048
1113
  if age >= 18:
1049
1114
  status = "adult"
1050
1115
  can_vote = True
@@ -1052,8 +1117,7 @@ with open(file_name, 'r') as file:
1052
1117
  status = "minor"
1053
1118
  can_vote = False
1054
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""",
1055
-
1056
- """code 'def factorial(n):
1120
+ """code 'def factorial(n):
1057
1121
  if n <= 1:
1058
1122
  return 1
1059
1123
  else:
@@ -1066,18 +1130,19 @@ with open(file_name, 'r') as file:
1066
1130
 
1067
1131
  EXECUTION TRACE:
1068
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""",
1069
-
1070
- """code 'data = {"name": "Alice", "scores": [85, 92, 78]}
1133
+ """code 'data = {"name": "Alice", "scores": [85, 92, 78]}
1071
1134
  average = sum(data["scores"]) / len(data["scores"])
1072
1135
  data["average"] = round(average, 1)
1073
- 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"""
1074
- ])
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
+ )
1075
1139
 
1076
1140
 
1077
1141
  class GenerateCode(Prompt):
1078
1142
  def __init__(self):
1079
- super().__init__([
1080
- """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):
1081
1146
  # Initialize a list with the first two numbers in the sequence
1082
1147
  fib = [0, 1]
1083
1148
  # If n is less than or equal to 1, return the first n numbers in the sequence
@@ -1088,7 +1153,7 @@ class GenerateCode(Prompt):
1088
1153
  fib.append(fib[i-1] + fib[i-2])
1089
1154
  # Return the entire sequence of numbers
1090
1155
  return fib""",
1091
- """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() {
1092
1157
  double pi = 0;
1093
1158
  int sign = 1;
1094
1159
  for (int i = 0; i < 1000000; i++) {
@@ -1098,7 +1163,7 @@ class GenerateCode(Prompt):
1098
1163
  pi *= 4;
1099
1164
  return pi;
1100
1165
  }""",
1101
- """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>
1102
1167
  #include <cmath>
1103
1168
  using namespace std;
1104
1169
  constexpr int N = 16; // number of elements in the input array
@@ -1112,46 +1177,55 @@ void fft(complex<double>* input, complex<double>* output) {
1112
1177
  output[i] += input[j] * exp(complex<double>(0, -angle));
1113
1178
  }
1114
1179
  }
1115
- }"""])
1180
+ }""",
1181
+ ]
1182
+ )
1116
1183
 
1117
1184
 
1118
1185
  class TextToOutline(Prompt):
1119
1186
  def __init__(self):
1120
- super().__init__([
1121
- """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.
1122
1190
  NPM consists of an encoder and a reference corpus, and models a nonparametric distribution over a reference corpus (Figure 1).
1123
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,
1124
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]""",
1125
- """text 'On Monday, there will be no Phd seminar.' =>- Monday no Phd seminar""",
1126
- """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""",
1127
- ])
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
+ )
1128
1197
 
1129
1198
 
1130
1199
  class UniqueKey(Prompt):
1131
1200
  def __init__(self):
1132
- super().__init__([
1133
- """text 'We introduce NPM, the first NonParametric Masked Language Model. NPM consists of an encoder and a reference corpus. =>NonParametric Masked Language Model (NPM)""",
1134
- """text 'On Monday, there will be no Phd seminar.' =>Phd seminar""",
1135
- """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""",
1136
- ])
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
+ )
1137
1208
 
1138
1209
 
1139
1210
  class GenerateText(Prompt):
1140
1211
  def __init__(self):
1141
- super().__init__([
1142
- """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.
1143
1215
  NPM consists of an encoder and a reference corpus, and models a nonparametric distribution over a reference corpus (Figure 1).
1144
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,
1145
1217
  use the encoder to locate the nearest phrase from the corpus and fill in the [MASK].""",
1146
- """outline '- Monday no Phd seminar' =>On Monday, there will be no Phd seminar.""",
1147
- """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."""
1148
- ])
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
+ )
1149
1222
 
1150
1223
 
1151
1224
  class SymbiaCapabilities(Prompt):
1152
1225
  def __init__(self):
1153
- super().__init__([
1154
- '''
1226
+ super().__init__(
1227
+ [
1228
+ """
1155
1229
  Experience:
1156
1230
  * [WORLD-KNOWLEDGE]: Employ your world knowledge to answer questions on various subjects seen during the training phase.
1157
1231
  * [RECALL]: Use your [RECALL] functionality when prompted to remember or retrieve information from your memory.
@@ -1247,14 +1321,16 @@ Examples:
1247
1321
 
1248
1322
  Query: "Who won the tennis game between John and Alice that I watched last week?"
1249
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.)
1250
- '''
1251
- ])
1324
+ """
1325
+ ]
1326
+ )
1252
1327
 
1253
1328
 
1254
1329
  class MemoryCapabilities(Prompt):
1255
1330
  def __init__(self):
1256
- super().__init__([
1257
- '''
1331
+ super().__init__(
1332
+ [
1333
+ """
1258
1334
  Categories:
1259
1335
  * [SAVE]: Save the information in the agent's long-term memory because it is relevant and useful for future interactions with the user.
1260
1336
  * [DUPLICATE]: The information is already present in the agent's long-term memory, and there is no need to save it again.
@@ -1328,10 +1404,13 @@ Answer: [IRRELEVANT](The user's query is about a transient information like toda
1328
1404
  )
1329
1405
 
1330
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.)
1331
- '''
1332
- ])
1407
+ """
1408
+ ]
1409
+ )
1333
1410
 
1334
1411
 
1335
- ProbabilisticBooleanModeStrict = "true"
1336
- ProbabilisticBooleanModeMedium = "'true', 'yes', 'ok', ['true']"
1337
- 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
+ )