MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / convertTools

Function convertTools

sdk/src/impl/chatgpt-backend-fetch.ts:146–161  ·  view source on GitHub ↗
(tools: ChatCompletionsTool[])

Source from the content-addressed store, hash-verified

144}
145
146function 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
163function transformRequestBody(
164 body: Record<string, unknown>,

Callers 1

transformRequestBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected