@@ -108,19 +108,29 @@ def get_lc_namespace(cls) -> list[str]:
108
108
109
109
@property
110
110
def content_blocks (self ) -> list [types .ContentBlock ]:
111
- """Return the content as a list of standard `` ContentBlock`` s.
111
+ r """Return `` content`` as a list of standardized :class:`~langchain_core.messages.content. ContentBlock`\ s.
112
112
113
- To use this property, the corresponding chat model must support
114
- ``message_version='v1'`` or higher:
113
+ .. important::
115
114
116
- .. code-block:: python
115
+ To use this property correctly, the corresponding ``ChatModel`` must support
116
+ ``message_version='v1'`` or higher (and it must be set):
117
117
118
- from langchain.chat_models import init_chat_model
119
- llm = init_chat_model("...", message_version="v1")
118
+ .. code-block:: python
120
119
121
- Otherwise, does best-effort parsing to standard types.
120
+ from langchain.chat_models import init_chat_model
121
+ llm = init_chat_model("...", message_version="v1")
122
122
123
- """
123
+ # or
124
+
125
+ from langchain-openai import ChatOpenAI
126
+ llm = ChatOpenAI(model="gpt-4o", message_version="v1")
127
+
128
+ Otherwise, the property will perform best-effort parsing to standard types,
129
+ though some content may be misinterpreted.
130
+
131
+ .. versionadded:: 1.0.0
132
+
133
+ """ # noqa: E501
124
134
from langchain_core .messages import content as types
125
135
from langchain_core .messages .block_translators .anthropic import (
126
136
_convert_to_v1_from_anthropic_input ,
0 commit comments