This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A helper module that implements tool binding via prompt engineering and JSON parsing. | |
| import json | |
| import re | |
| from uuid import uuid4 | |
| from typing import List, Any, Dict, Union, Optional | |
| from langchain_core.messages import AIMessage, BaseMessage, SystemMessage | |
| from langchain_core.runnables import Runnable, RunnableLambda, RunnableConfig | |
| from langchain_core.tools import BaseTool | |
| from langchain_core.utils.function_calling import convert_to_openai_tool |