This example assumes using Google.Gemini; is in scope and apiKey contains your Google.Gemini API key.
1 2 3 4 5 6 7 8 910111213141516171819202122232425
usingvarclient=newGeminiClient(apiKey);try{varstartFrame=awaitclient.GenerateImageAsync(prompt:"A red circle on a white background",imageSize:"1K");varendFrame=awaitclient.GenerateImageAsync(prompt:"A blue square on a white background",imageSize:"1K");varresult=awaitclient.InterpolateFramesAsync(startFrame:startFrame.ImageData!,endFrame:endFrame.ImageData!,prompt:"Smoothly transition between the two shapes");}catch(ApiExceptionex)when(IsTransientAvailabilityIssue(ex)){AssertTransientAvailability(ex);}catch(ApiExceptionex)when(ex.StatusCodeisSystem.Net.HttpStatusCode.BadRequest){}