MCPcopy Index your code
hub / github.com/Effect-TS/effect / generateContentStream

Function generateContentStream

packages/ai/google/src/GoogleClient.ts:167–178  ·  view source on GitHub ↗
(
      request: typeof Generated.GenerateContentRequest.Encoded
    )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 2

streamRequestFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected