Source code for langchain_community.agent_toolkits.json.toolkit

from __future__ import annotations

from typing import List

from langchain_core.tools import BaseToolkit

from langchain_community.tools import BaseTool
from langchain_community.tools.json.tool import (
    JsonGetValueTool,
    JsonListKeysTool,
    JsonSpec,
)


[docs]class JsonToolkit(BaseToolkit): """与JSON规范交互的工具包。""" spec: JsonSpec
[docs] def get_tools(self) -> List[BaseTool]: """获取工具包中的工具。""" return [ JsonListKeysTool(spec=self.spec), JsonGetValueTool(spec=self.spec), ]