palimpzest 0.7.9__tar.gz → 0.7.11__tar.gz

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 (100) hide show
  1. {palimpzest-0.7.9/src/palimpzest.egg-info → palimpzest-0.7.11}/PKG-INFO +1 -1
  2. {palimpzest-0.7.9 → palimpzest-0.7.11}/pyproject.toml +1 -1
  3. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/generators/generators.py +10 -7
  4. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/rules.py +8 -5
  5. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/model_helpers.py +9 -1
  6. {palimpzest-0.7.9 → palimpzest-0.7.11/src/palimpzest.egg-info}/PKG-INFO +1 -1
  7. {palimpzest-0.7.9 → palimpzest-0.7.11}/LICENSE +0 -0
  8. {palimpzest-0.7.9 → palimpzest-0.7.11}/README.md +0 -0
  9. {palimpzest-0.7.9 → palimpzest-0.7.11}/setup.cfg +0 -0
  10. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/__init__.py +0 -0
  11. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/constants.py +0 -0
  12. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/__init__.py +0 -0
  13. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/data/__init__.py +0 -0
  14. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/data/dataclasses.py +0 -0
  15. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/data/datareaders.py +0 -0
  16. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/elements/__init__.py +0 -0
  17. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/elements/filters.py +0 -0
  18. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/elements/groupbysig.py +0 -0
  19. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/elements/index.py +0 -0
  20. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/elements/records.py +0 -0
  21. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/lib/__init__.py +0 -0
  22. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/lib/fields.py +0 -0
  23. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/core/lib/schemas.py +0 -0
  24. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/policy.py +0 -0
  25. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/__init__.py +0 -0
  26. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/code_synthesis_prompts.py +0 -0
  27. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/convert_prompts.py +0 -0
  28. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/critique_and_refine_convert_prompts.py +0 -0
  29. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/filter_prompts.py +0 -0
  30. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/moa_aggregator_convert_prompts.py +0 -0
  31. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/moa_proposer_convert_prompts.py +0 -0
  32. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/prompt_factory.py +0 -0
  33. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/split_merge_prompts.py +0 -0
  34. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/split_proposer_prompts.py +0 -0
  35. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/prompts/util_phrases.py +0 -0
  36. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/__init__.py +0 -0
  37. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/__init__.py +0 -0
  38. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/all_sample_execution_strategy.py +0 -0
  39. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/execution_strategy.py +0 -0
  40. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/execution_strategy_type.py +0 -0
  41. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/mab_execution_strategy.py +0 -0
  42. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/parallel_execution_strategy.py +0 -0
  43. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/random_sampling_execution_strategy.py +0 -0
  44. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/execution/single_threaded_execution_strategy.py +0 -0
  45. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/generators/__init__.py +0 -0
  46. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/generators/api_client_factory.py +0 -0
  47. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/__init__.py +0 -0
  48. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/aggregate.py +0 -0
  49. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/code_synthesis_convert.py +0 -0
  50. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/convert.py +0 -0
  51. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/critique_and_refine_convert.py +0 -0
  52. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/filter.py +0 -0
  53. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/limit.py +0 -0
  54. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/logical.py +0 -0
  55. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/map.py +0 -0
  56. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/mixture_of_agents_convert.py +0 -0
  57. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/physical.py +0 -0
  58. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/project.py +0 -0
  59. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/rag_convert.py +0 -0
  60. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/retrieve.py +0 -0
  61. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/scan.py +0 -0
  62. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/operators/split_convert.py +0 -0
  63. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/__init__.py +0 -0
  64. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/cost_model.py +0 -0
  65. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/optimizer.py +0 -0
  66. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/optimizer_strategy.py +0 -0
  67. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/optimizer_strategy_type.py +0 -0
  68. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/plan.py +0 -0
  69. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/primitives.py +0 -0
  70. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/optimizer/tasks.py +0 -0
  71. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/__init__.py +0 -0
  72. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/config.py +0 -0
  73. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/nosentinel_processor.py +0 -0
  74. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/processing_strategy_type.py +0 -0
  75. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/query_processor.py +0 -0
  76. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/query_processor_factory.py +0 -0
  77. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/sentinel_processor.py +0 -0
  78. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/query/processor/streaming_processor.py +0 -0
  79. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/schemabuilder/__init__.py +0 -0
  80. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/schemabuilder/schema_builder.py +0 -0
  81. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/sets.py +0 -0
  82. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/tools/README.md +0 -0
  83. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/tools/__init__.py +0 -0
  84. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/tools/allenpdf.py +0 -0
  85. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/tools/pdfparser.py +0 -0
  86. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/tools/skema_tools.py +0 -0
  87. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/__init__.py +0 -0
  88. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/datareader_helpers.py +0 -0
  89. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/demo_helpers.py +0 -0
  90. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/env_helpers.py +0 -0
  91. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/field_helpers.py +0 -0
  92. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/generation_helpers.py +0 -0
  93. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/hash_helpers.py +0 -0
  94. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/progress.py +0 -0
  95. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/sandbox.py +0 -0
  96. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest/utils/udfs.py +0 -0
  97. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest.egg-info/SOURCES.txt +0 -0
  98. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest.egg-info/dependency_links.txt +0 -0
  99. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest.egg-info/requires.txt +0 -0
  100. {palimpzest-0.7.9 → palimpzest-0.7.11}/src/palimpzest.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: palimpzest
