Skip to content

Conversation

schloerke
Copy link
Collaborator

@schloerke schloerke commented Sep 20, 2024

langchain_core was updated to 0.3.2 on Sep 19th, and errors started popping up on Sept 20th

Error being seen in CI:

=================================== FAILURES ===================================
__________________________ test_as_langchain_message ___________________________
[gw0] linux -- Python 3.12.6 /opt/hostedtoolcache/Python/3.12.6/x64/bin/python3

    def test_as_langchain_message():
        from langchain_core.language_models.base import LanguageModelInput
        from langchain_core.language_models.chat_models import BaseChatModel
        from langchain_core.messages import (
            AIMessage,
            BaseMessage,
            HumanMessage,
            MessageLikeRepresentation,
            SystemMessage,
        )
    
        from shiny.ui._chat_provider_types import as_langchain_message
    
        assert BaseChatModel.invoke.__annotations__["input"] == "LanguageModelInput"
        assert BaseChatModel.stream.__annotations__["input"] == "LanguageModelInput"
    
>       assert is_type_in_union(Sequence[MessageLikeRepresentation], LanguageModelInput)
E       assert False
E        +  where False = is_type_in_union(typing.Sequence[typing.Union[langchain_core.messages.base.BaseMessage, list[str], tuple[str, str], str, dict[str, typing.Any]]], typing.Union[langchain_core.prompt_values.PromptValue, str, collections.abc.Sequence[typing.Union[langchain_core.messages.base.BaseMessage, list[str], tuple[str, str], str, dict[str, typing.Any]]]])

@schloerke
Copy link
Collaborator Author

@schloerke schloerke changed the title [WIP] Fix langchain_core version chore: Fix langchain_core test that used a new Sequence type Sep 20, 2024
@schloerke
Copy link
Collaborator Author

Reviewed in person with @karangattu

@schloerke schloerke enabled auto-merge (squash) September 20, 2024 16:24
@schloerke schloerke merged commit 4f5b666 into main Sep 20, 2024
48 checks passed
@schloerke schloerke deleted the langchange_update branch September 20, 2024 16:48
schloerke added a commit to machow/py-shiny that referenced this pull request Sep 23, 2024
* main:
  chore: Fix `langchain_core` test that used a new `Sequence` type (posit-dev#1697)
  tests(input_slider): add kitchensink tests for input_slider (posit-dev#1691)
  chore: More minor type changes in prep for py-htmltools updates (posit-dev#1693)
  chore: Add types and check action for py-htmltools (posit-dev#1692)
  Anticipate `htmltools.HTML` no longer inheriting from `str` (posit-dev#1690)
  tests(input_select): Add kitchensink tests for input_select and input_selectize (posit-dev#1686)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant