palimpzest 0.8.5__tar.gz → 0.8.7__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.8.5/src/palimpzest.egg-info → palimpzest-0.8.7}/PKG-INFO +1 -1
  2. {palimpzest-0.8.5 → palimpzest-0.8.7}/pyproject.toml +1 -1
  3. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/elements/records.py +5 -1
  4. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/lib/schemas.py +7 -0
  5. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/prompt_factory.py +11 -10
  6. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/execution/mab_execution_strategy.py +0 -1
  7. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/optimizer_strategy.py +0 -3
  8. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/plan.py +5 -6
  9. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/validator/validator.py +7 -7
  10. {palimpzest-0.8.5 → palimpzest-0.8.7/src/palimpzest.egg-info}/PKG-INFO +1 -1
  11. {palimpzest-0.8.5 → palimpzest-0.8.7}/LICENSE +0 -0
  12. {palimpzest-0.8.5 → palimpzest-0.8.7}/README.md +0 -0
  13. {palimpzest-0.8.5 → palimpzest-0.8.7}/setup.cfg +0 -0
  14. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/__init__.py +0 -0
  15. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/agents/__init__.py +0 -0
  16. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/agents/compute_agents.py +0 -0
  17. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/agents/search_agents.py +0 -0
  18. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/constants.py +0 -0
  19. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/__init__.py +0 -0
  20. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/data/__init__.py +0 -0
  21. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/data/context.py +0 -0
  22. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/data/context_manager.py +0 -0
  23. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/data/dataset.py +0 -0
  24. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/data/index_dataset.py +0 -0
  25. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/data/iter_dataset.py +0 -0
  26. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/elements/__init__.py +0 -0
  27. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/elements/filters.py +0 -0
  28. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/elements/groupbysig.py +0 -0
  29. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/lib/__init__.py +0 -0
  30. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/core/models.py +0 -0
  31. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/policy.py +0 -0
  32. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/__init__.py +0 -0
  33. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/agent_prompts.py +0 -0
  34. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/context_search.py +0 -0
  35. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/convert_prompts.py +0 -0
  36. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/critique_and_refine_prompts.py +0 -0
  37. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/filter_prompts.py +0 -0
  38. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/join_prompts.py +0 -0
  39. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/moa_aggregator_prompts.py +0 -0
  40. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/moa_proposer_prompts.py +0 -0
  41. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/split_merge_prompts.py +0 -0
  42. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/split_proposer_prompts.py +0 -0
  43. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/utils.py +0 -0
  44. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/prompts/validator.py +0 -0
  45. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/__init__.py +0 -0
  46. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/execution/__init__.py +0 -0
  47. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/execution/all_sample_execution_strategy.py +0 -0
  48. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/execution/execution_strategy.py +0 -0
  49. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/execution/execution_strategy_type.py +0 -0
  50. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/execution/parallel_execution_strategy.py +0 -0
  51. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/execution/single_threaded_execution_strategy.py +0 -0
  52. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/generators/__init__.py +0 -0
  53. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/generators/generators.py +0 -0
  54. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/__init__.py +0 -0
  55. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/aggregate.py +0 -0
  56. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/compute.py +0 -0
  57. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/convert.py +0 -0
  58. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/critique_and_refine.py +0 -0
  59. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/distinct.py +0 -0
  60. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/filter.py +0 -0
  61. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/join.py +0 -0
  62. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/limit.py +0 -0
  63. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/logical.py +0 -0
  64. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/mixture_of_agents.py +0 -0
  65. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/physical.py +0 -0
  66. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/project.py +0 -0
  67. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/rag.py +0 -0
  68. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/retrieve.py +0 -0
  69. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/scan.py +0 -0
  70. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/search.py +0 -0
  71. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/operators/split.py +0 -0
  72. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/__init__.py +0 -0
  73. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/cost_model.py +0 -0
  74. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/optimizer.py +0 -0
  75. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/optimizer_strategy_type.py +0 -0
  76. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/primitives.py +0 -0
  77. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/rules.py +0 -0
  78. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/optimizer/tasks.py +0 -0
  79. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/processor/__init__.py +0 -0
  80. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/processor/config.py +0 -0
  81. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/processor/query_processor.py +0 -0
  82. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/query/processor/query_processor_factory.py +0 -0
  83. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/schemabuilder/__init__.py +0 -0
  84. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/schemabuilder/schema_builder.py +0 -0
  85. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/tools/README.md +0 -0
  86. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/tools/__init__.py +0 -0
  87. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/tools/allenpdf.py +0 -0
  88. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/tools/pdfparser.py +0 -0
  89. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/tools/skema_tools.py +0 -0
  90. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/utils/__init__.py +0 -0
  91. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/utils/env_helpers.py +0 -0
  92. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/utils/hash_helpers.py +0 -0
  93. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/utils/model_helpers.py +0 -0
  94. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/utils/progress.py +0 -0
  95. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/utils/udfs.py +0 -0
  96. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest/validator/__init__.py +0 -0
  97. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest.egg-info/SOURCES.txt +0 -0
  98. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest.egg-info/dependency_links.txt +0 -0
  99. {palimpzest-0.8.5 → palimpzest-0.8.7}/src/palimpzest.egg-info/requires.txt +0 -0
  100. {palimpzest-0.8.5 → palimpzest-0.8.7}/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.8.5
