(tools: ChatCompletionsTool[])
| 144 | } |
| 145 | |
| 146 | function convertTools(tools: ChatCompletionsTool[]): unknown[] { |
| 147 | return tools.map((tool) => { |
| 148 | if (tool.type === 'function' && tool.function) { |
| 149 | return { |
| 150 | type: 'function', |
| 151 | name: tool.function.name, |
| 152 | description: tool.function.description, |
| 153 | parameters: tool.function.parameters, |
| 154 | ...(tool.function.strict !== undefined && { |
| 155 | strict: tool.function.strict, |
| 156 | }), |
| 157 | } |
| 158 | } |
| 159 | return tool |
| 160 | }) |
| 161 | } |
| 162 | |
| 163 | function transformRequestBody( |
| 164 | body: Record<string, unknown>, |
no outgoing calls
no test coverage detected