Smoothie
Smoothie
The Smoothie
object defines the output of an executed BlendSQL script.
Source code in blendsql/_smoothie.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 | @dataclass
class Smoothie:
df: pd.DataFrame
meta: SmoothieMeta
def __post_init__(self):
self.df = PrettyDataFrame(self.df)
def summary(self):
s = "-------------------------------- SUMMARY --------------------------------\n"
s += self.meta.query + "\n"
s += tabulate(
pd.DataFrame(
{
"Time (s)": self.meta.process_time_seconds,
"# Generation Calls": self.meta.num_generation_calls,
"Prompt Tokens": self.meta.prompt_tokens,
"Completion Tokens": self.meta.completion_tokens,
},
index=[0],
)
)
return s
|
Source code in blendsql/_smoothie.py
18
19
20
21
22
23
24
25
26
27
28
29
30 | @dataclass
class SmoothieMeta:
num_values_passed: int # Number of values passed to a Map/Join/QA ingredient
num_generation_calls: int # Number of generation calls made to the model
prompt_tokens: int
completion_tokens: int
prompts: List[dict] # Log of prompts submitted to model
raw_prompts: List[str]
ingredients: Iterable[Type[Ingredient]]
query: str
db_url: str
contains_ingredient: bool = True
process_time_seconds: float = field(init=False)
|