Skip to content

Commit 9c63903

Browse files
authored
standard-tests: add cache_control to Anthropic inputs test (#31516)
1 parent a1f068e commit 9c63903

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

libs/standard-tests/langchain_tests/integration_tests/chat_models.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,15 +2582,25 @@ def supports_anthropic_inputs(self) -> bool:
25822582
if not self.supports_anthropic_inputs:
25832583
pytest.skip("Model does not explicitly support Anthropic inputs.")
25842584

2585-
class color_picker(BaseModelV1):
2586-
"""Input your fav color and get a random fact about it."""
2587-
2588-
fav_color: str
2585+
# Anthropic-format tool
2586+
color_picker = {
2587+
"name": "color_picker",
2588+
"input_schema": {
2589+
"type": "object",
2590+
"properties": {
2591+
"fav_color": {"type": "string"},
2592+
},
2593+
"required": ["fav_color"],
2594+
},
2595+
"description": "Input your fav color and get a random fact about it.",
2596+
"cache_control": {"type": "ephemeral"},
2597+
}
25892598

25902599
human_content: List[dict] = [
25912600
{
25922601
"type": "text",
25932602
"text": "what's your favorite color in this image",
2603+
"cache_control": {"type": "ephemeral"},
25942604
},
25952605
]
25962606
if self.supports_image_inputs:

0 commit comments

Comments
 (0)