palimpzest 0.7.10__py3-none-any.whl → 0.7.11__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.
@@ -215,14 +215,15 @@ class BaseGenerator(Generic[ContextType, InputType], ABC):
215
215
 
216
216
  # TODO: wrap non-list outputs in a list if expected output is a list
217
217
 
218
- # common error: if the output is a singleton list which contains a list, but the expected field type
218
+ # common error for one-to-one: if the output is a singleton list which contains a list, but the expected field type
219
219
  # is a list of strings, or a list of floats, i.e. not a list of lists; then extract the inner list
220
- for field, field_type in fields.items():
221
- answer = field_answers[field]
222
- field_type_is_not_list_of_lists = isinstance(field_type, ListField) and not issubclass(field_type.element_type, ListField)
223
- answer_is_list_of_lists = isinstance(answer, list) and len(answer) == 1 and isinstance(answer[0], list)
224
- if field_type_is_not_list_of_lists and answer_is_list_of_lists:
225
- field_answers[field] = answer[0]
220
+ if self.cardinality == Cardinality.ONE_TO_ONE:
221
+ for field, field_type in fields.items():
222
+ answer = field_answers[field]
223
+ field_type_is_not_list_of_lists = isinstance(field_type, ListField) and not issubclass(field_type.element_type, ListField)
224
+ answer_is_list_of_lists = isinstance(answer, list) and len(answer) == 1 and isinstance(answer[0], list)
225
+ if field_type_is_not_list_of_lists and answer_is_list_of_lists:
226
+ field_answers[field] = answer[0]
226
227
 
227
228
  # prepare the field answers to match the expected output and return
228
229
  return self._prepare_field_answers(field_answers, fields)
@@ -416,6 +417,8 @@ class BaseGenerator(Generic[ContextType, InputType], ABC):
416
417
  prompt += message["content"] + "\n" if message["type"] == "text" else "<image>\n"
417
418
  logger.debug(f"PROMPT:\n{prompt}")
418
419
  logger.debug(Fore.GREEN + f"{completion_text}\n" + Style.RESET_ALL)
420
+ print(f"PROMPT:\n{prompt}")
421
+ print(Fore.GREEN + f"{completion_text}\n" + Style.RESET_ALL)
419
422
 
420
423
  # parse reasoning
421
424
  reasoning = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: palimpzest
3
- Version: 0.7.10
3
+ Version: 0.7.11
4
4
  Summary: Palimpzest is a system which enables anyone to process AI-powered analytical queries simply by defining them in a declarative language
5
5
  Author-email: MIT DSG Semantic Management Lab <michjc@csail.mit.edu>
6
6
  Project-URL: homepage, https://palimpzest.org
@@ -36,7 +36,7 @@ palimpzest/query/execution/random_sampling_execution_strategy.py,sha256=jWPd-sBs
36
36
  palimpzest/query/execution/single_threaded_execution_strategy.py,sha256=-31gg7ha0D97g2zipzF72f7nrJFcDuiRKmo10_q5ykE,12389
37
37
  palimpzest/query/generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  palimpzest/query/generators/api_client_factory.py,sha256=lH9p5wRehECc7m1dWOGAGivD2F5x6hGh5kQCMw2-tfs,1065
39
- palimpzest/query/generators/generators.py,sha256=HOquErARyNTFya0GiudWyV2UCJEz5g1q2FufXPT7nHE,26032
39
+ palimpzest/query/generators/generators.py,sha256=dI7KuYGeiZBAkZKhbI9hmrMPC1n2j9nZQT2__5yPUdU,26235
40
40
  palimpzest/query/operators/__init__.py,sha256=fq0YvXuqxLtQyI_LuyOe02KYqYCmD-Sh1M-FcVWnr_A,3163
41
41
  palimpzest/query/operators/aggregate.py,sha256=G7jH2k0673t0TtzchCB0a9LLhSWwZb8X20FtuNw8xTQ,10288
42
42
  palimpzest/query/operators/code_synthesis_convert.py,sha256=Oki3ZJi6lRD3NFKylulmreFniRVYjrbuKWFe_M90HXM,20992
@@ -88,8 +88,8 @@ palimpzest/utils/model_helpers.py,sha256=GEtWn0SIoTjEf94ZQZyP99zJ2sOEIYJYxhOCjaT
88
88
  palimpzest/utils/progress.py,sha256=RiV753fKV8dFCNan4_wvdN2S3gvTvyRPq4Ksz6nSV1U,18536
89
89
  palimpzest/utils/sandbox.py,sha256=Ge96gmzqeOGlNkMCG9A95_PB8wRQbvTFua136of8FcA,6465
90
90
  palimpzest/utils/udfs.py,sha256=LjHic54B1az-rKgNLur0wOpaz2ko_UodjLEJrazkxvY,1854
91
- palimpzest-0.7.10.dist-info/licenses/LICENSE,sha256=5GUlHy9lr-Py9kvV38FF1m3yy3NqM18fefuE9wkWumo,1079
92
- palimpzest-0.7.10.dist-info/METADATA,sha256=KAELri3j9aRu3CyYypsuJgi-C3DuDjYd10aa4S6lJO8,7231
93
- palimpzest-0.7.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
94
- palimpzest-0.7.10.dist-info/top_level.txt,sha256=raV06dJUgohefUn3ZyJS2uqp_Y76EOLA9Y2e_fxt8Ew,11
95
- palimpzest-0.7.10.dist-info/RECORD,,
91
+ palimpzest-0.7.11.dist-info/licenses/LICENSE,sha256=5GUlHy9lr-Py9kvV38FF1m3yy3NqM18fefuE9wkWumo,1079
92
+ palimpzest-0.7.11.dist-info/METADATA,sha256=dk4jW6VG9zMHNnzJBSUyRqzV1YPowR2lm-KG5wy7OdM,7231
93
+ palimpzest-0.7.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
94
+ palimpzest-0.7.11.dist-info/top_level.txt,sha256=raV06dJUgohefUn3ZyJS2uqp_Y76EOLA9Y2e_fxt8Ew,11
95
+ palimpzest-0.7.11.dist-info/RECORD,,