Use the
generateContent method
to send a request to the Gemini API.
model:=client.GenerativeModel("gemini-1.5-flash")resp,err:=model.GenerateContent(ctx,genai.Text("Write a story about a magic backpack."))iferr!=nil{log.Fatal(err)}printResponse(resp)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-11 UTC."],[],[]]