mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-14 05:56:40 +00:00
support returning run info for llms, chat models and chains (#5666)
returning the run id is important for accessing the run later on
This commit is contained in:
@@ -5,7 +5,7 @@ import pytest
|
||||
|
||||
from langchain.callbacks.manager import CallbackManagerForChainRun
|
||||
from langchain.chains.base import Chain
|
||||
from langchain.schema import BaseMemory
|
||||
from langchain.schema import RUN_KEY, BaseMemory
|
||||
from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandler
|
||||
|
||||
|
||||
@@ -72,6 +72,15 @@ def test_bad_outputs() -> None:
|
||||
chain({"foo": "baz"})
|
||||
|
||||
|
||||
def test_run_info() -> None:
|
||||
"""Test that run_info is returned properly when specified"""
|
||||
chain = FakeChain()
|
||||
output = chain({"foo": "bar"}, include_run_info=True)
|
||||
assert "foo" in output
|
||||
assert "bar" in output
|
||||
assert RUN_KEY in output
|
||||
|
||||
|
||||
def test_correct_call() -> None:
|
||||
"""Test correct call of fake chain."""
|
||||
chain = FakeChain()
|
||||
|
Reference in New Issue
Block a user