feat: support tools in bedrock (#1598)

This commit is contained in:
brook hong
2025-03-17 13:42:18 +08:00
committed by GitHub
parent 3504e64407
commit e204ca1cf3
7 changed files with 25 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ function M:is_disable_stream() return false end
---@param tool AvanteLLMTool
---@return AvanteOpenAITool
function M.transform_tool(tool)
function M:transform_tool(tool)
local input_schema_properties = {}
local required = {}
for _, field in ipairs(tool.param.fields) do
@@ -303,7 +303,7 @@ function M:parse_curl_args(prompt_opts)
if not disable_tools and prompt_opts.tools then
tools = {}
for _, tool in ipairs(prompt_opts.tools) do
table.insert(tools, self.transform_tool(tool))
table.insert(tools, self:transform_tool(tool))
end
end