mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-12 06:13:36 +00:00
feat(docs): add link to artifact usage in ToolMessage
This commit is contained in:
parent
2f0c6421a1
commit
b7968c2b7d
@ -57,12 +57,9 @@ class TextAccessor(str):
|
|||||||
def __call__(self) -> str:
|
def __call__(self) -> str:
|
||||||
"""Enable method-style text access for backward compatibility.
|
"""Enable method-style text access for backward compatibility.
|
||||||
|
|
||||||
This method exists solely to support legacy code that calls ``.text()``
|
|
||||||
as a method. New code should use property access (``.text``) instead.
|
|
||||||
|
|
||||||
.. deprecated:: 0.4.0
|
.. deprecated:: 0.4.0
|
||||||
Calling .text() as a method is deprecated. Use .text as a property instead.
|
Calling ``.text()`` as a method is deprecated. Use ``.text`` as a property
|
||||||
This method will be removed in 2.0.0.
|
instead. This method will be removed in 2.0.0.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The string content, identical to property access.
|
The string content, identical to property access.
|
||||||
@ -270,8 +267,8 @@ class AIMessage:
|
|||||||
Can be used as both property (``message.text``) and method (``message.text()``).
|
Can be used as both property (``message.text``) and method (``message.text()``).
|
||||||
|
|
||||||
.. deprecated:: 0.4.0
|
.. deprecated:: 0.4.0
|
||||||
Calling .text() as a method is deprecated. Use .text as a property instead.
|
Calling ``.text()`` as a method is deprecated. Use ``.text`` as a property
|
||||||
This method will be removed in 2.0.0.
|
instead. This method will be removed in 2.0.0.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
text_value = "".join(
|
text_value = "".join(
|
||||||
@ -667,8 +664,8 @@ class HumanMessage:
|
|||||||
Can be used as both property (``message.text``) and method (``message.text()``).
|
Can be used as both property (``message.text``) and method (``message.text()``).
|
||||||
|
|
||||||
.. deprecated:: 0.4.0
|
.. deprecated:: 0.4.0
|
||||||
Calling .text() as a method is deprecated. Use .text as a property instead.
|
Calling ``.text()`` as a method is deprecated. Use ``.text`` as a property
|
||||||
This method will be removed in 2.0.0.
|
instead. This method will be removed in 2.0.0.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
text_value = "".join(
|
text_value = "".join(
|
||||||
@ -762,8 +759,8 @@ class SystemMessage:
|
|||||||
Can be used as both property (``message.text``) and method (``message.text()``).
|
Can be used as both property (``message.text``) and method (``message.text()``).
|
||||||
|
|
||||||
.. deprecated:: 0.4.0
|
.. deprecated:: 0.4.0
|
||||||
Calling .text() as a method is deprecated. Use .text as a property instead.
|
Calling ``.text()`` as a method is deprecated. Use ``.text`` as a property
|
||||||
This method will be removed in 2.0.0.
|
instead. This method will be removed in 2.0.0.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
text_value = "".join(
|
text_value = "".join(
|
||||||
@ -811,15 +808,10 @@ class ToolMessage(ToolOutputMixin):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
artifact: Optional[Any] = None
|
artifact: Optional[Any] = None
|
||||||
"""App-side payload not intended for the model.
|
"""App-side payload not intended for model consumption.
|
||||||
|
|
||||||
Artifacts contain data that your application needs but should not be sent
|
Additonal info and usage examples are available
|
||||||
to the AI model. Example use cases:
|
`in the LangChain documentation <https://python.langchain.com/docs/concepts/tools/#tool-artifacts>`__.
|
||||||
|
|
||||||
- File handles or database connections used by the tool
|
|
||||||
- Raw binary data (images, documents) alongside text summaries
|
|
||||||
- Internal debugging information or execution traces
|
|
||||||
- Computed results that supplement the text content
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -879,8 +871,8 @@ class ToolMessage(ToolOutputMixin):
|
|||||||
Can be used as both property (``message.text``) and method (``message.text()``).
|
Can be used as both property (``message.text``) and method (``message.text()``).
|
||||||
|
|
||||||
.. deprecated:: 0.4.0
|
.. deprecated:: 0.4.0
|
||||||
Calling .text() as a method is deprecated. Use .text as a property instead.
|
Calling ``.text()`` as a method is deprecated. Use ``.text`` as a property
|
||||||
This method will be removed in 2.0.0.
|
instead. This method will be removed in 2.0.0.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
text_value = "".join(
|
text_value = "".join(
|
||||||
|
Loading…
Reference in New Issue
Block a user