( controller: ReadableStreamDefaultController, conversationId: number, )
| 877 | } |
| 878 | |
| 879 | export async function preamble( |
| 880 | controller: ReadableStreamDefaultController, |
| 881 | conversationId: number, |
| 882 | ) { |
| 883 | const encoder = new TextEncoder(); |
| 884 | |
| 885 | return function streamInfo(step: StreamingStepInput) { |
| 886 | controller.enqueue( |
| 887 | encoder.encode( |
| 888 | "data: " + |
| 889 | JSON.stringify({ |
| 890 | id: conversationId, |
| 891 | ...step, |
| 892 | }), |
| 893 | ), |
| 894 | ); |
| 895 | }; |
| 896 | } |
| 897 | |
| 898 | async function runCodeGen( |
| 899 | userRequest: string, |
no outgoing calls
no test coverage detected