3
- Version: 0.7.9
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "palimpzest"
3
- version = "0.7.9"
3
+ version = "0.7.11"
4
4
  description = "Palimpzest is a system which enables anyone to process AI-powered analytical queries simply by defining them in a declarative language"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -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
@@ -323,7 +323,8 @@ class LLMConvertBondedRule(ImplementationRule):
323
323
  first_criteria = model in pure_vision_models and not is_image_conversion
324
324
  second_criteria = model in pure_text_models and is_image_conversion
325
325
  third_criteria = model.is_llama_model() and model.is_vision_model() and (num_image_fields > 1 or list_image_field)
326
- if first_criteria or second_criteria or third_criteria:
326
+ fourth_criteria = model.is_embedding_model()
327
+ if first_criteria or second_criteria or third_criteria or fourth_criteria:
327
328
  continue
328
329
 
329
330
  # construct multi-expression
@@ -470,7 +471,7 @@ class RAGConvertRule(ImplementationRule):
470
471
  physical_expressions = []
471
472
  for model in physical_op_params["available_models"]:
472
473
  # skip this model if this is a pure image model
473
- if model in pure_vision_models:
474
+ if model in pure_vision_models or model.is_embedding_model():
474
475
  continue
475
476
 
476
477
  for num_chunks_per_field in cls.num_chunks_per_fields:
@@ -666,7 +667,8 @@ class CriticAndRefineConvertRule(ImplementationRule):
666
667
  first_criteria = model in pure_vision_models and not is_image_conversion
667
668
  second_criteria = model in pure_text_models and is_image_conversion
668
669
  third_criteria = model.is_llama_model() and model.is_vision_model() and (num_image_fields > 1 or list_image_field)
669
- if first_criteria or second_criteria or third_criteria:
670
+ fourth_criteria = model.is_embedding_model()
671
+ if first_criteria or second_criteria or third_criteria or fourth_criteria:
670
672
  continue
671
673
 
672
674
  models.append(model)
@@ -746,7 +748,7 @@ class SplitConvertRule(ImplementationRule):
746
748
  physical_expressions = []
747
749
  for model in physical_op_params["available_models"]:
748
750
  # skip this model if this is a pure image model
749
- if model in pure_vision_models:
751
+ if model in pure_vision_models or model.is_embedding_model():
750
752
  continue
751
753
 
752
754
  for min_size_to_chunk in cls.min_size_to_chunk:
@@ -934,7 +936,8 @@ class LLMFilterRule(ImplementationRule):
934
936
  first_criteria = model in pure_vision_models and not is_image_filter
935
937
  second_criteria = model in pure_text_models and is_image_filter
936
938
  third_criteria = model.is_llama_model() and model.is_vision_model() and (num_image_fields > 1 or list_image_field)
937
- if first_criteria or second_criteria or third_criteria:
939
+ fourth_criteria = model.is_embedding_model()
940
+ if first_criteria or second_criteria or third_criteria or fourth_criteria:
938
941
  continue
939
942
 
940
943
  # construct multi-expression
@@ -25,13 +25,17 @@ def get_vision_models() -> list[Model]:
25
25
  return models
26
26
 
27
27
 
28
- def get_models(include_vision: bool = False) -> list[Model]:
28
+ def get_models(include_vision: bool = False, include_embedding: bool = False) -> list[Model]:
29
29
  """
30
30
  Return the set of models which the system has access to based on the set environment variables.
31
31
  """
32
32
  models = []
33
33
  if os.getenv("OPENAI_API_KEY") is not None:
34
34
  openai_models = [model for model in Model if model.is_openai_model()]
35
+ if not include_embedding:
36
+ openai_models = [
37
+ model for model in openai_models if not model.is_embedding_model()
38
+ ]
35
39
  models.extend(openai_models)
36
40
 
37
41
  if os.getenv("TOGETHER_API_KEY") is not None:
@@ -40,6 +44,10 @@ def get_models(include_vision: bool = False) -> list[Model]:
40
44
  together_models = [
41
45
  model for model in together_models if not model.is_vision_model()
42
46
  ]
47
+ if not include_embedding:
48
+ together_models = [
49
+ model for model in together_models if not model.is_embedding_model()
50
+ ]
43
51
  models.extend(together_models)
44
52
 
45
53
  if include_vision:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: palimpzest
3
- Version: 0.7.9
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
File without changes
File without changes
File without changes