Skip to content

Commit

Permalink
wip: debug and fix thanks to @JasonWeill in jupyterlab/jupyter-ai#746
Browse files Browse the repository at this point in the history
  • Loading branch information
jaanli committed Apr 26, 2024
1 parent f38a3db commit e9c8662
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 33 deletions.
56 changes: 28 additions & 28 deletions notebooks/getting-started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "18fbede1-a82a-4929-938e-25cf18d160f7",
"metadata": {},
"outputs": [],
Expand All @@ -55,7 +55,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "945fb6ae-e03c-4670-8210-cae493757ee6",
"metadata": {},
"outputs": [],
Expand All @@ -65,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "42d67f40-462b-43ba-a63f-fdd9e126a423",
"metadata": {},
"outputs": [],
Expand All @@ -85,45 +85,45 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"id": "9ae14480-b195-4686-9c80-70654bccfd24",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/me/jaanli/language-model-notebooks/.venv/lib/python3.12/site-packages/langchain_anthropic/llms.py:164: UserWarning: This Anthropic LLM is deprecated. Please use `from langchain_anthropic import ChatAnthropic` instead\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/markdown": [
"Cannot determine model provider from model ID `anthropic:claude-v1.2`.\n",
"\n",
"To see a list of models you can use, run `%ai list`\n",
"\n",
"If you were trying to run a command, run `%ai help` to see a list of commands."
"text/html": [
"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\"> \n",
" <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" style=\"stroke:black;fill:white;\"/> \n",
"</svg>"
],
"text/plain": [
"Cannot determine model provider from model ID 'anthropic:claude-v1.2'.\n",
"\n",
"To see a list of models you can use, run '%ai list'\n",
"\n",
"If you were trying to run a command, run '%ai help' to see a list of commands."
"<IPython.core.display.HTML object>"
]
},
"execution_count": 8,
"metadata": {},
"execution_count": 7,
"metadata": {
"text/html": {
"jupyter_ai": {
"model_id": "claude-v1.2",
"provider_id": "anthropic"
}
}
},
"output_type": "execute_result"
}
],
"source": [
"%%ai anthropic:claude-v1.2\n",
"\n",
"Test"
"%%ai anthropic:claude-v1.2 -f html\n",
"Create a square using SVG with a black border and white fill."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8e36a7e9-edfd-4379-b8f8-0bd6654b0d3c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
3 changes: 2 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jupyter-ai
jupyterlab
python-dotenv
python-dotenv
langchain-anthropic
39 changes: 35 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile
Expand All @@ -14,8 +14,11 @@ aiosqlite==0.20.0
# via jupyter-ai
annotated-types==0.6.0
# via pydantic
anthropic==0.25.6
# via langchain-anthropic
anyio==4.3.0
# via
# anthropic
# httpx
# jupyter-server
appnope==0.1.4
Expand Down Expand Up @@ -76,29 +79,41 @@ decorator==5.1.1
deepmerge==1.1.1
# via jupyter-ai
defusedxml==0.7.1
# via nbconvert
# via
# langchain-anthropic
# nbconvert
distributed==2024.4.2
# via dask
distro==1.9.0
# via anthropic
executing==2.0.1
# via stack-data
faiss-cpu==1.8.0
# via jupyter-ai
fastjsonschema==2.19.1
# via nbformat
filelock==3.13.4
# via huggingface-hub
fqdn==1.5.1
# via jsonschema
frozenlist==1.4.1
# via
# aiohttp
# aiosignal
fsspec==2024.3.1
# via dask
# via
# dask
# huggingface-hub
h11==0.14.0
# via httpcore
httpcore==1.0.5
# via httpx
httpx==0.27.0
# via jupyterlab
# via
# anthropic
# jupyterlab
huggingface-hub==0.22.2
# via tokenizers
idna==3.7
# via
# anyio
Expand All @@ -108,6 +123,7 @@ idna==3.7
# yarl
importlib-metadata==7.1.0
# via
# dask
# jupyter-ai
# jupyter-ai-magics
ipykernel==6.29.4
Expand Down Expand Up @@ -187,11 +203,14 @@ jupyterlab-server==2.27.1
# via jupyterlab
langchain==0.1.16
# via jupyter-ai-magics
langchain-anthropic==0.1.11
# via -r requirements.in
langchain-community==0.0.34
# via langchain
langchain-core==0.1.45
# via
# langchain
# langchain-anthropic
# langchain-community
# langchain-text-splitters
langchain-text-splitters==0.0.1
Expand Down Expand Up @@ -251,6 +270,7 @@ packaging==23.2
# via
# dask
# distributed
# huggingface-hub
# ipykernel
# jupyter-server
# jupyterlab
Expand Down Expand Up @@ -288,6 +308,7 @@ pycparser==2.22
# via cffi
pydantic==2.7.1
# via
# anthropic
# langchain
# langchain-core
# langsmith
Expand All @@ -309,6 +330,7 @@ pyyaml==6.0.1
# via
# dask
# distributed
# huggingface-hub
# jupyter-events
# langchain
# langchain-community
Expand All @@ -325,6 +347,7 @@ referencing==0.35.0
# jupyter-events
requests==2.31.0
# via
# huggingface-hub
# jupyterlab-server
# langchain
# langchain-community
Expand All @@ -351,6 +374,7 @@ six==1.16.0
# rfc3339-validator
sniffio==1.3.1
# via
# anthropic
# anyio
# httpx
sortedcontainers==2.4.0
Expand All @@ -376,6 +400,8 @@ terminado==0.18.1
# jupyter-server-terminals
tinycss2==1.3.0
# via nbconvert
tokenizers==0.19.1
# via anthropic
toolz==0.12.1
# via
# dask
Expand All @@ -389,6 +415,8 @@ tornado==6.4
# jupyter-server
# jupyterlab
# terminado
tqdm==4.66.2
# via huggingface-hub
traitlets==5.14.3
# via
# comm
Expand All @@ -409,6 +437,9 @@ types-python-dateutil==2.9.0.20240316
typing-extensions==4.11.0
# via
# aiosqlite
# anthropic
# huggingface-hub
# ipython
# jupyter-ai
# jupyter-ai-magics
# pydantic
Expand Down

0 comments on commit e9c8662

Please sign in to comment.