import{GoogleGenAI}from"@google/genai";constai=newGoogleGenAI({apiKey:"YOUR_API_KEY"});asyncfunctionmain(){constresponse=awaitai.models.generateContent({model:"gemini-2.0-flash",contents:"Explain how AI works in a few words",});console.log(response.text);}awaitmain();
다음 단계
이제 첫 번째 API 요청을 했으므로 Gemini가 작동하는 모습을 보여주는 다음 가이드를 살펴보세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-25(UTC)"],[],[]]