mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-30 05:47:54 +00:00
- Support passing dicts as templates to chat prompt template
- Support making *any* attribute on a message a runtime variable
- Significantly simpler than trying to update our existing prompt
template classes
```python
template = ChatPromptTemplate(
[
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "{text1}",
"cache_control": {"type": "ephemeral"},
},
{"type": "image_url", "image_url": {"path": "{local_image_path}"}},
],
"name": "{name1}",
"tool_calls": [
{
"name": "{tool_name1}",
"args": {"arg1": "{tool_arg1}"},
"id": "1",
"type": "tool_call",
}
],
},
{
"role": "tool",
"content": "{tool_content2}",
"tool_call_id": "1",
"name": "{tool_name1}",
},
]
)
```
will likely close #25514 if we like this idea and update to use this
logic
---------
Co-authored-by: Chester Curme <chester.curme@gmail.com>