Sử dụng phương thức generateContent để gửi yêu cầu đến 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)
Bước tiếp theo
Giờ đây, khi đã tạo yêu cầu API đầu tiên, bạn nên khám phá các hướng dẫn sau đây để tìm hiểu cách Gemini hoạt động:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-03-13 UTC."],[],[]]