palimpzest 0.8.0__tar.gz → 0.8.2__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.
- {palimpzest-0.8.0/src/palimpzest.egg-info → palimpzest-0.8.2}/PKG-INFO +1 -1
- {palimpzest-0.8.0 → palimpzest-0.8.2}/pyproject.toml +1 -1
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/constants.py +107 -35
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/data/dataset.py +13 -8
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/convert_prompts.py +2 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/filter_prompts.py +2 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/join_prompts.py +2 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/moa_proposer_convert_prompts.py +1 -1
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/prompt_factory.py +17 -1
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/split_proposer_prompts.py +1 -1
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/util_phrases.py +5 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/execution/mab_execution_strategy.py +46 -21
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/generators/generators.py +3 -1
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/convert.py +10 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/critique_and_refine_convert.py +2 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/filter.py +5 -4
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/join.py +6 -5
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/logical.py +12 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/mixture_of_agents_convert.py +2 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/split_convert.py +2 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/processor/config.py +3 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/processor/query_processor.py +2 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/processor/query_processor_factory.py +10 -6
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/utils/model_helpers.py +7 -2
- {palimpzest-0.8.0 → palimpzest-0.8.2/src/palimpzest.egg-info}/PKG-INFO +1 -1
- {palimpzest-0.8.0 → palimpzest-0.8.2}/LICENSE +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/README.md +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/setup.cfg +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/agents/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/agents/compute_agents.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/agents/search_agents.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/data/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/data/context.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/data/context_manager.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/data/index_dataset.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/data/iter_dataset.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/elements/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/elements/filters.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/elements/groupbysig.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/elements/records.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/lib/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/lib/schemas.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/core/models.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/policy.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/agent_prompts.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/context_search.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/critique_and_refine_convert_prompts.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/moa_aggregator_convert_prompts.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/split_merge_prompts.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/validator.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/execution/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/execution/all_sample_execution_strategy.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/execution/execution_strategy.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/execution/execution_strategy_type.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/execution/parallel_execution_strategy.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/execution/single_threaded_execution_strategy.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/generators/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/aggregate.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/compute.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/distinct.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/limit.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/physical.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/project.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/rag_convert.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/retrieve.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/scan.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/operators/search.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/cost_model.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/optimizer.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/optimizer_strategy.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/optimizer_strategy_type.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/plan.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/primitives.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/rules.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/optimizer/tasks.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/query/processor/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/schemabuilder/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/schemabuilder/schema_builder.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/tools/README.md +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/tools/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/tools/allenpdf.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/tools/pdfparser.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/tools/skema_tools.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/utils/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/utils/env_helpers.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/utils/hash_helpers.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/utils/progress.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/utils/udfs.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/validator/__init__.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/validator/validator.py +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest.egg-info/SOURCES.txt +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest.egg-info/dependency_links.txt +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest.egg-info/requires.txt +0 -0
- {palimpzest-0.8.0 → palimpzest-0.8.2}/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.
|
|
3
|
+
Version: 0.8.2
|
|
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.
|
|
3
|
+
version = "0.8.2"
|
|
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"
|
|
@@ -18,8 +18,12 @@ class Model(str, Enum):
|
|
|
18
18
|
DEEPSEEK_R1_DISTILL_QWEN_1_5B = "together_ai/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
|
19
19
|
GPT_4o = "openai/gpt-4o-2024-08-06"
|
|
20
20
|
GPT_4o_MINI = "openai/gpt-4o-mini-2024-07-18"
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
GPT_4_1 = "openai/gpt-4.1-2025-04-14"
|
|
22
|
+
GPT_4_1_MINI = "openai/gpt-4.1-mini-2025-04-14"
|
|
23
|
+
GPT_4_1_NANO = "openai/gpt-4.1-nano-2025-04-14"
|
|
24
|
+
GPT_5 = "openai/gpt-5-2025-08-07"
|
|
25
|
+
GPT_5_MINI = "openai/gpt-5-mini-2025-08-07"
|
|
26
|
+
GPT_5_NANO = "openai/gpt-5-nano-2025-08-07"
|
|
23
27
|
o4_MINI = "openai/o4-mini-2025-04-16" # noqa: N815
|
|
24
28
|
TEXT_EMBEDDING_3_SMALL = "text-embedding-3-small"
|
|
25
29
|
CLIP_VIT_B_32 = "clip-ViT-B-32"
|
|
@@ -29,6 +33,9 @@ class Model(str, Enum):
|
|
|
29
33
|
GEMINI_2_0_FLASH = "vertex_ai/gemini-2.0-flash"
|
|
30
34
|
GEMINI_2_5_FLASH = "vertex_ai/gemini-2.5-flash"
|
|
31
35
|
GEMINI_2_5_PRO = "vertex_ai/gemini-2.5-pro"
|
|
36
|
+
GOOGLE_GEMINI_2_5_FLASH = "google/gemini-2.5-flash"
|
|
37
|
+
GOOGLE_GEMINI_2_5_FLASH_LITE = "google/gemini-2.5-flash-lite"
|
|
38
|
+
GOOGLE_GEMINI_2_5_PRO = "google/gemini-2.5-pro"
|
|
32
39
|
LLAMA_4_MAVERICK = "vertex_ai/meta/llama-4-maverick-17b-128e-instruct-maas"
|
|
33
40
|
GPT_4o_AUDIO_PREVIEW = "openai/gpt-4o-audio-preview"
|
|
34
41
|
GPT_4o_MINI_AUDIO_PREVIEW = "openai/gpt-4o-mini-audio-preview"
|
|
@@ -54,7 +61,7 @@ class Model(str, Enum):
|
|
|
54
61
|
return self in [Model.o4_MINI]
|
|
55
62
|
|
|
56
63
|
def is_gpt_5_model(self):
|
|
57
|
-
return self in [Model.GPT_5, Model.GPT_5_MINI]
|
|
64
|
+
return self in [Model.GPT_5, Model.GPT_5_MINI, Model.GPT_5_NANO]
|
|
58
65
|
|
|
59
66
|
def is_openai_model(self):
|
|
60
67
|
return "openai" in self.value.lower() or self.is_text_embedding_model()
|
|
@@ -65,13 +72,17 @@ class Model(str, Enum):
|
|
|
65
72
|
def is_vertex_model(self):
|
|
66
73
|
return "vertex_ai" in self.value.lower()
|
|
67
74
|
|
|
75
|
+
def is_google_model(self):
|
|
76
|
+
return "google" in self.value.lower()
|
|
77
|
+
|
|
68
78
|
def is_vllm_model(self):
|
|
69
79
|
return "hosted_vllm" in self.value.lower()
|
|
70
80
|
|
|
71
81
|
def is_reasoning_model(self):
|
|
72
82
|
reasoning_models = [
|
|
73
|
-
Model.GPT_5, Model.GPT_5_MINI, Model.o4_MINI,
|
|
83
|
+
Model.GPT_5, Model.GPT_5_MINI, Model.GPT_5_NANO, Model.o4_MINI,
|
|
74
84
|
Model.GEMINI_2_5_PRO, Model.GEMINI_2_5_FLASH,
|
|
85
|
+
Model.GOOGLE_GEMINI_2_5_PRO, Model.GOOGLE_GEMINI_2_5_FLASH, Model.GOOGLE_GEMINI_2_5_FLASH_LITE,
|
|
75
86
|
Model.CLAUDE_3_7_SONNET,
|
|
76
87
|
]
|
|
77
88
|
return self in reasoning_models
|
|
@@ -88,27 +99,31 @@ class Model(str, Enum):
|
|
|
88
99
|
def is_vision_model(self):
|
|
89
100
|
return self in [
|
|
90
101
|
Model.LLAMA3_2_90B_V, Model.LLAMA_4_MAVERICK,
|
|
91
|
-
Model.GPT_4o, Model.GPT_4o_MINI, Model.o4_MINI, Model.GPT_5, Model.GPT_5_MINI,
|
|
102
|
+
Model.GPT_4o, Model.GPT_4o_MINI, Model.GPT_4_1, Model.GPT_4_1_MINI, Model.GPT_4_1_NANO, Model.o4_MINI, Model.GPT_5, Model.GPT_5_MINI, Model.GPT_5_NANO,
|
|
92
103
|
Model.GEMINI_2_0_FLASH, Model.GEMINI_2_5_FLASH, Model.GEMINI_2_5_PRO,
|
|
104
|
+
Model.GOOGLE_GEMINI_2_5_PRO, Model.GOOGLE_GEMINI_2_5_FLASH, Model.GOOGLE_GEMINI_2_5_FLASH_LITE,
|
|
93
105
|
]
|
|
94
106
|
|
|
95
107
|
def is_audio_model(self):
|
|
96
108
|
return self in [
|
|
97
109
|
Model.GPT_4o_AUDIO_PREVIEW, Model.GPT_4o_MINI_AUDIO_PREVIEW,
|
|
98
110
|
Model.GEMINI_2_0_FLASH, Model.GEMINI_2_5_FLASH, Model.GEMINI_2_5_PRO,
|
|
111
|
+
Model.GOOGLE_GEMINI_2_5_PRO, Model.GOOGLE_GEMINI_2_5_FLASH, Model.GOOGLE_GEMINI_2_5_FLASH_LITE,
|
|
99
112
|
]
|
|
100
113
|
|
|
101
114
|
def is_text_image_multimodal_model(self):
|
|
102
115
|
return self in [
|
|
103
116
|
Model.LLAMA_4_MAVERICK,
|
|
104
|
-
Model.GPT_4o, Model.GPT_4o_MINI, Model.o4_MINI, Model.GPT_5, Model.GPT_5_MINI,
|
|
117
|
+
Model.GPT_4o, Model.GPT_4o_MINI, Model.GPT_4_1, Model.GPT_4_1_MINI, Model.GPT_4_1_NANO, Model.o4_MINI, Model.GPT_5, Model.GPT_5_MINI, Model.GPT_5_NANO,
|
|
105
118
|
Model.GEMINI_2_0_FLASH, Model.GEMINI_2_5_FLASH, Model.GEMINI_2_5_PRO,
|
|
119
|
+
Model.GOOGLE_GEMINI_2_5_PRO, Model.GOOGLE_GEMINI_2_5_FLASH, Model.GOOGLE_GEMINI_2_5_FLASH_LITE,
|
|
106
120
|
]
|
|
107
121
|
|
|
108
122
|
def is_text_audio_multimodal_model(self):
|
|
109
123
|
return self in [
|
|
110
124
|
Model.GPT_4o_AUDIO_PREVIEW, Model.GPT_4o_MINI_AUDIO_PREVIEW,
|
|
111
125
|
Model.GEMINI_2_0_FLASH, Model.GEMINI_2_5_FLASH, Model.GEMINI_2_5_PRO,
|
|
126
|
+
Model.GOOGLE_GEMINI_2_5_PRO, Model.GOOGLE_GEMINI_2_5_FLASH, Model.GOOGLE_GEMINI_2_5_FLASH_LITE,
|
|
112
127
|
]
|
|
113
128
|
|
|
114
129
|
def is_embedding_model(self):
|
|
@@ -327,7 +342,7 @@ LLAMA3_2_3B_INSTRUCT_MODEL_CARD = {
|
|
|
327
342
|
"usd_per_input_token": 0.06 / 1e6,
|
|
328
343
|
"usd_per_output_token": 0.06 / 1e6,
|
|
329
344
|
##### Time #####
|
|
330
|
-
"seconds_per_output_token": 0.
|
|
345
|
+
"seconds_per_output_token": 0.0079,
|
|
331
346
|
##### Agg. Benchmark #####
|
|
332
347
|
"overall": 36.50, # https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct/discussions/13
|
|
333
348
|
}
|
|
@@ -336,7 +351,7 @@ LLAMA3_1_8B_INSTRUCT_MODEL_CARD = {
|
|
|
336
351
|
"usd_per_input_token": 0.18 / 1e6,
|
|
337
352
|
"usd_per_output_token": 0.18 / 1e6,
|
|
338
353
|
##### Time #####
|
|
339
|
-
"seconds_per_output_token": 0.
|
|
354
|
+
"seconds_per_output_token": 0.0050,
|
|
340
355
|
##### Agg. Benchmark #####
|
|
341
356
|
"overall": 44.25,
|
|
342
357
|
}
|
|
@@ -345,7 +360,7 @@ LLAMA3_3_70B_INSTRUCT_MODEL_CARD = {
|
|
|
345
360
|
"usd_per_input_token": 0.88 / 1e6,
|
|
346
361
|
"usd_per_output_token": 0.88 / 1e6,
|
|
347
362
|
##### Time #####
|
|
348
|
-
"seconds_per_output_token": 0.
|
|
363
|
+
"seconds_per_output_token": 0.0122,
|
|
349
364
|
##### Agg. Benchmark #####
|
|
350
365
|
"overall": 69.9,
|
|
351
366
|
}
|
|
@@ -354,7 +369,7 @@ LLAMA3_2_90B_V_MODEL_CARD = {
|
|
|
354
369
|
"usd_per_input_token": 1.2 / 1e6,
|
|
355
370
|
"usd_per_output_token": 1.2 / 1e6,
|
|
356
371
|
##### Time #####
|
|
357
|
-
"seconds_per_output_token": 0.
|
|
372
|
+
"seconds_per_output_token": 0.0303,
|
|
358
373
|
##### Agg. Benchmark #####
|
|
359
374
|
"overall": 65.00, # set to be slightly higher than gpt-4o-mini
|
|
360
375
|
}
|
|
@@ -363,7 +378,7 @@ DEEPSEEK_V3_MODEL_CARD = {
|
|
|
363
378
|
"usd_per_input_token": 1.25 / 1E6,
|
|
364
379
|
"usd_per_output_token": 1.25 / 1E6,
|
|
365
380
|
##### Time #####
|
|
366
|
-
"seconds_per_output_token": 0.
|
|
381
|
+
"seconds_per_output_token": 0.0114,
|
|
367
382
|
##### Agg. Benchmark #####
|
|
368
383
|
"overall": 73.8,
|
|
369
384
|
}
|
|
@@ -372,7 +387,7 @@ DEEPSEEK_R1_DISTILL_QWEN_1_5B_MODEL_CARD = {
|
|
|
372
387
|
"usd_per_input_token": 0.18 / 1E6,
|
|
373
388
|
"usd_per_output_token": 0.18 / 1E6,
|
|
374
389
|
##### Time #####
|
|
375
|
-
"seconds_per_output_token": 0.
|
|
390
|
+
"seconds_per_output_token": 0.0050, # NOTE: copied to be same as LLAMA3_1_8B_INSTRUCT_MODEL_CARD; need to update when we have data
|
|
376
391
|
##### Agg. Benchmark #####
|
|
377
392
|
"overall": 39.90, # https://www.reddit.com/r/LocalLLaMA/comments/1iserf9/deepseek_r1_distilled_models_mmlu_pro_benchmarks/
|
|
378
393
|
}
|
|
@@ -382,7 +397,7 @@ GPT_4o_AUDIO_PREVIEW_MODEL_CARD = {
|
|
|
382
397
|
"usd_per_audio_input_token": 2.5 / 1e6,
|
|
383
398
|
"usd_per_output_token": 10.0 / 1e6,
|
|
384
399
|
##### Time #####
|
|
385
|
-
"seconds_per_output_token": 0.
|
|
400
|
+
"seconds_per_output_token": 0.0080,
|
|
386
401
|
##### Agg. Benchmark #####
|
|
387
402
|
"overall": 74.1,
|
|
388
403
|
}
|
|
@@ -392,7 +407,7 @@ GPT_4o_MINI_AUDIO_PREVIEW_MODEL_CARD = {
|
|
|
392
407
|
"usd_per_audio_input_token": 0.15 / 1e6,
|
|
393
408
|
"usd_per_output_token": 0.6 / 1e6,
|
|
394
409
|
##### Time #####
|
|
395
|
-
"seconds_per_output_token": 0.
|
|
410
|
+
"seconds_per_output_token": 0.0159,
|
|
396
411
|
##### Agg. Benchmark #####
|
|
397
412
|
"overall": 62.7,
|
|
398
413
|
}
|
|
@@ -402,7 +417,7 @@ GPT_4o_MODEL_CARD = {
|
|
|
402
417
|
"usd_per_input_token": 2.5 / 1e6,
|
|
403
418
|
"usd_per_output_token": 10.0 / 1e6,
|
|
404
419
|
##### Time #####
|
|
405
|
-
"seconds_per_output_token": 0.
|
|
420
|
+
"seconds_per_output_token": 0.0080,
|
|
406
421
|
##### Agg. Benchmark #####
|
|
407
422
|
"overall": 74.1,
|
|
408
423
|
}
|
|
@@ -412,17 +427,47 @@ GPT_4o_MINI_MODEL_CARD = {
|
|
|
412
427
|
"usd_per_input_token": 0.15 / 1e6,
|
|
413
428
|
"usd_per_output_token": 0.6 / 1e6,
|
|
414
429
|
##### Time #####
|
|
415
|
-
"seconds_per_output_token": 0.
|
|
430
|
+
"seconds_per_output_token": 0.0159,
|
|
416
431
|
##### Agg. Benchmark #####
|
|
417
432
|
"overall": 62.7,
|
|
418
433
|
}
|
|
434
|
+
GPT_4_1_MODEL_CARD = {
|
|
435
|
+
# NOTE: it is unclear if the same ($ / token) costs can be applied for vision, or if we have to calculate this ourselves
|
|
436
|
+
##### Cost in USD #####
|
|
437
|
+
"usd_per_input_token": 2.0 / 1e6,
|
|
438
|
+
"usd_per_output_token": 8.0 / 1e6,
|
|
439
|
+
##### Time #####
|
|
440
|
+
"seconds_per_output_token": 0.0076,
|
|
441
|
+
##### Agg. Benchmark #####
|
|
442
|
+
"overall": 80.5,
|
|
443
|
+
}
|
|
444
|
+
GPT_4_1_MINI_MODEL_CARD = {
|
|
445
|
+
# NOTE: it is unclear if the same ($ / token) costs can be applied for vision, or if we have to calculate this ourselves
|
|
446
|
+
##### Cost in USD #####
|
|
447
|
+
"usd_per_input_token": 0.4 / 1e6,
|
|
448
|
+
"usd_per_output_token": 1.6 / 1e6,
|
|
449
|
+
##### Time #####
|
|
450
|
+
"seconds_per_output_token": 0.0161,
|
|
451
|
+
##### Agg. Benchmark #####
|
|
452
|
+
"overall": 77.2,
|
|
453
|
+
}
|
|
454
|
+
GPT_4_1_NANO_MODEL_CARD = {
|
|
455
|
+
# NOTE: it is unclear if the same ($ / token) costs can be applied for vision, or if we have to calculate this ourselves
|
|
456
|
+
##### Cost in USD #####
|
|
457
|
+
"usd_per_input_token": 0.1 / 1e6,
|
|
458
|
+
"usd_per_output_token": 0.4 / 1e6,
|
|
459
|
+
##### Time #####
|
|
460
|
+
"seconds_per_output_token": 0.0060,
|
|
461
|
+
##### Agg. Benchmark #####
|
|
462
|
+
"overall": 62.3,
|
|
463
|
+
}
|
|
419
464
|
GPT_5_MODEL_CARD = {
|
|
420
465
|
# NOTE: it is unclear if the same ($ / token) costs can be applied for vision, or if we have to calculate this ourselves
|
|
421
466
|
##### Cost in USD #####
|
|
422
467
|
"usd_per_input_token": 1.25 / 1e6,
|
|
423
468
|
"usd_per_output_token": 10.0 / 1e6,
|
|
424
469
|
##### Time #####
|
|
425
|
-
"seconds_per_output_token": 0.
|
|
470
|
+
"seconds_per_output_token": 0.0060,
|
|
426
471
|
##### Agg. Benchmark #####
|
|
427
472
|
"overall": 87.00,
|
|
428
473
|
}
|
|
@@ -432,30 +477,40 @@ GPT_5_MINI_MODEL_CARD = {
|
|
|
432
477
|
"usd_per_input_token": 0.25 / 1e6,
|
|
433
478
|
"usd_per_output_token": 2.0 / 1e6,
|
|
434
479
|
##### Time #####
|
|
435
|
-
"seconds_per_output_token": 0.
|
|
480
|
+
"seconds_per_output_token": 0.0135,
|
|
436
481
|
##### Agg. Benchmark #####
|
|
437
482
|
"overall": 82.50,
|
|
438
483
|
}
|
|
439
|
-
|
|
484
|
+
GPT_5_NANO_MODEL_CARD = {
|
|
440
485
|
# NOTE: it is unclear if the same ($ / token) costs can be applied for vision, or if we have to calculate this ourselves
|
|
441
486
|
##### Cost in USD #####
|
|
442
|
-
"usd_per_input_token":
|
|
443
|
-
"usd_per_output_token":
|
|
487
|
+
"usd_per_input_token": 0.05 / 1e6,
|
|
488
|
+
"usd_per_output_token": 0.4 / 1e6,
|
|
444
489
|
##### Time #####
|
|
445
|
-
"seconds_per_output_token": 0.
|
|
490
|
+
"seconds_per_output_token": 0.0055,
|
|
446
491
|
##### Agg. Benchmark #####
|
|
447
|
-
"overall":
|
|
492
|
+
"overall": 77.9,
|
|
448
493
|
}
|
|
449
|
-
|
|
494
|
+
o4_MINI_MODEL_CARD = { # noqa: N816
|
|
450
495
|
# NOTE: it is unclear if the same ($ / token) costs can be applied for vision, or if we have to calculate this ourselves
|
|
451
496
|
##### Cost in USD #####
|
|
452
|
-
"usd_per_input_token":
|
|
453
|
-
"usd_per_output_token":
|
|
497
|
+
"usd_per_input_token": 1.1 / 1e6,
|
|
498
|
+
"usd_per_output_token": 4.4 / 1e6,
|
|
454
499
|
##### Time #####
|
|
455
|
-
"seconds_per_output_token": 0.
|
|
500
|
+
"seconds_per_output_token": 0.0092,
|
|
456
501
|
##### Agg. Benchmark #####
|
|
457
|
-
"overall":
|
|
502
|
+
"overall": 80.6, # using number reported for o3-mini; true number is likely higher
|
|
458
503
|
}
|
|
504
|
+
# o1_MODEL_CARD = { # noqa: N816
|
|
505
|
+
# # NOTE: it is unclear if the same ($ / token) costs can be applied for vision, or if we have to calculate this ourselves
|
|
506
|
+
# ##### Cost in USD #####
|
|
507
|
+
# "usd_per_input_token": 15 / 1e6,
|
|
508
|
+
# "usd_per_output_token": 60 / 1e6,
|
|
509
|
+
# ##### Time #####
|
|
510
|
+
# "seconds_per_output_token": 0.0110,
|
|
511
|
+
# ##### Agg. Benchmark #####
|
|
512
|
+
# "overall": 83.50,
|
|
513
|
+
# }
|
|
459
514
|
TEXT_EMBEDDING_3_SMALL_MODEL_CARD = {
|
|
460
515
|
##### Cost in USD #####
|
|
461
516
|
"usd_per_input_token": 0.02 / 1e6,
|
|
@@ -479,7 +534,7 @@ CLAUDE_3_5_SONNET_MODEL_CARD = {
|
|
|
479
534
|
"usd_per_input_token": 3.0 / 1e6,
|
|
480
535
|
"usd_per_output_token": 15.0 / 1e6,
|
|
481
536
|
##### Time #####
|
|
482
|
-
"seconds_per_output_token": 0.
|
|
537
|
+
"seconds_per_output_token": 0.0154,
|
|
483
538
|
##### Agg. Benchmark #####
|
|
484
539
|
"overall": 78.4,
|
|
485
540
|
}
|
|
@@ -488,7 +543,7 @@ CLAUDE_3_7_SONNET_MODEL_CARD = {
|
|
|
488
543
|
"usd_per_input_token": 3.0 / 1e6,
|
|
489
544
|
"usd_per_output_token": 15.0 / 1e6,
|
|
490
545
|
##### Time #####
|
|
491
|
-
"seconds_per_output_token": 0.
|
|
546
|
+
"seconds_per_output_token": 0.0156,
|
|
492
547
|
##### Agg. Benchmark #####
|
|
493
548
|
"overall": 80.7,
|
|
494
549
|
}
|
|
@@ -497,7 +552,7 @@ CLAUDE_3_5_HAIKU_MODEL_CARD = {
|
|
|
497
552
|
"usd_per_input_token": 0.8 / 1e6,
|
|
498
553
|
"usd_per_output_token": 4.0 / 1e6,
|
|
499
554
|
##### Time #####
|
|
500
|
-
"seconds_per_output_token": 0.
|
|
555
|
+
"seconds_per_output_token": 0.0189,
|
|
501
556
|
##### Agg. Benchmark #####
|
|
502
557
|
"overall": 64.1,
|
|
503
558
|
}
|
|
@@ -507,17 +562,27 @@ GEMINI_2_0_FLASH_MODEL_CARD = {
|
|
|
507
562
|
"usd_per_output_token": 0.6 / 1e6,
|
|
508
563
|
"usd_per_audio_input_token": 1.0 / 1e6,
|
|
509
564
|
##### Time #####
|
|
510
|
-
"seconds_per_output_token": 0.
|
|
565
|
+
"seconds_per_output_token": 0.0054,
|
|
511
566
|
##### Agg. Benchmark #####
|
|
512
567
|
"overall": 77.40,
|
|
513
568
|
}
|
|
569
|
+
GEMINI_2_5_FLASH_LITE_MODEL_CARD = {
|
|
570
|
+
##### Cost in USD #####
|
|
571
|
+
"usd_per_input_token": 0.1 / 1e6,
|
|
572
|
+
"usd_per_output_token": 0.4 / 1e6,
|
|
573
|
+
"usd_per_audio_input_token": 0.3 / 1e6,
|
|
574
|
+
##### Time #####
|
|
575
|
+
"seconds_per_output_token": 0.0034,
|
|
576
|
+
##### Agg. Benchmark #####
|
|
577
|
+
"overall": 79.1, # NOTE: interpolated between gemini 2.5 flash and gemini 2.0 flash
|
|
578
|
+
}
|
|
514
579
|
GEMINI_2_5_FLASH_MODEL_CARD = {
|
|
515
580
|
##### Cost in USD #####
|
|
516
581
|
"usd_per_input_token": 0.30 / 1e6,
|
|
517
582
|
"usd_per_output_token": 2.5 / 1e6,
|
|
518
583
|
"usd_per_audio_input_token": 1.0 / 1e6,
|
|
519
584
|
##### Time #####
|
|
520
|
-
"seconds_per_output_token": 0.
|
|
585
|
+
"seconds_per_output_token": 0.0044,
|
|
521
586
|
##### Agg. Benchmark #####
|
|
522
587
|
"overall": 80.75, # NOTE: interpolated between gemini 2.0 flash and gemini 2.5 pro
|
|
523
588
|
}
|
|
@@ -527,7 +592,7 @@ GEMINI_2_5_PRO_MODEL_CARD = {
|
|
|
527
592
|
"usd_per_output_token": 10.0 / 1e6,
|
|
528
593
|
"usd_per_audio_input_token": 1.25 / 1e6,
|
|
529
594
|
##### Time #####
|
|
530
|
-
"seconds_per_output_token": 0.
|
|
595
|
+
"seconds_per_output_token": 0.0072,
|
|
531
596
|
##### Agg. Benchmark #####
|
|
532
597
|
"overall": 84.10,
|
|
533
598
|
}
|
|
@@ -536,7 +601,7 @@ LLAMA_4_MAVERICK_MODEL_CARD = {
|
|
|
536
601
|
"usd_per_input_token": 0.35 / 1e6,
|
|
537
602
|
"usd_per_output_token": 1.15 / 1e6,
|
|
538
603
|
##### Time #####
|
|
539
|
-
"seconds_per_output_token": 0.
|
|
604
|
+
"seconds_per_output_token": 0.0122,
|
|
540
605
|
##### Agg. Benchmark #####
|
|
541
606
|
"overall": 79.4,
|
|
542
607
|
}
|
|
@@ -561,8 +626,12 @@ MODEL_CARDS = {
|
|
|
561
626
|
Model.GPT_4o_MINI.value: GPT_4o_MINI_MODEL_CARD,
|
|
562
627
|
Model.GPT_4o_AUDIO_PREVIEW.value: GPT_4o_AUDIO_PREVIEW_MODEL_CARD,
|
|
563
628
|
Model.GPT_4o_MINI_AUDIO_PREVIEW.value: GPT_4o_MINI_AUDIO_PREVIEW_MODEL_CARD,
|
|
629
|
+
Model.GPT_4_1.value: GPT_4_1_MODEL_CARD,
|
|
630
|
+
Model.GPT_4_1_MINI.value: GPT_4_1_MINI_MODEL_CARD,
|
|
631
|
+
Model.GPT_4_1_NANO.value: GPT_4_1_NANO_MODEL_CARD,
|
|
564
632
|
Model.GPT_5.value: GPT_5_MODEL_CARD,
|
|
565
633
|
Model.GPT_5_MINI.value: GPT_5_MINI_MODEL_CARD,
|
|
634
|
+
Model.GPT_5_NANO.value: GPT_5_NANO_MODEL_CARD,
|
|
566
635
|
Model.o4_MINI.value: o4_MINI_MODEL_CARD,
|
|
567
636
|
# Model.o1.value: o1_MODEL_CARD,
|
|
568
637
|
Model.TEXT_EMBEDDING_3_SMALL.value: TEXT_EMBEDDING_3_SMALL_MODEL_CARD,
|
|
@@ -573,6 +642,9 @@ MODEL_CARDS = {
|
|
|
573
642
|
Model.GEMINI_2_0_FLASH.value: GEMINI_2_0_FLASH_MODEL_CARD,
|
|
574
643
|
Model.GEMINI_2_5_FLASH.value: GEMINI_2_5_FLASH_MODEL_CARD,
|
|
575
644
|
Model.GEMINI_2_5_PRO.value: GEMINI_2_5_PRO_MODEL_CARD,
|
|
645
|
+
Model.GOOGLE_GEMINI_2_5_FLASH.value: GEMINI_2_5_FLASH_MODEL_CARD,
|
|
646
|
+
Model.GOOGLE_GEMINI_2_5_FLASH_LITE.value: GEMINI_2_5_FLASH_LITE_MODEL_CARD,
|
|
647
|
+
Model.GOOGLE_GEMINI_2_5_PRO.value: GEMINI_2_5_PRO_MODEL_CARD,
|
|
576
648
|
Model.LLAMA_4_MAVERICK.value: LLAMA_4_MAVERICK_MODEL_CARD,
|
|
577
649
|
Model.VLLM_QWEN_1_5_0_5B_CHAT.value: VLLM_QWEN_1_5_0_5B_CHAT_MODEL_CARD,
|
|
578
650
|
}
|
|
@@ -228,7 +228,7 @@ class Dataset:
|
|
|
228
228
|
id=self.id,
|
|
229
229
|
)
|
|
230
230
|
|
|
231
|
-
def sem_join(self, other: Dataset, condition: str, depends_on: str | list[str] | None = None) -> Dataset:
|
|
231
|
+
def sem_join(self, other: Dataset, condition: str, desc: str | None = None, depends_on: str | list[str] | None = None) -> Dataset:
|
|
232
232
|
"""
|
|
233
233
|
Perform a semantic (inner) join on the specified join predicate
|
|
234
234
|
"""
|
|
@@ -244,6 +244,7 @@ class Dataset:
|
|
|
244
244
|
input_schema=combined_schema,
|
|
245
245
|
output_schema=combined_schema,
|
|
246
246
|
condition=condition,
|
|
247
|
+
desc=desc,
|
|
247
248
|
depends_on=depends_on,
|
|
248
249
|
)
|
|
249
250
|
|
|
@@ -277,6 +278,7 @@ class Dataset:
|
|
|
277
278
|
def sem_filter(
|
|
278
279
|
self,
|
|
279
280
|
filter: str,
|
|
281
|
+
desc: str | None = None,
|
|
280
282
|
depends_on: str | list[str] | None = None,
|
|
281
283
|
) -> Dataset:
|
|
282
284
|
"""Add a natural language description of a filter to the Set. This filter will possibly restrict the items that are returned later."""
|
|
@@ -292,12 +294,13 @@ class Dataset:
|
|
|
292
294
|
depends_on = [depends_on]
|
|
293
295
|
|
|
294
296
|
# construct logical operator
|
|
295
|
-
operator = FilteredScan(input_schema=self.schema, output_schema=self.schema, filter=f, depends_on=depends_on)
|
|
297
|
+
operator = FilteredScan(input_schema=self.schema, output_schema=self.schema, filter=f, desc=desc, depends_on=depends_on)
|
|
296
298
|
|
|
297
299
|
return Dataset(sources=[self], operator=operator, schema=self.schema)
|
|
298
300
|
|
|
299
301
|
def _sem_map(self, cols: list[dict] | type[BaseModel] | None,
|
|
300
302
|
cardinality: Cardinality,
|
|
303
|
+
desc: str | None = None,
|
|
301
304
|
depends_on: str | list[str] | None = None) -> Dataset:
|
|
302
305
|
"""Execute the semantic map operation with the appropriate cardinality."""
|
|
303
306
|
# construct new output schema
|
|
@@ -322,6 +325,7 @@ class Dataset:
|
|
|
322
325
|
output_schema=new_output_schema,
|
|
323
326
|
cardinality=cardinality,
|
|
324
327
|
udf=None,
|
|
328
|
+
desc=desc,
|
|
325
329
|
depends_on=depends_on,
|
|
326
330
|
)
|
|
327
331
|
|
|
@@ -330,6 +334,7 @@ class Dataset:
|
|
|
330
334
|
|
|
331
335
|
def sem_add_columns(self, cols: list[dict] | type[BaseModel],
|
|
332
336
|
cardinality: Cardinality = Cardinality.ONE_TO_ONE,
|
|
337
|
+
desc: str | None = None,
|
|
333
338
|
depends_on: str | list[str] | None = None) -> Dataset:
|
|
334
339
|
"""
|
|
335
340
|
NOTE: we are renaming this function to `sem_map` and deprecating `sem_add_columns` in the next
|
|
@@ -354,9 +359,9 @@ class Dataset:
|
|
|
354
359
|
stacklevel=2
|
|
355
360
|
)
|
|
356
361
|
|
|
357
|
-
return self._sem_map(cols, cardinality, depends_on)
|
|
362
|
+
return self._sem_map(cols, cardinality, desc, depends_on)
|
|
358
363
|
|
|
359
|
-
def sem_map(self, cols: list[dict] | type[BaseModel], depends_on: str | list[str] | None = None) -> Dataset:
|
|
364
|
+
def sem_map(self, cols: list[dict] | type[BaseModel], desc: str | None = None, depends_on: str | list[str] | None = None) -> Dataset:
|
|
360
365
|
"""
|
|
361
366
|
Compute new field(s) by specifying their names, descriptions, and types. For each input there will
|
|
362
367
|
be one output. The field(s) will be computed during the execution of the Dataset.
|
|
@@ -368,9 +373,9 @@ class Dataset:
|
|
|
368
373
|
{'name': 'full_name', 'desc': 'The name of the person', 'type': str}]
|
|
369
374
|
)
|
|
370
375
|
"""
|
|
371
|
-
return self._sem_map(cols, Cardinality.ONE_TO_ONE, depends_on)
|
|
376
|
+
return self._sem_map(cols, Cardinality.ONE_TO_ONE, desc, depends_on)
|
|
372
377
|
|
|
373
|
-
def sem_flat_map(self, cols: list[dict] | type[BaseModel], depends_on: str | list[str] | None = None) -> Dataset:
|
|
378
|
+
def sem_flat_map(self, cols: list[dict] | type[BaseModel], desc: str | None = None, depends_on: str | list[str] | None = None) -> Dataset:
|
|
374
379
|
"""
|
|
375
380
|
Compute new field(s) by specifying their names, descriptions, and types. For each input there will
|
|
376
381
|
be one or more output(s). The field(s) will be computed during the execution of the Dataset.
|
|
@@ -384,7 +389,7 @@ class Dataset:
|
|
|
384
389
|
]
|
|
385
390
|
)
|
|
386
391
|
"""
|
|
387
|
-
return self._sem_map(cols, Cardinality.ONE_TO_MANY, depends_on)
|
|
392
|
+
return self._sem_map(cols, Cardinality.ONE_TO_MANY, desc, depends_on)
|
|
388
393
|
|
|
389
394
|
def _map(self, udf: Callable,
|
|
390
395
|
cols: list[dict] | type[BaseModel] | None,
|
|
@@ -590,7 +595,7 @@ class Dataset:
|
|
|
590
595
|
|
|
591
596
|
return QueryProcessorFactory.create_and_run_processor(self, config)
|
|
592
597
|
|
|
593
|
-
def optimize_and_run(self, train_dataset: dict[str, Dataset] | Dataset | None = None, validator: Validator | None = None,
|
|
598
|
+
def optimize_and_run(self, config: QueryProcessorConfig | None = None, train_dataset: dict[str, Dataset] | Dataset | None = None, validator: Validator | None = None, **kwargs):
|
|
594
599
|
"""Optimize the PZ program using the train_dataset and validator before running the optimized plan."""
|
|
595
600
|
# TODO: this import currently needs to be here to avoid a circular import; we should fix this in a subsequent PR
|
|
596
601
|
from palimpzest.query.processor.query_processor_factory import QueryProcessorFactory
|
|
@@ -53,7 +53,7 @@ ANSWER:
|
|
|
53
53
|
COT_QA_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
54
54
|
You will be presented with a context and a set of output fields to generate. Your task is to generate a JSON object which fills in the output fields with the correct values.
|
|
55
55
|
You will be provided with a description of each input field and each output field. All of the fields in the output JSON object can be derived using information from the context.
|
|
56
|
-
|
|
56
|
+
{desc_section}
|
|
57
57
|
{output_format_instruction} Finish your response with a newline character followed by ---
|
|
58
58
|
---
|
|
59
59
|
INPUT FIELDS:
|
|
@@ -72,7 +72,7 @@ REASONING: """
|
|
|
72
72
|
COT_QA_NO_REASONING_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
73
73
|
You will be presented with a context and a set of output fields to generate. Your task is to generate a JSON object which fills in the output fields with the correct values.
|
|
74
74
|
You will be provided with a description of each input field and each output field. All of the fields in the output JSON object can be derived using information from the context.
|
|
75
|
-
|
|
75
|
+
{desc_section}
|
|
76
76
|
{output_format_instruction} Finish your response with a newline character followed by ---
|
|
77
77
|
---
|
|
78
78
|
INPUT FIELDS:
|
|
@@ -45,7 +45,7 @@ ANSWER: TRUE
|
|
|
45
45
|
|
|
46
46
|
COT_BOOL_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
47
47
|
You will be presented with a context and a filter condition. Output TRUE if the context satisfies the filter condition, and FALSE otherwise.
|
|
48
|
-
|
|
48
|
+
{desc_section}
|
|
49
49
|
Remember, your answer must be TRUE or FALSE. Finish your response with a newline character followed by ---
|
|
50
50
|
---
|
|
51
51
|
INPUT FIELDS:
|
|
@@ -62,7 +62,7 @@ REASONING: """
|
|
|
62
62
|
|
|
63
63
|
COT_BOOL_NO_REASONING_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
64
64
|
You will be presented with a context and a filter condition. Output TRUE if the context satisfies the filter condition, and FALSE otherwise.
|
|
65
|
-
|
|
65
|
+
{desc_section}
|
|
66
66
|
Remember, your answer must be TRUE or FALSE. Finish your response with a newline character followed by ---
|
|
67
67
|
---
|
|
68
68
|
INPUT FIELDS:
|
|
@@ -57,7 +57,7 @@ ANSWER: TRUE
|
|
|
57
57
|
|
|
58
58
|
COT_JOIN_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
59
59
|
You will be presented with two data records and a join condition. Output TRUE if the two data records satisfy the join condition, and FALSE otherwise.
|
|
60
|
-
|
|
60
|
+
{desc_section}
|
|
61
61
|
Remember, your answer must be TRUE or FALSE. Finish your response with a newline character followed by ---
|
|
62
62
|
---
|
|
63
63
|
LEFT INPUT FIELDS:
|
|
@@ -80,7 +80,7 @@ REASONING: """
|
|
|
80
80
|
|
|
81
81
|
COT_JOIN_NO_REASONING_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
82
82
|
You will be presented with two data records and a join condition. Output TRUE if the two data records satisfy the join condition, and FALSE otherwise.
|
|
83
|
-
|
|
83
|
+
{desc_section}
|
|
84
84
|
Remember, your answer must be TRUE or FALSE. Finish your response with a newline character followed by ---
|
|
85
85
|
---
|
|
86
86
|
LEFT INPUT FIELDS:
|
{palimpzest-0.8.0 → palimpzest-0.8.2}/src/palimpzest/prompts/moa_proposer_convert_prompts.py
RENAMED
|
@@ -27,7 +27,7 @@ ANSWER: {example_answer}
|
|
|
27
27
|
COT_MOA_PROPOSER_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
28
28
|
You will be presented with a context and a set of output fields to generate. Your task is to generate a paragraph or two which describes what you believe is the correct value for each output field.
|
|
29
29
|
Be sure to cite information from the context as evidence of why your answers are correct. Do not hallucinate evidence.
|
|
30
|
-
|
|
30
|
+
{desc_section}
|
|
31
31
|
You will be provided with a description of each input field and each output field.
|
|
32
32
|
---
|
|
33
33
|
INPUT FIELDS:
|
|
@@ -138,6 +138,7 @@ from palimpzest.prompts.split_proposer_prompts import (
|
|
|
138
138
|
SPLIT_PROPOSER_JOB_INSTRUCTION,
|
|
139
139
|
)
|
|
140
140
|
from palimpzest.prompts.util_phrases import (
|
|
141
|
+
DESC_SECTION,
|
|
141
142
|
ONE_TO_MANY_OUTPUT_FORMAT_INSTRUCTION,
|
|
142
143
|
ONE_TO_ONE_OUTPUT_FORMAT_INSTRUCTION,
|
|
143
144
|
)
|
|
@@ -205,10 +206,11 @@ class PromptFactory:
|
|
|
205
206
|
PromptStrategy.SPLIT_MERGER: COT_SPLIT_MERGER_BASE_USER_PROMPT,
|
|
206
207
|
}
|
|
207
208
|
|
|
208
|
-
def __init__(self, prompt_strategy: PromptStrategy, model: Model, cardinality: Cardinality) -> None:
|
|
209
|
+
def __init__(self, prompt_strategy: PromptStrategy, model: Model, cardinality: Cardinality, desc: str | None = None) -> None:
|
|
209
210
|
self.prompt_strategy = prompt_strategy
|
|
210
211
|
self.model = model
|
|
211
212
|
self.cardinality = cardinality
|
|
213
|
+
self.desc = desc
|
|
212
214
|
|
|
213
215
|
def _get_context(self, candidate: DataRecord, input_fields: list[str]) -> str:
|
|
214
216
|
"""
|
|
@@ -446,6 +448,19 @@ class PromptFactory:
|
|
|
446
448
|
}
|
|
447
449
|
return prompt_strategy_to_job_instruction.get(self.prompt_strategy)
|
|
448
450
|
|
|
451
|
+
def _get_desc_section(self) -> str:
|
|
452
|
+
"""
|
|
453
|
+
Returns the description section for the prompt.
|
|
454
|
+
|
|
455
|
+
Returns:
|
|
456
|
+
str: The description section (if applicable).
|
|
457
|
+
"""
|
|
458
|
+
desc_section = ""
|
|
459
|
+
if self.desc is not None:
|
|
460
|
+
desc_section = DESC_SECTION.format(desc=self.desc)
|
|
461
|
+
|
|
462
|
+
return desc_section
|
|
463
|
+
|
|
449
464
|
def _get_critique_criteria(self) -> str | None:
|
|
450
465
|
"""
|
|
451
466
|
Returns the critique criteria for the critique operation.
|
|
@@ -758,6 +773,7 @@ class PromptFactory:
|
|
|
758
773
|
prompt_strategy_format_kwargs = {
|
|
759
774
|
"output_format_instruction": self._get_output_format_instruction(),
|
|
760
775
|
"job_instruction": self._get_job_instruction(),
|
|
776
|
+
"desc_section": self._get_desc_section(),
|
|
761
777
|
"critique_criteria": self._get_critique_criteria(),
|
|
762
778
|
"refinement_criteria": self._get_refinement_criteria(),
|
|
763
779
|
"finish_instruction": self._get_finish_instruction(),
|
|
@@ -27,7 +27,7 @@ ANSWER: {example_answer}
|
|
|
27
27
|
COT_SPLIT_PROPOSER_BASE_USER_PROMPT = """You are a helpful assistant whose job is to {job_instruction}.
|
|
28
28
|
You will be presented with a context and a set of output fields to generate. Your task is to generate a paragraph or two which describes what you believe is the correct value for each output field.
|
|
29
29
|
Be sure to cite information from the context as evidence of why your answers are correct. Do not hallucinate evidence.
|
|
30
|
-
|
|
30
|
+
{desc_section}
|
|
31
31
|
You will be provided with a description of each input field and each output field.
|
|
32
32
|
---
|
|
33
33
|
INPUT FIELDS:
|