(
streamInfo: WorkspaceStreamInfo,
options: { metadata?: Partial<MuxMetadata>; parts?: MuxMessage["parts"] } = {}
)
| 2088 | } |
| 2089 | |
| 2090 | private buildPartialAssistantMessage( |
| 2091 | streamInfo: WorkspaceStreamInfo, |
| 2092 | options: { metadata?: Partial<MuxMetadata>; parts?: MuxMessage["parts"] } = {} |
| 2093 | ): MuxMessage { |
| 2094 | const canonicalModel = normalizeToCanonical(streamInfo.model); |
| 2095 | const routedThroughGateway = |
| 2096 | streamInfo.initialMetadata?.routedThroughGateway ?? |
| 2097 | streamInfo.model.startsWith("mux-gateway:"); |
| 2098 | |
| 2099 | return { |
| 2100 | id: streamInfo.messageId, |
| 2101 | role: "assistant", |
| 2102 | metadata: { |
| 2103 | historySequence: streamInfo.historySequence, |
| 2104 | timestamp: streamInfo.startTime, |
| 2105 | ...streamInfo.initialMetadata, |
| 2106 | model: canonicalModel, |
| 2107 | metadataModel: streamInfo.metadataModel, |
| 2108 | routedThroughGateway, |
| 2109 | ...(streamInfo.thinkingLevel && { |
| 2110 | thinkingLevel: streamInfo.thinkingLevel as ThinkingLevel, |
| 2111 | }), |
| 2112 | partial: true, |
| 2113 | ...options.metadata, |
| 2114 | }, |
| 2115 | parts: options.parts ?? streamInfo.parts, |
| 2116 | }; |
| 2117 | } |
| 2118 | |
| 2119 | private buildPartialRefusalContinuationMessage( |
| 2120 | streamInfo: WorkspaceStreamInfo, |
no test coverage detected