Когда LLM вызывает инструмент «get_screenshot», я хочу предоставить ему снимок экрана веб-сайта.
Например:
Код: Выделить всё
from langchain_core.tools import tool
def do_screenshoot_and_save_it_to_local_disk():
# Pretend that this function will take a screenshot and return the path of the image.
return "/path/to/pic.png"
@tool
def get_screenshot():
picture_path = do_screenshoot_and_save_it_to_local_disk()
return ??? # What should I return?
Или, когда функция украшена @tool, какие типы возвращаемых значений разрешены? Очевидно, что возвращать str бесполезно.
Подробнее здесь: https://stackoverflow.com/questions/795 ... -langchain
Мобильная версия