docs: fix tavily_search code-block format. (#30012)

This pull request includes a change to the `TavilySearchResults` class
in the `tool.py` file, which updates the code block format in the
documentation.

Documentation update:

*
[`libs/community/langchain_community/tools/tavily_search/tool.py`](diffhunk://#diff-e3b6a980979268b639c6a86e9b182756b0f7c7e9e5605e613bc0a72ea6aa5301L54-R59):
Changed the code block format from Python to JSON in the example
provided in the docstring.Thank you for contributing to LangChain!
This commit is contained in:
DamonXue 2025-02-27 23:55:15 +08:00 committed by GitHub
parent 8977ac5ab0
commit 156a60013a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,9 +51,12 @@ class TavilySearchResults(BaseTool): # type: ignore[override, override]
tool.invoke({'query': 'who won the last french open'}) tool.invoke({'query': 'who won the last french open'})
.. code-block:: python .. code-block:: json
'{\n "url": "https://www.nytimes.com...", "content": "Novak Djokovic won the last French Open by beating Casper Ruud ...' {
"url": "https://www.nytimes.com...",
"content": "Novak Djokovic won the last French Open by beating Casper Ruud ..."
}
Invoke with tool call: Invoke with tool call:
@ -64,7 +67,7 @@ class TavilySearchResults(BaseTool): # type: ignore[override, override]
.. code-block:: python .. code-block:: python
ToolMessage( ToolMessage(
content='{\n "url": "https://www.nytimes.com...", "content": "Novak Djokovic won the last French Open by beating Casper Ruud ...', content='{ "url": "https://www.nytimes.com...", "content": "Novak Djokovic won the last French Open by beating Casper Ruud ..." }',
artifact={ artifact={
'query': 'who won the last french open', 'query': 'who won the last french open',
'follow_up_questions': None, 'follow_up_questions': None,