File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
topic/machine-learning/llm-langchain Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 66
66
},
67
67
"outputs" : [],
68
68
"source" : [
69
+ " import requests\n " ,
69
70
" from cratedb_toolkit.util import DatabaseAdapter\n " ,
70
- " from pueblo.io import to_io\n " ,
71
71
" \n " ,
72
72
" \n " ,
73
73
" def import_mlb_teams_2012():\n " ,
78
78
" \"\"\"\n " ,
79
79
" cratedb = DatabaseAdapter(dburi=CONNECTION_STRING)\n " ,
80
80
" 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 " ,
83
83
" cratedb.refresh_table(\" mlb_teams_2012\" )\n " ,
84
84
" \n " ,
85
85
" \n " ,
Original file line number Diff line number Diff line change 26
26
"""
27
27
import os
28
28
29
+ import requests
29
30
from cratedb_toolkit .util import DatabaseAdapter
30
31
from langchain .document_loaders import CrateDBLoader
31
- from pueblo .io import to_io
32
32
from pprint import pprint
33
33
34
34
@@ -46,8 +46,8 @@ def import_mlb_teams_2012():
46
46
"""
47
47
cratedb = DatabaseAdapter (dburi = CONNECTION_STRING )
48
48
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 )
51
51
cratedb .refresh_table ("mlb_teams_2012" )
52
52
53
53
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ cratedb-toolkit==0.0.10
6
6
# langchain[cratedb,openai]==0.0.354
7
7
# langchain-community==0.0.8
8
8
langchain-openai == 0.0.6
9
- pueblo [cli,fileio, nlp ]>= 0.0.7
9
+ pueblo [cli,nlp ]>= 0.0.7
10
10
pydantic >= 1 ,< 3
11
11
pypdf < 5
12
12
python-dotenv < 2
13
+ requests < 3
13
14
requests-cache < 2
14
15
sqlalchemy == 2.*
15
16
unstructured < 0.12
You can’t perform that action at this time.
0 commit comments