Skip to content
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

Fixes typos in example requirements #892

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
langchain
langchain-core
openai
pandas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"outputs": [],
"source": [
"# install the required packages to run this notebook\n",
"!pip install sf-hamilton[visualization] openai langchain-core requests pandas"
"!pip install sf-hamilton[visualization] openai langchain langchain-core requests pandas"
]
},
{
Expand Down Expand Up @@ -67,6 +67,18 @@
"%load_ext hamilton.plugins.jupyter_magic"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b89918ab-bd76-4d2f-b8f4-12adaeec004e",
"metadata": {},
"outputs": [],
"source": [
"# set OPENAI_API_KEY if you haven't\n",
"import os\n",
"os.environ[\"OPENAI_API_KEY\"] = \"MY_KEY\""
]
},
{
"cell_type": "markdown",
"id": "24b928ed-275f-47f2-966c-272aef88dcae",
Expand Down Expand Up @@ -770,6 +782,8 @@
" client: openai.OpenAI,\n",
") -> Document:\n",
" \"\"\"This function takes in a list of documents and outputs a list of documents with embeddings.\n",
"\n",
" This assumes you have OPENAI_API_KEY in your environment. If not, set it.\n",
" \"\"\"\n",
" for idx, chunk in enumerate(chunked_document.chunks): \n",
" response = client.embeddings.create(input=chunk.text, \n",
Expand Down