| 7 | type AISDKEvent = Result["fullStream"] extends AsyncIterable<infer T> ? T : never |
| 8 | |
| 9 | export function adapterState() { |
| 10 | return { |
| 11 | step: 0, |
| 12 | text: 0, |
| 13 | reasoning: 0, |
| 14 | currentTextID: undefined as string | undefined, |
| 15 | currentReasoningID: undefined as string | undefined, |
| 16 | toolNames: {} as Record<string, string>, |
| 17 | copilotTotalNanoAiu: undefined as number | undefined, |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | function finishReason(value: string | undefined): FinishReason { |
| 22 | return Schema.is(FinishReason)(value) ? value : "unknown" |