diff --git a/libs/upstage/langchain_upstage/chat_models.py b/libs/upstage/langchain_upstage/chat_models.py index b30584b..d22ef6e 100644 --- a/libs/upstage/langchain_upstage/chat_models.py +++ b/libs/upstage/langchain_upstage/chat_models.py @@ -181,7 +181,9 @@ def get_token_ids(self, text: str) -> List[int]: encode = tokenizer.encode(text, add_special_tokens=False) return encode.ids - def get_num_tokens_from_messages(self, messages: List[BaseMessage]) -> int: + def get_num_tokens_from_messages( + self, messages: List[BaseMessage], tools: Sequence[Any] | None = None + ) -> int: """Calculate num tokens for solar model.""" tokenizer = self._get_tokenizer() tokens_per_message = 5 # <|im_start|>{role}\n{message}<|im_end|> @@ -270,9 +272,11 @@ def _parse_documents(self, file_path: str) -> str: document_contents = "Documents:\n" loader = UpstageDocumentParseLoader( - api_key=self.upstage_api_key.get_secret_value() - if self.upstage_api_key - else None, + api_key=( + self.upstage_api_key.get_secret_value() + if self.upstage_api_key + else None + ), file_path=file_path, output_format="text", coordinates=False, diff --git a/libs/upstage/poetry.lock b/libs/upstage/poetry.lock index 62f804c..6baad91 100644 --- a/libs/upstage/poetry.lock +++ b/libs/upstage/poetry.lock @@ -511,25 +511,25 @@ files = [ [[package]] name = "langchain-core" -version = "0.3.0" +version = "0.3.18" description = "Building applications with LLMs through composability" optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "langchain_core-0.3.0-py3-none-any.whl", hash = "sha256:bee6dae2366d037ef0c5b87401fed14b5497cad26f97724e8c9ca7bc9239e847"}, - {file = "langchain_core-0.3.0.tar.gz", hash = "sha256:1249149ea3ba24c9c761011483c14091573a5eb1a773aa0db9c8ad155dd4a69d"}, + {file = "langchain_core-0.3.18-py3-none-any.whl", hash = "sha256:c38bb198152082e76859402bfff08f785ac66bcfd44c04d132708e16ee5f999c"}, + {file = "langchain_core-0.3.18.tar.gz", hash = "sha256:a14e9b9c0525b6fc9a7e4fe7f54a48b272d91ea855b1b081b364fabb966ae7af"}, ] [package.dependencies] jsonpatch = ">=1.33,<2.0" -langsmith = ">=0.1.117,<0.2.0" +langsmith = ">=0.1.125,<0.2.0" packaging = ">=23.2,<25" pydantic = [ {version = ">=2.5.2,<3.0.0", markers = "python_full_version < \"3.12.4\""}, {version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""}, ] PyYAML = ">=5.3" -tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0" +tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<10.0.0" typing-extensions = ">=4.7" [[package]] @@ -549,36 +549,31 @@ openai = ">=1.40.0,<2.0.0" tiktoken = ">=0.7,<1" [[package]] -name = "langchain-standard-tests" -version = "0.1.1" +name = "langchain-tests" +version = "0.3.0" description = "Standard tests for LangChain implementations" optional = false -python-versions = ">=3.9,<4.0" -files = [] -develop = false +python-versions = "<4.0,>=3.9" +files = [ + {file = "langchain_tests-0.3.0-py3-none-any.whl", hash = "sha256:a78ff631a7f3ea1e448d6c926c6c6ea33b4d8ec2b8cbf2e6e2904a9f02273b82"}, + {file = "langchain_tests-0.3.0.tar.gz", hash = "sha256:e30655bf284f2e5ebc961842e0c7c158af6b3b6fda392dcc99b73c35a0f2b7f3"}, +] [package.dependencies] -httpx = "^0.27.0" -langchain-core = "^0.3.0" +httpx = ">=0.27.0,<0.28.0" +langchain-core = ">=0.3.15,<0.4.0" pytest = ">=7,<9" -syrupy = "^4" - -[package.source] -type = "git" -url = "https://github.com/langchain-ai/langchain.git" -reference = "HEAD" -resolved_reference = "a319a0ff1d17057d750f7e4a8fee98aa8f68703c" -subdirectory = "libs/standard-tests" +syrupy = ">=4,<5" [[package]] name = "langsmith" -version = "0.1.118" +version = "0.1.143" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = "<4.0,>=3.8.1" files = [ - {file = "langsmith-0.1.118-py3-none-any.whl", hash = "sha256:f017127b3efb037da5e46ff4f8583e8192e7955191737240c327f3eadc144d7c"}, - {file = "langsmith-0.1.118.tar.gz", hash = "sha256:ff1ca06c92c6081250244ebbce5d0bb347b9d898d2e9b60a13b11f0f0720f09f"}, + {file = "langsmith-0.1.143-py3-none-any.whl", hash = "sha256:ba0d827269e9b03a90fababe41fa3e4e3f833300b95add10184f7e67167dde6f"}, + {file = "langsmith-0.1.143.tar.gz", hash = "sha256:4c5159e5cd84b3f8499433009e72d2076dd2daf6c044ac8a3611b30d0d0161c5"}, ] [package.dependencies] @@ -589,6 +584,7 @@ pydantic = [ {version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""}, ] requests = ">=2,<3" +requests-toolbelt = ">=1.0.0,<2.0.0" [[package]] name = "markdown-it-py" @@ -1356,6 +1352,20 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "requests-toolbelt" +version = "1.0.0" +description = "A utility belt for advanced users of python-requests" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6"}, + {file = "requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06"}, +] + +[package.dependencies] +requests = ">=2.0.1,<3.0.0" + [[package]] name = "rich" version = "13.8.0" @@ -1753,4 +1763,4 @@ watchmedo = ["PyYAML (>=3.10)"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "d0f7ad6729f3366f4a157c74d851b27452f8f2476f77698f1f957193711a9ab7" +content-hash = "c1dee7a27555b314a2bec36826904099b2b282818c1130c3190880a472597378" diff --git a/libs/upstage/pyproject.toml b/libs/upstage/pyproject.toml index 45b39e1..966ceed 100644 --- a/libs/upstage/pyproject.toml +++ b/libs/upstage/pyproject.toml @@ -32,7 +32,7 @@ syrupy = "^4.0.2" pytest-watcher = "^0.3.4" pytest-asyncio = "^0.21.1" docarray = "^0.32.1" -langchain-standard-tests = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/standard-tests" } +langchain-tests = "0.3.0" [tool.poetry.group.codespell] optional = true