3
+ Version: 0.8.7
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.8.5"
3
+ version = "0.8.7"
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.10"
@@ -11,6 +11,8 @@ from pydantic.fields import FieldInfo
11
11
 
12
12
  from palimpzest.core.data import context
13
13
  from palimpzest.core.lib.schemas import (
14
+ AUDIO_FIELD_TYPES,
15
+ IMAGE_FIELD_TYPES,
14
16
  AudioBase64,
15
17
  AudioFilepath,
16
18
  ImageBase64,
@@ -303,9 +305,11 @@ class DataRecord:
303
305
  dct = {k: v for k, v in dct.items() if k in project_field_names}
304
306
 
305
307
  if not include_bytes:
308
+ bytes_field_types = [bytes, list[bytes], bytes | None, list[bytes] | None, bytes | Any, list[bytes] | Any]
309
+ bytes_field_types += AUDIO_FIELD_TYPES + IMAGE_FIELD_TYPES
306
310
  for k in dct:
307
311
  field_type = self.get_field_type(k)
308
- if field_type.annotation in [bytes, AudioBase64, ImageBase64, list[bytes], list[ImageBase64]]:
312
+ if field_type.annotation in bytes_field_types:
309
313
  dct[k] = "<bytes>"
310
314
 
311
315
  if bytes_to_str:
@@ -33,20 +33,27 @@ IMAGE_LIST_FIELD_TYPES = [
33
33
  list[ImageBase64] | None,
34
34
  list[ImageFilepath] | None,
35
35
  list[ImageURL] | None,
36
+ list[ImageBase64] | Any,
37
+ list[ImageFilepath] | Any,
38
+ list[ImageURL] | Any,
36
39
  ]
37
40
  IMAGE_FIELD_TYPES = IMAGE_LIST_FIELD_TYPES + [
38
41
  ImageBase64, ImageFilepath, ImageURL,
39
42
  ImageBase64 | None, ImageFilepath | None, ImageURL | None,
43
+ ImageBase64 | Any, ImageFilepath | Any, ImageURL | Any,
40
44
  ]
41
45
  AUDIO_LIST_FIELD_TYPES = [
42
46
  list[AudioBase64],
43
47
  list[AudioFilepath],
44
48
  list[AudioBase64] | None,
45
49
  list[AudioFilepath] | None,
50
+ list[AudioBase64] | Any,
51
+ list[AudioFilepath] | Any,
46
52
  ]
47
53
  AUDIO_FIELD_TYPES = AUDIO_LIST_FIELD_TYPES + [
48
54
  AudioBase64, AudioFilepath,
49
55
  AudioBase64 | None, AudioFilepath | None,
56
+ AudioBase64 | Any, AudioFilepath | Any,
50
57
  ]
51
58
 
52
59
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  import base64
4
4
  import json
5
+ from typing import Any
5
6
 
6
7
  from pydantic import BaseModel
7
8
 
@@ -747,14 +748,14 @@ class PromptFactory:
747
748
  field_type = candidate.get_field_type(field_name)
748
749
 
749
750
  # audio filepath (or list of audio filepaths)
750
- if field_type.annotation in [AudioFilepath, AudioFilepath | None]:
751
+ if field_type.annotation in [AudioFilepath, AudioFilepath | None, AudioFilepath | Any]:
751
752
  with open(field_value, "rb") as f:
752
753
  base64_audio_str = base64.b64encode(f.read()).decode("utf-8")
753
754
  audio_content.append(
754
755
  {"type": "input_audio", "input_audio": {"data": base64_audio_str, "format": "wav"}}
755
756
  )
756
757
 
757
- elif field_type.annotation in [list[AudioFilepath], list[AudioFilepath] | None]:
758
+ elif field_type.annotation in [list[AudioFilepath], list[AudioFilepath] | None, list[AudioFilepath] | Any]:
758
759
  for audio_filepath in field_value:
759
760
  with open(audio_filepath, "rb") as f:
760
761
  base64_audio_str = base64.b64encode(f.read()).decode("utf-8")
@@ -763,12 +764,12 @@ class PromptFactory:
763
764
  )
