MCPcopy Create free account
hub / github.com/echoVic/blade-code / functionsToTools

Method functionsToTools

src/tools/format-converter.ts:76–85  ·  view source on GitHub ↗

* 将 OpenAI Functions 格式转换为 Tools 格式

(functions: OpenAIFunction[])

Source from the content-addressed store, hash-verified

74 * 将 OpenAI Functions 格式转换为 Tools 格式
75 */
76 static functionsToTools(functions: OpenAIFunction[]): OpenAITool[] {
77 return functions.map(func => ({
78 type: 'function' as const,
79 function: {
80 name: func.name,
81 description: func.description,
82 parameters: func.parameters,
83 },
84 }));
85 }
86
87 /**
88 * 自动检测格式并转换为 OpenAI Tools 格式

Callers 1

autoConvertToToolsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected