mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 21:47:12 +00:00
core[patch]: Int Combine when Merging Dicts (#31572)
- **Description:** Combining the Int Types by adding them which makes the most sense. - **Issue:** #31565
This commit is contained in:
committed by
GitHub
parent
6a5073b227
commit
b26d2250ba
@@ -9,6 +9,7 @@ import pytest
|
||||
from pydantic import SecretStr
|
||||
|
||||
from langchain_core import utils
|
||||
from langchain_core.outputs import GenerationChunk
|
||||
from langchain_core.utils import (
|
||||
check_package_version,
|
||||
from_env,
|
||||
@@ -375,3 +376,10 @@ def test_using_secret_from_env_as_default_factory(
|
||||
|
||||
with pytest.raises(ValueError, match="Did not find FOOFOOFOOBAR"):
|
||||
OhMy()
|
||||
|
||||
|
||||
def test_generation_chunk_addition_type_error() -> None:
|
||||
chunk1 = GenerationChunk(text="", generation_info={"len": 0})
|
||||
chunk2 = GenerationChunk(text="Non-empty text", generation_info={"len": 14})
|
||||
result = chunk1 + chunk2
|
||||
assert result == GenerationChunk(text="Non-empty text", generation_info={"len": 14})
|
||||
|
Reference in New Issue
Block a user