764
765
 
765
766
  # pre-encoded images (or list of pre-encoded images)
766
- elif field_type.annotation in [AudioBase64, AudioBase64 | None]:
767
+ elif field_type.annotation in [AudioBase64, AudioBase64 | None, AudioBase64 | Any]:
767
768
  audio_content.append(
768
769
  {"type": "input_audio", "input_audio": {"data": field_value, "format": "wav"}}
769
770
  )
770
771
 
771
- elif field_type.annotation in [list[AudioBase64], list[AudioBase64] | None]:
772
+ elif field_type.annotation in [list[AudioBase64], list[AudioBase64] | None, list[AudioBase64] | Any]:
772
773
  for base64_audio in field_value:
773
774
  audio_content.append(
774
775
  {"type": "input_audio", "input_audio": {"data": base64_audio, "format": "wav"}}
@@ -794,14 +795,14 @@ class PromptFactory:
794
795
  field_type = candidate.get_field_type(field_name)
795
796
 
796
797
  # image filepath (or list of image filepaths)
797
- if field_type.annotation in [ImageFilepath, ImageFilepath | None]:
798
+ if field_type.annotation in [ImageFilepath, ImageFilepath | None, ImageFilepath | Any]:
798
799
  with open(field_value, "rb") as f:
799
800
  base64_image_str = base64.b64encode(f.read()).decode("utf-8")
800
801
  image_content.append(
801
802
  {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{base64_image_str}"}}
802
803
  )
803
804
 
804
- elif field_type.annotation in [list[ImageFilepath], list[ImageFilepath] | None]:
805
+ elif field_type.annotation in [list[ImageFilepath], list[ImageFilepath] | None, list[ImageFilepath] | Any]:
805
806
  for image_filepath in field_value:
806
807
  with open(image_filepath, "rb") as f:
807
808
  base64_image_str = base64.b64encode(f.read()).decode("utf-8")
@@ -810,20 +811,20 @@ class PromptFactory:
810
811
  )
811
812
 
812
813
  # image url (or list of image urls)
813
- elif field_type.annotation in [ImageURL, ImageURL | None]:
814
+ elif field_type.annotation in [ImageURL, ImageURL | None, ImageURL | Any]:
814
815
  image_content.append({"type": "image_url", "image_url": {"url": field_value}})
815
816
 
816
- elif field_type.annotation in [list[ImageURL], list[ImageURL] | None]:
817
+ elif field_type.annotation in [list[ImageURL], list[ImageURL] | None, list[ImageURL] | Any]:
817
818
  for image_url in field_value:
818
819
  image_content.append({"type": "image_url", "image_url": {"url": image_url}})
819
820
 
820
821
  # pre-encoded images (or list of pre-encoded images)
821
- elif field_type.annotation in [ImageBase64, ImageBase64 | None]:
822
+ elif field_type.annotation in [ImageBase64, ImageBase64 | None, ImageBase64 | Any]:
822
823
  image_content.append(
823
824
  {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{field_value}"}}
824
825
  )
825
826
 
826
- elif field_type.annotation in [list[ImageBase64], list[ImageBase64] | None]:
827
+ elif field_type.annotation in [list[ImageBase64], list[ImageBase64] | None, list[ImageBase64] | Any]:
827
828
  for base64_image in field_value:
828
829
  image_content.append(
829
830
  {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{base64_image}"}}
@@ -755,7 +755,6 @@ class MABExecutionStrategy(SentinelExecutionStrategy):
755
755
 
756
756
  def execute_sentinel_plan(self, plan: SentinelPlan, train_dataset: dict[str, Dataset], validator: Validator) -> SentinelPlanStats:
757
757
  logger.info(f"Executing plan {plan.plan_id} with {self.max_workers} workers")
758
- logger.info(f"Plan Details: {plan}")
759
758
 
760
759
  # initialize plan stats
761
760
  plan_stats = SentinelPlanStats.from_plan(plan)
@@ -58,7 +58,6 @@ class GreedyStrategy(OptimizationStrategy):
58
58
  def get_optimal_plans(self, groups: dict, final_group_id: int, policy: Policy, use_final_op_quality: bool) -> list[PhysicalPlan]:
59
59
  logger.info(f"Getting greedy optimal plans for final group id: {final_group_id}")
60
60
  plans = [self._get_greedy_physical_plan(groups, final_group_id)]
61
- logger.info(f"Greedy optimal plans: {plans}")
62
61
  logger.info(f"Done getting greedy optimal plans for final group id: {final_group_id}")
63
62
 
64
63
  return plans
@@ -137,7 +136,6 @@ class ParetoStrategy(OptimizationStrategy):
137
136
  optimal_plan = optimal_plan if policy.choose(optimal_plan.plan_cost, plan.plan_cost) else plan
138
137
 
139
138
  plans = [optimal_plan]
140
- logger.info(f"Pareto optimal plans: {plans}")
141
139
  logger.info(f"Done getting pareto optimal plans for final group id: {final_group_id}")
142
140
  return plans
143
141
 
@@ -174,7 +172,6 @@ class SentinelStrategy(OptimizationStrategy):
174
172
  def get_optimal_plans(self, groups: dict, final_group_id: int, policy: Policy, use_final_op_quality: bool) -> list[SentinelPlan]:
175
173
  logger.info(f"Getting sentinel optimal plans for final group id: {final_group_id}")
176
174
  plans = [self._get_sentinel_plan(groups, final_group_id)]
177
- logger.info(f"Sentinel optimal plans: {plans}")
178
175
  logger.info(f"Done getting sentinel optimal plans for final group id: {final_group_id}")
179
176
  return plans
180
177
 
@@ -330,12 +330,11 @@ class SentinelPlan(Plan):
330
330
 
331
331
  def _get_str(self, idx: int = 0, indent: int = 0) -> str:
332
332
  indent_str = " " * (indent * 2)
333
- plan_str = ""
334
- for inner_idx, operator in enumerate(self.operator_set):
335
- inner_idx_str = "" if len(self.operator_set) == 1 else f"{inner_idx + 1}."
336
- plan_str += f"{indent_str}{idx}.{inner_idx_str} {str(operator)}\n"
337
- for subplan in self.subplans:
338
- plan_str += subplan._get_str(idx=idx + 1, indent=indent + 1)
333
+ operator = self.operator_set[0]
334
+ inner_idx_str = "" if len(self.operator_set) == 1 else f"1 - {len(self.operator_set)}."
335
+ plan_str = f"{indent_str}{idx}.{inner_idx_str} {str(operator)}\n"
336
+ for subplan in self.subplans:
337
+ plan_str += subplan._get_str(idx=idx + 1, indent=indent + 1)
339
338
 
340
339
  return plan_str
341
340
 
@@ -2,8 +2,8 @@ import json
2
2
  import time
3
3
 
4
4
  import litellm
5
- from colorama import Fore, Style
6
5
 
6
+ # from colorama import Fore, Style
7
7
  from palimpzest.constants import MODEL_CARDS, Cardinality, Model, PromptStrategy
8
8
  from palimpzest.core.elements.records import DataRecord
9
9
  from palimpzest.core.models import GenerationStats
@@ -87,7 +87,7 @@ class Validator:
87
87
  input_messages = [msg for msg in messages if msg["role"] != "system"]
88
88
  output = json.dumps(output, indent=2)
89
89
  output_message = f"OUTPUT:\n--------\n{output}\n\nEVALUATION: "
90
- input_str = '\n'.join(list(map(lambda d: d['content'], input_messages + [{"role": "user", "content": output_message}])))
90
+ # input_str = '\n'.join(list(map(lambda d: d['content'], input_messages + [{"role": "user", "content": output_message}])))
91
91
 
92
92
  # invoke the judge
93
93
  score, gen_stats = None, GenerationStats()
@@ -98,8 +98,8 @@ class Validator:
98
98
  completion = litellm.completion(model=self.model.value, messages=val_messages)
99
99
  completion_text = completion.choices[0].message.content
100
100
  gen_stats = self._get_gen_stats_from_completion(completion, start_time)
101
- print(f"INPUT:\n{input_str}")
102
- print(Fore.GREEN + f"{completion_text}\n" + Style.RESET_ALL)
101
+ # print(f"INPUT:\n{input_str}")
102
+ # print(Fore.GREEN + f"{completion_text}\n" + Style.RESET_ALL)
103
103
 
104
104
  # parse the evaluation
105
105
  eval_dict: dict = get_json_from_answer(completion_text, self.model, Cardinality.ONE_TO_ONE)
@@ -233,7 +233,7 @@ class Validator:
233
233
  input_messages = [msg for msg in messages if msg["role"] != "system"]
234
234
  output = json.dumps(output, indent=2)
235
235
  output_message = f"OUTPUT:\n--------\n{output}\n\nEVALUATION: "
236
- input_str = '\n'.join(list(map(lambda d: d['content'], input_messages + [{"role": "user", "content": output_message}])))
236
+ # input_str = '\n'.join(list(map(lambda d: d['content'], input_messages + [{"role": "user", "content": output_message}])))
237
237
 
238
238
  # invoke the judge
239
239
  score, gen_stats = None, GenerationStats()
@@ -245,8 +245,8 @@ class Validator:
245
245
  completion = litellm.completion(model="openai/o4-mini", messages=val_messages)
246
246
  completion_text = completion.choices[0].message.content
247
247
  gen_stats = self._get_gen_stats_from_completion(completion, start_time)
248
- print(f"INPUT:\n{input_str}")
249
- print(Fore.GREEN + f"{completion_text}\n" + Style.RESET_ALL)
248
+ # print(f"INPUT:\n{input_str}")
249
+ # print(Fore.GREEN + f"{completion_text}\n" + Style.RESET_ALL)
250
250
 
251
251
  # parse the evaluation
252
252
  eval_dict: dict = get_json_from_answer(completion_text, self.model, Cardinality.ONE_TO_ONE)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: palimpzest
3
- Version: 0.8.5
3
+ Version: 0.8.7
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