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

fix dependencies skip standard test #23

Merged
merged 1 commit into from
Sep 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
10 changes: 10 additions & 0 deletions libs/upstage/langchain_upstage/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Literal,
Optional,
Sequence,
Tuple,
Type,
Union,
overload,
Expand Down Expand Up @@ -194,6 +195,15 @@ def get_num_tokens_from_messages(self, messages: List[BaseMessage]) -> int:
num_tokens += tokens_suffix
return num_tokens

def _create_message_dicts(
self, messages: List[BaseMessage], stop: Optional[List[str]]
) -> Tuple[List[Dict[str, Any]], Dict[str, Any]]:
params = self._default_params
if stop is not None:
params["stop"] = stop
message_dicts = [_convert_message_to_dict(m) for m in messages]
return message_dicts, params

def _generate(
self,
messages: List[BaseMessage],
Expand Down
23 changes: 14 additions & 9 deletions libs/upstage/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions libs/upstage/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license = "MIT"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain-core = ">=0.2.2,<0.3"
langchain-openai = "0.1.13"
langchain-openai = "0.1.23"
pypdf = "^4.2.0"
requests = "^2.31.0"
tokenizers = "^0.19.1"
Expand All @@ -32,7 +32,7 @@ pytest-mock = "^3.10.0"
syrupy = "^4.0.2"
pytest-watcher = "^0.3.4"
pytest-asyncio = "^0.21.1"
langchain-openai = "0.1.13"
langchain-openai = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/partners/openai" }
langchain-core = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core" }
docarray = "^0.32.1"
langchain-standard-tests = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/standard-tests" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

from typing import Type

import pytest
from langchain_core.language_models import BaseChatModel
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests

from langchain_upstage import ChatUpstage


@pytest.mark.skip("fix after following openai spec")
class TestUpstageStandard(ChatModelIntegrationTests):
@property
def chat_model_class(self) -> Type[BaseChatModel]:
Expand Down
Loading