The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
update colors (#140)
Harrison Chasebbb405a49254
diff --git a/langchain/input.py b/langchain/input.pyindex 94fad90828..21c7333e56 100644--- a/langchain/input.py+++ b/langchain/input.py@@ -1,7 +1,7 @@"""Handle chained inputs."""from typing import Dict, List, Optional-_COLOR_MAPPING = {"blue": 104, "yellow": 103, "red": 101, "green": 102}+_COLOR_MAPPING = {"blue": 51, "yellow": 229, "pink": 219, "green": 85}def get_color_mapping(@@ -21,7 +21,7 @@ def print_text(text: str, color: Optional[str] = None, end: str = "") -> None:print(text, end=end)else:color_str = _COLOR_MAPPING[color]- print(f"\x1b[{color_str}m{text}\x1b[0m", end=end)+ print(f"\u001b[48;5;{color_str}m{text}\x1b[0m", end=end)class ChainedInput:diff --git a/tests/unit_tests/test_input.py b/tests/unit_tests/test_input.pyindex dd17bfc5de..cc837cbabc 100644--- a/tests/unit_tests/test_input.py+++ b/tests/unit_tests/test_input.py@@ -48,7 +48,7 @@ def test_chained_input_verbose() -> None:chained_input.add("baz", color="blue")sys.stdout = old_stdoutoutput = mystdout.getvalue()- assert output == "\x1b[104mbaz\x1b[0m"+ assert output == "\x1b[48;5;51mbaz\x1b[0m"assert chained_input.input == "foobarbaz"@@ -70,5 +70,5 @@ def test_get_color_mapping_excluded_colors() -> None:"""Test getting of color mapping with excluded colors."""items = ["foo", "bar"]output = get_color_mapping(items, excluded_colors=["blue"])- expected_output = {"foo": "yellow", "bar": "red"}+ expected_output = {"foo": "yellow", "bar": "pink"}assert output == expected_output