Skip to content

Commit

Permalink
Removing ingredients/builtin/dt directory
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed May 13, 2024
1 parent b96415b commit 24f0796
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 256 deletions.
3 changes: 1 addition & 2 deletions blendsql/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__version__ = "0.0.141"


from .ingredients.builtin import LLMMap, LLMQA, LLMJoin, DT, LLMValidate
from .ingredients.builtin import LLMMap, LLMQA, LLMJoin, LLMValidate
from .blend import blend
from .nl_to_blendsql import nl_to_blendsql
2 changes: 1 addition & 1 deletion blendsql/db/_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PostgreSQL(Database):
def __init__(self, db_path: str):
if not _has_psycopg2:
raise ImportError(
"Please install psycopg2 with `pip install psycopg2`!"
"Please install psycopg2 with `pip install psycopg2-binary`!"
) from None
super().__init__(db_path=db_path, db_prefix="postgresql+psycopg2://")

Expand Down
2 changes: 1 addition & 1 deletion blendsql/ingredients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
IngredientException,
)

from .builtin import LLMQA, LLMJoin, LLMMap, LLMValidate, DT
from .builtin import LLMQA, LLMJoin, LLMMap, LLMValidate
9 changes: 4 additions & 5 deletions blendsql/ingredients/builtin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from .dt.main import DT
from .llm.map.main import LLMMap
from .llm.qa.main import LLMQA
from .llm.join.main import LLMJoin
from .llm.validate.main import LLMValidate
from .join.main import LLMJoin
from .qa.main import LLMQA
from .map.main import LLMMap
from .validate.main import LLMValidate
26 changes: 0 additions & 26 deletions blendsql/ingredients/builtin/dt/main.py

This file was deleted.

149 changes: 0 additions & 149 deletions blendsql/ingredients/builtin/dt/utils.py

This file was deleted.

File renamed without changes.
File renamed without changes.
Empty file.
37 changes: 0 additions & 37 deletions blendsql/ingredients/builtin/llm/utils.py

This file was deleted.

Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 18 additions & 35 deletions research/run-debug.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,28 @@
from blendsql import blend
from blendsql import blend, LLMJoin
from blendsql.db import SQLite
from blendsql.utils import tabulate, fetch_from_hub
from dotenv import load_dotenv
from tests.utils import (
starts_with,
get_length,
select_first_sorted,
do_join,
return_aapl,
get_table_size,
)
from blendsql.models import OpenaiLLM
from blendsql.utils import fetch_from_hub, tabulate

load_dotenv()
if __name__ == "__main__":
blendsql = """
SELECT Symbol FROM (
SELECT DISTINCT Symbol FROM portfolio WHERE Symbol IN (
SELECT Symbol FROM portfolio WHERE Quantity > 200
SELECT date, rival, score, documents.content AS "Team Description" FROM w
JOIN {{
LLMJoin(
left_on='documents::title',
right_on='w::rival'
)
) AS w WHERE {{starts_with('F', 'w::Symbol')}} = TRUE AND LENGTH(w.Symbol) > 3
}} WHERE rival = 'nsw waratahs'
"""
# db = PostgreSQL("localhost:5432/mydb")
db = SQLite(fetch_from_hub("multi_table.db"))
# Make our smoothie - the executed BlendSQL script
smoothie = blend(
query=blendsql,
db=db,
ingredients={
starts_with,
get_length,
select_first_sorted,
do_join,
return_aapl,
get_table_size,
},
verbose=True,
# blender=TransformersLLM("Qwen/Qwen1.5-0.5B"),
schema_qualify=False,
db=SQLite(
fetch_from_hub("1884_New_Zealand_rugby_union_tour_of_New_South_Wales_1.db")
),
blender=OpenaiLLM("gpt-3.5-turbo"),
ingredients={LLMJoin},
)
print("--------------------------------------------------")
print("ANSWER:")
print(tabulate(smoothie.df))
print("--------------------------------------------------")
print(smoothie.meta.num_values_passed)
print(smoothie.meta.prompts)
import json

print(json.dumps(smoothie.meta.prompts, indent=4))

0 comments on commit 24f0796

Please sign in to comment.