-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing ingredients/builtin/dt directory
- Loading branch information
Showing
18 changed files
with
25 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |