Skip to content

Commit 13b83a3

Browse files
committed
fix(ci): fix build
1 parent 8cdcee7 commit 13b83a3

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

apps/sim/providers/trace-enrichment.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ interface ChatCompletionLike {
1313
message?: {
1414
content?: string | null
1515
tool_calls?: Array<ChatCompletionToolCallLike> | null
16+
reasoning_content?: string | null
17+
reasoning?: string | null
18+
reasoning_details?: Array<{
19+
text?: string | null
20+
summary?: string | null
21+
} | null> | null
1622
} | null
1723
finish_reason?: string | null
1824
} | null>
@@ -126,20 +132,15 @@ function extractChatCompletionsReasoning(
126132
message: NonNullable<ChatCompletionLike['choices'][number]>['message']
127133
): string | undefined {
128134
if (!message) return undefined
129-
const msg = message as unknown as {
130-
reasoning_content?: string | null
131-
reasoning?: string | null
132-
reasoning_details?: Array<{ text?: string | null; summary?: string | null } | null> | null
133-
}
134135

135-
if (typeof msg.reasoning_content === 'string' && msg.reasoning_content.length > 0) {
136-
return msg.reasoning_content
136+
if (typeof message.reasoning_content === 'string' && message.reasoning_content.length > 0) {
137+
return message.reasoning_content
137138
}
138-
if (typeof msg.reasoning === 'string' && msg.reasoning.length > 0) {
139-
return msg.reasoning
139+
if (typeof message.reasoning === 'string' && message.reasoning.length > 0) {
140+
return message.reasoning
140141
}
141-
if (Array.isArray(msg.reasoning_details)) {
142-
const joined = msg.reasoning_details
142+
if (Array.isArray(message.reasoning_details)) {
143+
const joined = message.reasoning_details
143144
.map((d) => d?.text ?? d?.summary ?? '')
144145
.filter((s): s is string => typeof s === 'string' && s.length > 0)
145146
.join('\n')

0 commit comments

Comments
 (0)