Merge pull request #71 from Vasanthdev2004/pr-checks

ci: add automated PR smoke and provider checks
This commit is contained in:
Kevin Codex
2026-04-02 02:33:25 +08:00
committed by GitHub
4 changed files with 241 additions and 14 deletions

View File

@@ -45,6 +45,7 @@ interface OpenAIMessage {
id: string
type: 'function'
function: { name: string; arguments: string }
extra_content?: Record<string, unknown>
}>
tool_call_id?: string
name?: string
@@ -191,7 +192,12 @@ function convertMessages(
if (toolUses.length > 0) {
assistantMsg.tool_calls = toolUses.map(
(tu: { id?: string; name?: string; input?: unknown }) => ({
(tu: {
id?: string
name?: string
input?: unknown
extra_content?: Record<string, unknown>
}) => ({
id: tu.id ?? `call_${Math.random().toString(36).slice(2)}`,
type: 'function' as const,
function: {
@@ -201,6 +207,7 @@ function convertMessages(
? tu.input
: JSON.stringify(tu.input ?? {}),
},
...(tu.extra_content ? { extra_content: tu.extra_content } : {}),
}),
)
}
@@ -278,6 +285,7 @@ interface OpenAIStreamChunk {
id?: string
type?: string
function?: { name?: string; arguments?: string }
extra_content?: Record<string, unknown>
}>
}
finish_reason: string | null
@@ -420,6 +428,7 @@ async function* openaiStreamToAnthropic(
id: tc.id,
name: tc.function.name,
input: {},
...(tc.extra_content ? { extra_content: tc.extra_content } : {}),
},
}
contentBlockIndex++
@@ -703,6 +712,7 @@ class OpenAIShimMessages {
tool_calls?: Array<{
id: string
function: { name: string; arguments: string }
extra_content?: Record<string, unknown>
}>
}
finish_reason?: string
@@ -734,6 +744,7 @@ class OpenAIShimMessages {
id: tc.id,
name: tc.function.name,
input,
...(tc.extra_content ? { extra_content: tc.extra_content } : {}),
})
}
}