(
request: typeof Generated.GenerateContentRequest.Encoded
)
| 165 | ) |
| 166 | |
| 167 | const generateContentStream = ( |
| 168 | request: typeof Generated.GenerateContentRequest.Encoded |
| 169 | ): Stream.Stream<Generated.GenerateContentResponse, AiError.AiError> => { |
| 170 | const url = `/v1beta/models/${request.model}:streamGenerateContent` |
| 171 | const httpRequest = HttpClientRequest.post(url, { |
| 172 | urlParams: UrlParams.fromInput({ "alt": "sse" }), |
| 173 | body: HttpBody.unsafeJson(request) |
| 174 | }) |
| 175 | return streamRequest(httpRequest, Generated.GenerateContentResponse).pipe( |
| 176 | Stream.takeUntil(hasFinishReason) |
| 177 | ) |
| 178 | } |
| 179 | |
| 180 | return GoogleClient.of({ |
| 181 | client, |
nothing calls this directly
no test coverage detected