( tools: ChatCompletionCreateParamsBase["tools"], )
| 40 | })); |
| 41 | |
| 42 | export 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 | |
| 53 | export const convertToolCallInputToFunctionInput = ( |
| 54 | input: ChatCompletionCreateParamsBase, |
no outgoing calls
no test coverage detected