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 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 " ,
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 " ,
Original file line number Diff line number Diff line change 2626"""
2727import os
2828
29+ import requests
2930from cratedb_toolkit .util import DatabaseAdapter
3031from langchain .document_loaders import CrateDBLoader
31- from pueblo .io import to_io
3232from 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
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ cratedb-toolkit==0.0.10
66# langchain[cratedb,openai]==0.0.354
77# langchain-community==0.0.8
88langchain-openai == 0.0.6
9- pueblo [cli,fileio, nlp ]>= 0.0.7
9+ pueblo [cli,nlp ]>= 0.0.7
1010pydantic >= 1 ,< 3
1111pypdf < 5
1212python-dotenv < 2
13+ requests < 3
1314requests-cache < 2
1415sqlalchemy == 2.*
1516unstructured < 0.12
You can’t perform that action at this time.
0 commit comments