mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 15:43:54 +00:00
standard-tests: add cache_control to Anthropic inputs test (#31516)
This commit is contained in:
parent
a1f068eb85
commit
9c639035c0
@ -2582,15 +2582,25 @@ class ChatModelIntegrationTests(ChatModelTests):
|
|||||||
if not self.supports_anthropic_inputs:
|
if not self.supports_anthropic_inputs:
|
||||||
pytest.skip("Model does not explicitly support Anthropic inputs.")
|
pytest.skip("Model does not explicitly support Anthropic inputs.")
|
||||||
|
|
||||||
class color_picker(BaseModelV1):
|
# Anthropic-format tool
|
||||||
"""Input your fav color and get a random fact about it."""
|
color_picker = {
|
||||||
|
"name": "color_picker",
|
||||||
fav_color: str
|
"input_schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"fav_color": {"type": "string"},
|
||||||
|
},
|
||||||
|
"required": ["fav_color"],
|
||||||
|
},
|
||||||
|
"description": "Input your fav color and get a random fact about it.",
|
||||||
|
"cache_control": {"type": "ephemeral"},
|
||||||
|
}
|
||||||
|
|
||||||
human_content: List[dict] = [
|
human_content: List[dict] = [
|
||||||
{
|
{
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"text": "what's your favorite color in this image",
|
"text": "what's your favorite color in this image",
|
||||||
|
"cache_control": {"type": "ephemeral"},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
if self.supports_image_inputs:
|
if self.supports_image_inputs:
|
||||||
|
Loading…
Reference in New Issue
Block a user