MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / convertToolsToFunctions

Function convertToolsToFunctions

app/src/server/utils/convertFunctionCalls.ts:42–51  ·  view source on GitHub ↗
(
  tools: ChatCompletionCreateParamsBase["tools"],
)

Source from the content-addressed store, hash-verified

40 }));
41
42export const convertToolsToFunctions = (
43 tools: ChatCompletionCreateParamsBase["tools"],
44): ChatCompletionCreateParamsBase["functions"] => {
45 if (!tools?.length) return undefined;
46 return tools.map((tool) => ({
47 name: tool.function.name,
48 description: tool.function.description,
49 parameters: tool.function.parameters,
50 }));
51};
52
53export const convertToolCallInputToFunctionInput = (
54 input: ChatCompletionCreateParamsBase,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected