From ed3d92e1e7f96924263b33f7f1cd52ad7e489663 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 10 Jun 2024 07:21:39 +0200 Subject: [PATCH] Depend on `pydantic` directly instead of `langchain` (#48) --- packages/jupyterlab-ws-chat/jupyterlab_ws_chat/handlers.py | 2 +- packages/jupyterlab-ws-chat/jupyterlab_ws_chat/models.py | 2 +- packages/jupyterlab-ws-chat/pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/handlers.py b/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/handlers.py index 537ab9f..fd953ba 100644 --- a/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/handlers.py +++ b/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/handlers.py @@ -8,7 +8,7 @@ from typing import Dict, List from jupyter_server.base.handlers import APIHandler as BaseAPIHandler, JupyterHandler -from langchain.pydantic_v1 import ValidationError +from pydantic.v1 import ValidationError from tornado import web, websocket from .config_manager import WriteConflictError diff --git a/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/models.py b/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/models.py index 384a48e..8df9781 100644 --- a/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/models.py +++ b/packages/jupyterlab-ws-chat/jupyterlab_ws_chat/models.py @@ -3,7 +3,7 @@ from typing import Any, Dict, List, Literal, Optional, Union -from langchain.pydantic_v1 import BaseModel, validator +from pydantic.v1 import BaseModel, validator DEFAULT_CHUNK_SIZE = 2000 DEFAULT_CHUNK_OVERLAP = 100 diff --git a/packages/jupyterlab-ws-chat/pyproject.toml b/packages/jupyterlab-ws-chat/pyproject.toml index 119908f..e099bbc 100644 --- a/packages/jupyterlab-ws-chat/pyproject.toml +++ b/packages/jupyterlab-ws-chat/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "jupyterlab~=4.0", "traitlets>=5.0", "deepmerge>=1.0", - "langchain" + "pydantic>=2" ] dynamic = ["version", "description", "authors", "urls", "keywords"]