Skip to content

Commit e13b437

Browse files
committed
LLM: Get rid of dependency to pueblo[fileio]
1 parent 8328f99 commit e13b437

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

topic/machine-learning/llm-langchain/document_loader.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
},
6767
"outputs": [],
6868
"source": [
69+
"import requests\n",
6970
"from cratedb_toolkit.util import DatabaseAdapter\n",
70-
"from pueblo.io import to_io\n",
7171
"\n",
7272
"\n",
7373
"def import_mlb_teams_2012():\n",
@@ -78,8 +78,8 @@
7878
" \"\"\"\n",
7979
" cratedb = DatabaseAdapter(dburi=CONNECTION_STRING)\n",
8080
" url = \"https://github.com/crate-workbench/langchain/raw/cratedb/docs/docs/integrations/document_loaders/example_data/mlb_teams_2012.sql\"\n",
81-
" with to_io(url) as fp:\n",
82-
" cratedb.run_sql(fp.read())\n",
81+
" sql = requests.get(url).text\n",
82+
" cratedb.run_sql(sql)\n",
8383
" cratedb.refresh_table(\"mlb_teams_2012\")\n",
8484
"\n",
8585
"\n",

topic/machine-learning/llm-langchain/document_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"""
2727
import os
2828

29+
import requests
2930
from cratedb_toolkit.util import DatabaseAdapter
3031
from langchain.document_loaders import CrateDBLoader
31-
from pueblo.io import to_io
3232
from pprint import pprint
3333

3434

@@ -46,8 +46,8 @@ def import_mlb_teams_2012():
4646
"""
4747
cratedb = DatabaseAdapter(dburi=CONNECTION_STRING)
4848
url = "https://github.com/crate-workbench/langchain/raw/cratedb/docs/docs/integrations/document_loaders/example_data/mlb_teams_2012.sql"
49-
with to_io(url) as fp:
50-
cratedb.run_sql(fp.read())
49+
sql = requests.get(url).text
50+
cratedb.run_sql(sql)
5151
cratedb.refresh_table("mlb_teams_2012")
5252

5353

topic/machine-learning/llm-langchain/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ cratedb-toolkit==0.0.10
66
# langchain[cratedb,openai]==0.0.354
77
# langchain-community==0.0.8
88
langchain-openai==0.0.6
9-
pueblo[cli,fileio,nlp]>=0.0.7
9+
pueblo[cli,nlp]>=0.0.7
1010
pydantic>=1,<3
1111
pypdf<5
1212
python-dotenv<2
13+
requests<3
1314
requests-cache<2
1415
sqlalchemy==2.*
1516
unstructured<0.12

0 commit comments

Comments
 (0)