-
Notifications
You must be signed in to change notification settings - Fork 9
[LangChain] Add example programs and notebooks #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
"from pprint import pprint\n", | ||
"\n", | ||
"CONNECTION_STRING = \"crate://crate@localhost/?schema=notebook\"\n", | ||
"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the schema in the connection string? For me, it causes a failure on the SELECT
statement below, because mlb_teams_2012? is apparently created in the
doc` schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6779392 should fix that flaw. I would like to use it, in order to educate people about it.
framework/langchain/readme.md
Outdated
|
||
### CrateDB Cloud | ||
|
||
Todo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo. | |
Sign up or log in to [CrateDB Cloud](https://console.cratedb.cloud) and create a free tier cluster. Within just a few minutes, you will have a cloud-based development environment. As soon as your project scales, you can easily move to a different cluster tier or scale horizontally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
cc2943c
to
1965489
Compare
8fd2d10
to
dbf3dab
Compare
Within the README, there are now badges to open the Jupyter Notebooks on GitHub, on Binder, and on Google Colab. See LangChain and CrateDB » What's inside. |
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Overwriting a vector store\n", | ||
"\n", | ||
"If you have an existing collection, you can overwrite it by using `from_documents`,\n", | ||
"aad setting `pre_delete_collection = True`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"db = CrateDBVectorSearch.from_documents(\n", | ||
" documents=docs,\n", | ||
" embedding=embeddings,\n", | ||
" collection_name=COLLECTION_NAME,\n", | ||
" connection_string=CONNECTION_STRING,\n", | ||
" pre_delete_collection=True,\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"docs_with_score = db.similarity_search_with_score(\"foo\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"docs_with_score[0]" | ||
] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am observing problems here. It is probably related to the other report by @ckurze.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding software tests will help to keep our sanity.
7cf13da
to
cd92557
Compare
f43c9f5
to
f5546bf
Compare
cd92557
to
cd9b202
Compare
About
We have been looking into making LangChain work together with CrateDB. This patch adds corresponding example programs and Jupyter Notebooks.
Preview
Readme, rendered by GitHub: LangChain and CrateDB
Backlog
both the basic example programs, and the Jupyter Notebooks.
/cc @marijaselakovic, @hammerhead, @seut, @ckurze