├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── feature_request.yml ├── header-checker-lint.yml ├── labeler.yml ├── pull_request_template.md └── workflows │ ├── labeler.yml │ ├── notebooks.yml │ ├── remove-issue-labels.yml │ ├── remove-pr-labels.yml │ └── stale.yml ├── .gitignore ├── CODEOWNERS ├── CONTRIBUTING.md ├── DEMO_MAINTAINERS.md ├── LICENSE ├── README.md ├── demos └── palm │ ├── README.md │ └── web │ ├── list-it │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .gcloudignore │ ├── .gitignore │ ├── .prettierrc │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── app.yaml │ ├── dev.yaml │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.jsx │ │ ├── assets │ │ │ └── icons │ │ │ │ ├── close.jsx │ │ │ │ └── lightbulb.jsx │ │ ├── components │ │ │ ├── list │ │ │ │ ├── list.jsx │ │ │ │ └── list.module.scss │ │ │ ├── listLoading │ │ │ │ ├── listLoading.jsx │ │ │ │ └── listLoading.module.scss │ │ │ ├── listSuggestions │ │ │ │ ├── listSuggestions.jsx │ │ │ │ └── listSuggestions.module.scss │ │ │ ├── textarea │ │ │ │ ├── textarea.jsx │ │ │ │ └── textarea.module.scss │ │ │ ├── tip │ │ │ │ ├── tip.jsx │ │ │ │ └── tip.module.scss │ │ │ └── ui │ │ │ │ ├── button │ │ │ │ ├── button.jsx │ │ │ │ └── button.module.scss │ │ │ │ ├── errorComponent │ │ │ │ ├── errorComponent.jsx │ │ │ │ └── errorComponent.module.scss │ │ │ │ ├── header │ │ │ │ ├── header.jsx │ │ │ │ └── header.module.scss │ │ │ │ ├── icon │ │ │ │ ├── icon.jsx │ │ │ │ └── icon.module.scss │ │ │ │ ├── loading │ │ │ │ ├── loading.jsx │ │ │ │ └── loading.module.scss │ │ │ │ └── spacer │ │ │ │ ├── spacer.jsx │ │ │ │ └── spacer.module.scss │ │ ├── lib │ │ │ ├── api.js │ │ │ ├── firebase.config.js │ │ │ ├── priming.js │ │ │ └── utils.js │ │ ├── main.jsx │ │ ├── store.js │ │ └── styles │ │ │ ├── app.scss │ │ │ └── variables.scss │ ├── staging.yaml │ ├── vite.config.js │ └── yarn.lock │ ├── mood-food │ ├── .env │ ├── .eslintignore │ ├── .eslintrc │ ├── .gcloudignore │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── app.yaml │ ├── config-overrides.js │ ├── docs │ │ ├── llm_prompt_design_diagram.png │ │ ├── mood_food_demo.gif │ │ └── mood_food_header.png │ ├── index.html │ ├── jsconfig.json │ ├── package.json │ ├── public │ │ └── icon.svg │ ├── src │ │ ├── apis │ │ │ └── llmCaller.js │ │ ├── assets │ │ │ ├── icons │ │ │ │ ├── ChefLogo.js │ │ │ │ ├── Close.js │ │ │ │ ├── Decorator.js │ │ │ │ ├── MoodFoodLogo.js │ │ │ │ ├── ServingLogo.js │ │ │ │ ├── SolidArrowDown.svg │ │ │ │ └── index.js │ │ │ ├── lotties │ │ │ │ └── loading_pan_01.json │ │ │ └── patterns │ │ │ │ ├── index.js │ │ │ │ ├── pattern1.js │ │ │ │ ├── pattern2.js │ │ │ │ ├── pattern3.js │ │ │ │ ├── pattern4.js │ │ │ │ ├── pattern5.js │ │ │ │ └── pattern6.js │ │ ├── components │ │ │ ├── BotResponses.js │ │ │ ├── ChatInput.js │ │ │ ├── Dialogue.js │ │ │ ├── HeroCard.js │ │ │ ├── ImageGenerator.js │ │ │ ├── Ingredients.js │ │ │ ├── OnBoardingCard.js │ │ │ ├── PrePromptsPanel.js │ │ │ ├── PredefineMessage.js │ │ │ └── PromptCard.js │ │ ├── data │ │ │ ├── fonts.js │ │ │ ├── hero.js │ │ │ └── palettes.js │ │ ├── fonts.css │ │ ├── fonts │ │ │ └── GoogleSans │ │ │ │ ├── GoogleSans-Bold.ttf │ │ │ │ ├── GoogleSans-BoldItalic.ttf │ │ │ │ ├── GoogleSans-Italic.ttf │ │ │ │ ├── GoogleSans-Medium.ttf │ │ │ │ ├── GoogleSans-MediumItalic.ttf │ │ │ │ └── GoogleSans-Regular.ttf │ │ ├── hooks │ │ │ ├── useChat.js │ │ │ └── useImageResize.js │ │ ├── index.css │ │ ├── main.js │ │ ├── pages │ │ │ ├── chat.js │ │ │ └── home.js │ │ └── utils │ │ │ ├── images.js │ │ │ ├── ingredientHeader.js │ │ │ ├── llmTextParser.js │ │ │ └── orderlist.js │ ├── third_party │ │ └── fonts │ │ │ ├── CinzelDecorative │ │ │ ├── CinzelDecorative-Regular.ttf │ │ │ └── OFL.txt │ │ │ ├── JosefinSans │ │ │ ├── JosefinSans-Regular.ttf │ │ │ └── OFL.txt │ │ │ ├── Milonga │ │ │ ├── Milonga-Regular.ttf │ │ │ └── OFL.txt │ │ │ ├── Sacramento │ │ │ ├── OFL.txt │ │ │ └── Sacramento-Regular.ttf │ │ │ ├── TulpenOne │ │ │ ├── OFL.txt │ │ │ └── TulpenOne-Regular.ttf │ │ │ ├── Ultra │ │ │ ├── LICENSE.txt │ │ │ └── Ultra-Regular.ttf │ │ │ ├── Urbanist │ │ │ ├── OFL.txt │ │ │ └── Urbanist-Regular.ttf │ │ │ └── WireOne │ │ │ ├── OFL.txt │ │ │ └── WireOne-Regular.ttf │ ├── vite.config.js │ └── yarn.lock │ ├── quick-prompt │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .gcloudignore │ ├── .gitignore │ ├── .prettierrc │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── app.yaml │ ├── dev.yaml │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── img │ │ │ └── emojis.png │ │ ├── site.webmanifest │ │ └── sounds │ │ │ ├── forbidden-word.mp3 │ │ │ ├── game-end.mp3 │ │ │ └── point-get.mp3 │ ├── src │ │ ├── App.jsx │ │ ├── components │ │ │ ├── generic │ │ │ │ ├── borderButton │ │ │ │ │ ├── borderButton.jsx │ │ │ │ │ └── borderButton.module.scss │ │ │ │ ├── button │ │ │ │ │ ├── button.module.scss │ │ │ │ │ └── button.tsx │ │ │ │ ├── container │ │ │ │ │ ├── container.jsx │ │ │ │ │ └── container.module.scss │ │ │ │ ├── emojiBackground │ │ │ │ │ ├── emojiBackground.jsx │ │ │ │ │ └── emojiBackground.module.scss │ │ │ │ ├── emojisplosion │ │ │ │ │ ├── emojisplosion.jsx │ │ │ │ │ └── emojisplosion.module.scss │ │ │ │ ├── header │ │ │ │ │ ├── header.jsx │ │ │ │ │ └── header.module.scss │ │ │ │ ├── input │ │ │ │ │ ├── input.jsx │ │ │ │ │ └── input.module.scss │ │ │ │ ├── statusBar │ │ │ │ │ ├── statusBar.jsx │ │ │ │ │ └── statusBar.module.scss │ │ │ │ └── toggle │ │ │ │ │ ├── toggle.jsx │ │ │ │ │ └── toggle.module.scss │ │ │ ├── layouts │ │ │ │ ├── aboutScreen │ │ │ │ │ ├── aboutScreen.jsx │ │ │ │ │ └── aboutScreen.module.scss │ │ │ │ ├── gameOverScreen │ │ │ │ │ ├── gameOverScreen.jsx │ │ │ │ │ └── gameOverScreen.module.scss │ │ │ │ ├── gameScreen │ │ │ │ │ ├── gameScreen.jsx │ │ │ │ │ └── gameScreen.module.scss │ │ │ │ └── startScreen │ │ │ │ │ ├── startScreen.jsx │ │ │ │ │ └── startScreen.module.scss │ │ │ └── ui │ │ │ │ ├── bottomSheet │ │ │ │ ├── bottomSheet.jsx │ │ │ │ └── bottomSheet.module.scss │ │ │ │ ├── card │ │ │ │ ├── card.jsx │ │ │ │ └── card.module.scss │ │ │ │ ├── endCard │ │ │ │ ├── endCard.jsx │ │ │ │ └── endCard.module.scss │ │ │ │ ├── forbiddenPopup │ │ │ │ ├── forbiddenPopup.jsx │ │ │ │ └── forbiddenPopup.module.scss │ │ │ │ ├── score │ │ │ │ ├── score.jsx │ │ │ │ └── score.module.scss │ │ │ │ ├── settings │ │ │ │ ├── settings.jsx │ │ │ │ └── settings.module.scss │ │ │ │ ├── successPopup │ │ │ │ ├── successPopup.jsx │ │ │ │ └── successPopup.module.scss │ │ │ │ ├── timer │ │ │ │ ├── timer.jsx │ │ │ │ └── timer.module.scss │ │ │ │ └── transcript │ │ │ │ ├── transcript.jsx │ │ │ │ └── transcript.module.scss │ │ ├── lib │ │ │ ├── api.js │ │ │ ├── error_responses.js │ │ │ ├── excluded_words.js │ │ │ ├── firebase.config.js │ │ │ ├── priming.js │ │ │ ├── sound.js │ │ │ ├── speech.js │ │ │ ├── utils.js │ │ │ └── words.js │ │ ├── main.jsx │ │ ├── store.js │ │ └── styles │ │ │ ├── app.scss │ │ │ └── variables.scss │ ├── staging.yaml │ ├── vite.config.js │ └── yarn.lock │ ├── talking-character │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── docs │ │ ├── llm_prompt_design_diagram.png │ │ ├── talking-character-demo.gif │ │ ├── talking-character-header.png │ │ └── talking-character-screen.png │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── Doggo07.glb │ │ ├── ZEPETO_TORSO_3_clean2.glb │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ ├── robots.txt │ │ ├── talking_head_v1 │ │ │ ├── talking_heads_blendshapes_internal.data │ │ │ ├── talking_heads_blendshapes_internal.fetch.js │ │ │ ├── talking_heads_blendshapes_internal.html │ │ │ ├── talking_heads_blendshapes_internal.js │ │ │ ├── talking_heads_blendshapes_internal.mem │ │ │ ├── talking_heads_blendshapes_internal.wasm │ │ │ ├── talking_heads_blendshapes_internal.wasm.debug.wasm │ │ │ ├── talking_heads_blendshapes_internal.wasm.map │ │ │ ├── talking_heads_blendshapes_internal.worker.js │ │ │ ├── talking_heads_demo.binarypb │ │ │ ├── talking_heads_microphone_assets.data │ │ │ └── talking_heads_microphone_assets.js │ │ └── talking_head_v2 │ │ │ ├── talking_heads_v2_blendshapes_internal.data │ │ │ ├── talking_heads_v2_blendshapes_internal.fetch.js │ │ │ ├── talking_heads_v2_blendshapes_internal.html │ │ │ ├── talking_heads_v2_blendshapes_internal.js │ │ │ ├── talking_heads_v2_blendshapes_internal.mem │ │ │ ├── talking_heads_v2_blendshapes_internal.wasm │ │ │ ├── talking_heads_v2_blendshapes_internal.wasm.debug.wasm │ │ │ ├── talking_heads_v2_blendshapes_internal.wasm.map │ │ │ ├── talking_heads_v2_blendshapes_internal.worker.js │ │ │ ├── talking_heads_v2_demo.binarypb │ │ │ ├── talking_heads_v2_microphone_assets.data │ │ │ └── talking_heads_v2_microphone_assets.js │ ├── src │ │ ├── App.css │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── apis │ │ │ ├── avatarImage.ts │ │ │ ├── languageModel.ts │ │ │ ├── mediapipe_audio_blendshapes.ts │ │ │ ├── network.ts │ │ │ ├── speechRecognition.ts │ │ │ ├── talkingHead.ts │ │ │ ├── textToSpeech.ts │ │ │ └── voices.ts │ │ ├── components │ │ │ ├── Layout │ │ │ │ └── index.tsx │ │ │ └── ThreeJS │ │ │ │ ├── Doggo07.tsx │ │ │ │ ├── ZEPETO_TORSO_3.tsx │ │ │ │ └── index.tsx │ │ ├── context │ │ │ ├── config.tsx │ │ │ └── constants.ts │ │ ├── index.css │ │ ├── index.tsx │ │ ├── logo.svg │ │ ├── pages │ │ │ ├── character.tsx │ │ │ ├── personality.tsx │ │ │ └── styles.tsx │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ ├── routes │ │ │ └── index.tsx │ │ └── setupTests.ts │ ├── third_party │ │ ├── LICENSE │ │ ├── METADATA │ │ └── mediapipe │ │ │ └── web │ │ │ └── graph_runner │ │ │ ├── graph_runner.ts │ │ │ └── platform_utils.ts │ └── tsconfig.json │ ├── textfx │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .gcloudignore │ ├── .gitignore │ ├── .prettierrc │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── app.yaml │ ├── dev.yaml │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── android-chrome-144x144.png │ │ ├── apple-touch-icon.png │ │ ├── assets │ │ │ ├── landing │ │ │ │ └── lotties │ │ │ │ │ ├── acronym_hero_animation_lottie.json │ │ │ │ │ ├── alliteration_hero_animation_lottie.json │ │ │ │ │ ├── chain_hero_animation_lottie.json │ │ │ │ │ ├── explode_hero_animation_lottie.json │ │ │ │ │ ├── fuse_hero_animation_lottie.json │ │ │ │ │ ├── pov_hero_animation_lottie.json │ │ │ │ │ ├── scene_hero_animation_lottie.json │ │ │ │ │ ├── simile_hero_animation_lottie.json │ │ │ │ │ ├── unexpect_hero_animation_lottie.json │ │ │ │ │ └── unfold_hero_animation_lottie.json │ │ │ └── loading.gif │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── mstile-150x150.png │ │ ├── safari-pinned-tab.svg │ │ └── site.webmanifest │ ├── src │ │ ├── App.tsx │ │ ├── assets │ │ │ ├── images │ │ │ │ ├── landing-right-col-background.jpg │ │ │ │ ├── landing-video-poster.jpg │ │ │ │ └── welcome │ │ │ │ │ ├── welcome-step-1.jpg │ │ │ │ │ ├── welcome-step-2.jpg │ │ │ │ │ └── welcome-step-3.jpg │ │ │ ├── landing_right_col_animation_lottie.json │ │ │ └── lupe_signature_animation_lottie.json │ │ ├── components │ │ │ ├── generic │ │ │ │ ├── button │ │ │ │ │ ├── button.module.scss │ │ │ │ │ └── button.tsx │ │ │ │ ├── checkbox │ │ │ │ │ ├── checkbox.module.scss │ │ │ │ │ └── checkbox.tsx │ │ │ │ ├── filterButton │ │ │ │ │ ├── filterButton.module.scss │ │ │ │ │ └── filterButton.tsx │ │ │ │ ├── filterList │ │ │ │ │ ├── filterList.module.scss │ │ │ │ │ └── filterList.tsx │ │ │ │ ├── hamburger │ │ │ │ │ ├── hamburger.module.scss │ │ │ │ │ └── hamburger.tsx │ │ │ │ ├── icon │ │ │ │ │ ├── icon-set │ │ │ │ │ │ ├── acronym.tsx │ │ │ │ │ │ ├── all.tsx │ │ │ │ │ │ ├── alliteration.tsx │ │ │ │ │ │ ├── arrow.tsx │ │ │ │ │ │ ├── arrowDown.tsx │ │ │ │ │ │ ├── back.tsx │ │ │ │ │ │ ├── chain.tsx │ │ │ │ │ │ ├── close.tsx │ │ │ │ │ │ ├── collapseArrow.tsx │ │ │ │ │ │ ├── copy.tsx │ │ │ │ │ │ ├── delete.tsx │ │ │ │ │ │ ├── download.tsx │ │ │ │ │ │ ├── drag.tsx │ │ │ │ │ │ ├── dropdown.tsx │ │ │ │ │ │ ├── explode.tsx │ │ │ │ │ │ ├── external.tsx │ │ │ │ │ │ ├── fuse.tsx │ │ │ │ │ │ ├── info.tsx │ │ │ │ │ │ ├── logo.tsx │ │ │ │ │ │ ├── logoLight.tsx │ │ │ │ │ │ ├── mic.tsx │ │ │ │ │ │ ├── micListening.tsx │ │ │ │ │ │ ├── micWaiting.tsx │ │ │ │ │ │ ├── pin.tsx │ │ │ │ │ │ ├── pinSolid.tsx │ │ │ │ │ │ ├── play.tsx │ │ │ │ │ │ ├── pov.tsx │ │ │ │ │ │ ├── refresh.tsx │ │ │ │ │ │ ├── save.tsx │ │ │ │ │ │ ├── saved.tsx │ │ │ │ │ │ ├── scene.tsx │ │ │ │ │ │ ├── simile.tsx │ │ │ │ │ │ ├── swiperArrow.tsx │ │ │ │ │ │ ├── unexpect.tsx │ │ │ │ │ │ ├── unfold.tsx │ │ │ │ │ │ └── unpin.tsx │ │ │ │ │ ├── icon.module.scss │ │ │ │ │ └── icon.tsx │ │ │ │ ├── input │ │ │ │ │ ├── input.module.scss │ │ │ │ │ └── input.tsx │ │ │ │ ├── macroButtons │ │ │ │ │ ├── macroButtons.module.scss │ │ │ │ │ └── macroButtons.tsx │ │ │ │ ├── macroDescription │ │ │ │ │ ├── macroDescription.module.scss │ │ │ │ │ └── macroDescription.tsx │ │ │ │ ├── macroInput │ │ │ │ │ ├── macroInput.module.scss │ │ │ │ │ └── macroInput.tsx │ │ │ │ ├── numberToggle │ │ │ │ │ ├── numberToggle.module.scss │ │ │ │ │ └── numberToggle.tsx │ │ │ │ ├── outputCard │ │ │ │ │ ├── outputCard.module.scss │ │ │ │ │ └── outputCard.tsx │ │ │ │ ├── outputSection │ │ │ │ │ ├── outputSection.module.scss │ │ │ │ │ └── outputSection.tsx │ │ │ │ ├── pinnedCards │ │ │ │ │ ├── pinnedCard.tsx │ │ │ │ │ ├── pinnedCards.module.scss │ │ │ │ │ └── pinnedCards.tsx │ │ │ │ ├── popup │ │ │ │ │ ├── popup.module.scss │ │ │ │ │ └── popup.tsx │ │ │ │ ├── portal │ │ │ │ │ └── portal.tsx │ │ │ │ ├── savedFilter │ │ │ │ │ ├── savedFilter.module.scss │ │ │ │ │ └── savedFilter.tsx │ │ │ │ ├── siteNav │ │ │ │ │ ├── siteNav.module.scss │ │ │ │ │ └── siteNav.tsx │ │ │ │ ├── speechToText │ │ │ │ │ ├── speechToText.module.scss │ │ │ │ │ └── speechToText.tsx │ │ │ │ ├── viewAllToggle │ │ │ │ │ ├── viewAllToggle.module.scss │ │ │ │ │ └── viewAllToggle.tsx │ │ │ │ └── youtubePlayer │ │ │ │ │ ├── youtubePlayer.module.scss │ │ │ │ │ └── youtubePlayer.tsx │ │ │ └── layouts │ │ │ │ ├── about │ │ │ │ ├── about.module.scss │ │ │ │ └── about.tsx │ │ │ │ ├── landing │ │ │ │ ├── googleLogo.tsx │ │ │ │ ├── labsSessionsLogo.tsx │ │ │ │ ├── landing.module.scss │ │ │ │ ├── landing.tsx │ │ │ │ ├── landingLogo.tsx │ │ │ │ └── lupeLogo.tsx │ │ │ │ ├── mainScreen │ │ │ │ ├── mainScreen.module.scss │ │ │ │ └── mainScreen.tsx │ │ │ │ ├── promptData │ │ │ │ ├── promptData.module.scss │ │ │ │ └── promptData.tsx │ │ │ │ └── welcome │ │ │ │ ├── screen1.tsx │ │ │ │ ├── screen2.tsx │ │ │ │ ├── welcome.module.scss │ │ │ │ └── welcome.tsx │ │ ├── constants.tsx │ │ ├── hooks │ │ │ ├── useAnimationFrame.tsx │ │ │ ├── useIsMobile.tsx │ │ │ ├── useOnClickOutside.tsx │ │ │ ├── useOnScreen.tsx │ │ │ ├── useSticky.tsx │ │ │ └── useWindowSize.tsx │ │ ├── lib │ │ │ ├── adaptPromptDataFormat.ts │ │ │ ├── api.js │ │ │ ├── firebase.config.js │ │ │ ├── formatDownload.ts │ │ │ ├── macros.js │ │ │ ├── parse.js │ │ │ ├── postprocess.js │ │ │ ├── priming.js │ │ │ └── utils.ts │ │ ├── main.tsx │ │ ├── store.ts │ │ └── styles │ │ │ ├── app.scss │ │ │ ├── base.scss │ │ │ ├── tooltip.scss │ │ │ ├── typography.scss │ │ │ └── variables.scss │ ├── staging.yaml │ ├── tsconfig.json │ ├── types │ │ └── index.d.ts │ └── vite.config.js │ └── travel-planner │ ├── .env │ ├── .eslintignore │ ├── .eslintrc │ ├── .gcloudignore │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING │ ├── LICENSE │ ├── app.yaml │ ├── config-overrides.js │ ├── docs │ ├── llm_prompt_design_diagram.png │ ├── wanderlust_demo.gif │ ├── wanderlust_demo.png │ └── wanderlust_header.png │ ├── index.html │ ├── jsconfig.json │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── icon.svg │ ├── onboarding.jpg │ └── 💡.svg │ ├── readme.md │ ├── src │ ├── App.css │ ├── App.js │ ├── apis │ │ ├── LLMCaller.js │ │ ├── googleCaller.js │ │ └── placeCaller.js │ ├── assets │ │ ├── icons │ │ │ └── 🏖️.svg │ │ ├── lotties │ │ │ └── itinerary_loading_03.json │ │ └── react.svg │ ├── components │ │ ├── ChatInput.js │ │ ├── DayList.js │ │ ├── Dialogue.js │ │ ├── GoogleLogin.js │ │ ├── Header.js │ │ ├── Layout.js │ │ ├── MainLayout.js │ │ ├── MapCard.js │ │ ├── PlaceCard.js │ │ ├── PlaceView.js │ │ └── PredefineMessage.js │ ├── fonts │ │ └── GoogleSans │ │ │ ├── GoogleSans-Bold.ttf │ │ │ ├── GoogleSans-BoldItalic.ttf │ │ │ ├── GoogleSans-Italic.ttf │ │ │ ├── GoogleSans-Medium.ttf │ │ │ ├── GoogleSans-MediumItalic.ttf │ │ │ └── GoogleSans-Regular.ttf │ ├── guards │ │ ├── AuthGuard.js │ │ └── GuestGuard.js │ ├── hooks │ │ └── useInterval.js │ ├── index.css │ ├── main.js │ ├── pages │ │ ├── index.js │ │ └── onboarding.js │ ├── routes │ │ └── index.js │ └── utils │ │ ├── fetchImage.js │ │ ├── gtag.js │ │ ├── iframeUtils.js │ │ ├── llmTextParser.js │ │ ├── loadScript.js │ │ ├── markPlaces.js │ │ ├── prompt.js │ │ ├── rawParser.js │ │ └── sleep.js │ ├── vite.config.js │ └── yarn.lock ├── examples ├── gemini │ ├── javascript │ │ └── langchain_quickstart_node │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── main.js │ │ │ ├── package-lock.json │ │ │ └── package.json │ ├── node │ │ ├── flutter_theme_agent │ │ │ ├── .eslintrc.json │ │ │ ├── .gitignore │ │ │ ├── .vscode │ │ │ │ ├── extensions.json │ │ │ │ ├── launch.json │ │ │ │ ├── settings.json │ │ │ │ └── tasks.json │ │ │ ├── .vscodeignore │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── flutter-theme-agent.png │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── src │ │ │ │ ├── components │ │ │ │ │ ├── buttonstyle.ts │ │ │ │ │ ├── colorscheme.ts │ │ │ │ │ ├── component.ts │ │ │ │ │ └── texttheme.ts │ │ │ │ ├── extension.ts │ │ │ │ └── theme.ts │ │ │ └── tsconfig.json │ │ └── pipet-code-agent │ │ │ ├── .eslintrc.json │ │ │ ├── .gitignore │ │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ │ ├── .vscodeignore │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── pipet-snippet.png │ │ │ ├── src │ │ │ ├── comments.ts │ │ │ ├── extension.ts │ │ │ └── review.ts │ │ │ └── tsconfig.json │ └── python │ │ ├── docs-agent │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── apps_script │ │ │ ├── README.md │ │ │ ├── drive_to_markdown.gs │ │ │ ├── exportmd.gs │ │ │ ├── gmail_to_markdown.gs │ │ │ ├── helper_functions.gs │ │ │ └── main.gs │ │ ├── config.yaml │ │ ├── docs │ │ │ ├── chunking-process.md │ │ │ ├── cli-reference.md │ │ │ ├── concepts.md │ │ │ ├── config-reference.md │ │ │ ├── create-a-new-task.md │ │ │ ├── images │ │ │ │ ├── apps-script-screenshot-01.png │ │ │ │ ├── docs-agent-architecture-01.png │ │ │ │ ├── docs-agent-architecture-02.png │ │ │ │ ├── docs-agent-benchmarks-01.png │ │ │ │ ├── docs-agent-chat-app-screenshot-01.png │ │ │ │ ├── docs-agent-embeddings-01.png │ │ │ │ ├── docs-agent-embeddings-02.png │ │ │ │ ├── docs-agent-pre-processing-01.png │ │ │ │ ├── docs-agent-prompt-structure-01.png │ │ │ │ └── docs-agent-ui-screenshot-01.png │ │ │ └── whats-new.md │ │ ├── docs_agent │ │ │ ├── agents │ │ │ │ ├── __init__.py │ │ │ │ └── docs_agent.py │ │ │ ├── benchmarks │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── benchmarks.yaml │ │ │ │ ├── results.out │ │ │ │ └── run_benchmark_tests.py │ │ │ ├── interfaces │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── chatbot │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── chatui.py │ │ │ │ │ ├── static │ │ │ │ │ │ ├── css │ │ │ │ │ │ │ ├── chatbox.css │ │ │ │ │ │ │ ├── style-chatui-full.css │ │ │ │ │ │ │ ├── style-chatui-widget-pro.css │ │ │ │ │ │ │ ├── style-chatui-widget.css │ │ │ │ │ │ │ ├── style-chatui.css │ │ │ │ │ │ │ └── style-logs.css │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ └── favicon.png │ │ │ │ │ │ └── javascript │ │ │ │ │ │ │ └── app.js │ │ │ │ │ └── templates │ │ │ │ │ │ ├── admin │ │ │ │ │ │ ├── debugs.html │ │ │ │ │ │ └── logs.html │ │ │ │ │ │ ├── chatui-experimental │ │ │ │ │ │ ├── base.html │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── result.html │ │ │ │ │ │ ├── chatui-full │ │ │ │ │ │ ├── base.html │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── result.html │ │ │ │ │ │ ├── chatui-widget-pro │ │ │ │ │ │ ├── base.html │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── result.html │ │ │ │ │ │ ├── chatui-widget │ │ │ │ │ │ ├── base.html │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── result.html │ │ │ │ │ │ └── chatui │ │ │ │ │ │ ├── base.html │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── result.html │ │ │ │ ├── cli │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── cli.py │ │ │ │ │ ├── cli_admin.py │ │ │ │ │ ├── cli_common.py │ │ │ │ │ ├── cli_helpme.py │ │ │ │ │ ├── cli_posix.py │ │ │ │ │ ├── cli_runtask.py │ │ │ │ │ ├── cli_script.py │ │ │ │ │ ├── cli_show_session.py │ │ │ │ │ ├── cli_tellme.py │ │ │ │ │ └── cli_tools.py │ │ │ │ ├── hello_world.py │ │ │ │ └── run_console.py │ │ │ ├── memory │ │ │ │ ├── __init__.py │ │ │ │ └── logging.py │ │ │ ├── models │ │ │ │ ├── __init__.py │ │ │ │ ├── aqa.py │ │ │ │ ├── aqa_models.py │ │ │ │ ├── base.py │ │ │ │ ├── google_genai.py │ │ │ │ ├── llm.py │ │ │ │ ├── tokenCount.py │ │ │ │ └── tools │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── mcp_client.py │ │ │ │ │ ├── tool_manager.py │ │ │ │ │ └── tools.py │ │ │ ├── postprocess │ │ │ │ ├── __init__.py │ │ │ │ └── docs_retriever.py │ │ │ ├── preprocess │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── extract_image_path.py │ │ │ │ ├── files_to_plain_text.py │ │ │ │ ├── populate_vector_database.py │ │ │ │ └── splitters │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── fidl_splitter.py │ │ │ │ │ ├── html_splitter.py │ │ │ │ │ └── markdown_splitter.py │ │ │ ├── storage │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── chroma.py │ │ │ │ ├── google_semantic_retriever.py │ │ │ │ └── rag.py │ │ │ ├── tests │ │ │ │ ├── __init__.py │ │ │ │ ├── cli_unit_tests.py │ │ │ │ └── utilities │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── test_helpers.py │ │ │ └── utilities │ │ │ │ ├── __init__.py │ │ │ │ ├── config.py │ │ │ │ ├── helpers.py │ │ │ │ └── tasks.py │ │ ├── poetry.lock │ │ ├── pylintrc │ │ ├── pyproject.toml │ │ ├── scripts │ │ │ ├── autocomplete.sh │ │ │ ├── create_file_dictionary.py │ │ │ ├── extract_image_files.py │ │ │ ├── extract_replace_image_alt_text.py │ │ │ ├── helpme.sh │ │ │ ├── tellme.sh │ │ │ └── update_files_from_yaml.py │ │ ├── tasks │ │ │ ├── describe-images-alt-text-no-markdown.yaml │ │ │ ├── describe-images-and-replace.yaml │ │ │ ├── describe-images-for-alt-text-task.yaml │ │ │ ├── describe-images-from-doc-replace.yaml │ │ │ ├── describe-images-from-doc.yaml │ │ │ ├── extract-workflows-task.yaml │ │ │ ├── help-polish-prompts-task.yaml │ │ │ ├── index-page-generator-task.yaml │ │ │ ├── prepare-podcast-from-dir.yaml │ │ │ ├── release-notes-task.yaml │ │ │ └── revise-content-structure-task.yaml │ │ ├── third_party │ │ │ ├── css │ │ │ │ └── chatbox.css │ │ │ └── g2docsmd-html │ │ │ │ ├── LICENSE │ │ │ │ ├── exportmd.gs │ │ │ │ └── patches │ │ │ │ └── 001-initial-changes-for-docs-agent.patch │ │ └── vector_stores │ │ │ └── .gitkeep │ │ ├── langchain │ │ ├── Gemini_LangChain_QA_Chroma_WebLoad.ipynb │ │ ├── Gemini_LangChain_QA_Pinecone_WebLoad.ipynb │ │ └── Gemini_LangChain_Summarization_WebLoad.ipynb │ │ ├── llamaindex │ │ └── Gemini_LlamaIndex_QA_Chroma_WebPageReader.ipynb │ │ ├── vectordb_with_chroma │ │ └── vectordb_with_chroma.ipynb │ │ └── vectordb_with_qdrant │ │ └── Qdrant_similarity_search.ipynb └── palm │ ├── README.md │ ├── java │ └── DELETEME │ └── python │ ├── DELETEME │ └── google_cloud_functions │ └── main.py ├── site └── en │ ├── README.md │ ├── docs │ ├── pdf_parsing_for_semantic_retrieval_systems.ipynb │ ├── react_gemini_prompting.ipynb │ └── search_reranking_using_embeddings.ipynb │ ├── examples │ ├── chat_calculator.ipynb │ └── text_calculator.ipynb │ ├── gemini-api │ ├── docs │ │ ├── function-calling │ │ │ └── python.ipynb │ │ ├── get-started │ │ │ ├── python.ipynb │ │ │ └── rest.ipynb │ │ ├── model-tuning │ │ │ ├── python.ipynb │ │ │ └── rest.ipynb │ │ ├── prompting_with_media.ipynb │ │ ├── semantic_retrieval.ipynb │ │ └── vision.ipynb │ └── tutorials │ │ ├── anomaly_detection.ipynb │ │ ├── clustering_with_embeddings.ipynb │ │ ├── document_search.ipynb │ │ ├── extract_structured_data.ipynb │ │ └── text_classifier_embeddings.ipynb │ ├── gemma │ └── docs │ │ ├── agile_classifiers.ipynb │ │ ├── codegemma │ │ ├── code_assist_keras.ipynb │ │ ├── codegemma_flax_inference.ipynb │ │ └── keras_quickstart.ipynb │ │ ├── core │ │ ├── distributed_tuning.ipynb │ │ ├── gemma_library.ipynb │ │ ├── huggingface_inference.ipynb │ │ ├── huggingface_text_finetune_qlora.ipynb │ │ ├── keras_inference.ipynb │ │ ├── lora_tuning.ipynb │ │ └── pytorch_gemma.ipynb │ │ ├── gemma_chat.ipynb │ │ ├── integrations │ │ └── langchain.ipynb │ │ ├── lit_gemma.ipynb │ │ ├── paligemma │ │ ├── fine-tuning-paligemma.ipynb │ │ └── inference-with-keras.ipynb │ │ └── recurrentgemma │ │ ├── recurrentgemma_jax_finetune.ipynb │ │ └── recurrentgemma_jax_inference.ipynb │ ├── palm_docs │ ├── chat_node_quickstart.ipynb │ ├── chat_quickstart.ipynb │ ├── curl_quickstart.ipynb │ ├── embeddings_quickstart.ipynb │ ├── notebook_magic.ipynb │ ├── text_node_quickstart.ipynb │ ├── text_quickstart.ipynb │ ├── tuning_quickstart_python.ipynb │ └── tuning_quickstart_rest.ipynb │ ├── responsible │ └── docs │ │ └── safeguards │ │ ├── shieldgemma2_on_huggingface.ipynb │ │ ├── shieldgemma_on_huggingface.ipynb │ │ └── shieldgemma_on_keras.ipynb │ └── tutorials │ └── quickstart_colab.ipynb ├── templates ├── aistudio_gemini_prompt_chat.ipynb ├── aistudio_gemini_prompt_chat_b64.ipynb ├── aistudio_gemini_prompt_freeform.ipynb ├── aistudio_gemini_prompt_freeform_b64.ipynb ├── aistudio_palm_prompt_chat.ipynb └── aistudio_palm_prompt_text.ipynb └── third_party ├── README.md ├── docs-agent └── mood-food /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Use this template to report bugs 3 | labels: ["type:bug"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: > 8 | **Note:** If this is a support question (e.g. _How do I do XYZ?_), please visit the [Discourse forum](https://discuss.ai.google.dev/). This is a great place to interact with developers, and to learn, share, and support each other. 9 | - type: textarea 10 | id: description 11 | attributes: 12 | label: > 13 | Description of the bug: 14 | - type: textarea 15 | id: behavior 16 | attributes: 17 | label: > 18 | Actual vs expected behavior: 19 | - type: textarea 20 | id: info 21 | attributes: 22 | label: > 23 | Any other information you'd like to share? 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Use this template to suggest a new feature 3 | labels: ["type:feature request"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: > 8 | **Note:** If this is a support question (e.g. _How do I do XYZ?_), please visit the [Discourse forum](https://discuss.ai.google.dev/). This is a great place to interact with developers, and to learn, share, and support each other. 9 | - type: textarea 10 | id: description 11 | attributes: 12 | label: > 13 | Description of the feature request: 14 | - type: textarea 15 | id: behavior 16 | attributes: 17 | label: > 18 | What problem are you trying to solve with this feature? 19 | - type: textarea 20 | id: info 21 | attributes: 22 | label: > 23 | Any other information you'd like to share? 24 | -------------------------------------------------------------------------------- /.github/header-checker-lint.yml: -------------------------------------------------------------------------------- 1 | # Lint check for license headers. 2 | # See: https://github.com/googleapis/repo-automation-bots/tree/main/packages/header-checker-lint 3 | allowedCopyrightHolders: 4 | - 'Google LLC' 5 | allowedLicenses: 6 | - 'Apache-2.0' 7 | sourceFileExtensions: 8 | - 'python' 9 | - 'ts' 10 | - 'js' 11 | - 'java' 12 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | 'status:awaiting review': 2 | - '**/*' 3 | 4 | 'component:demos': 5 | - demos/**/* 6 | 7 | 'component:documentation': 8 | - site/**/* 9 | 10 | 'demos:docs-agent': 11 | - demos/palm/python/docs-agent/**/* 12 | 13 | 'demos:list-it': 14 | - demos/palm/web/list-it/**/* 15 | 16 | 'demos:mood-food': 17 | - demos/palm/web/mood-food/**/* 18 | 19 | 'demos:pipet': 20 | - demos/palm/node/pipet-code-agent/**/* 21 | 22 | 'demos:quick-prompt': 23 | - demos/palm/web/quick-prompt/**/* 24 | 25 | 'demos:talking-character': 26 | - demos/palm/web/talking-character/**/* 27 | 28 | 'demos:text-fx': 29 | - demos/palm/web/textfx/**/* 30 | 31 | 'demos:travel-planner': 32 | - demos/palm/web/travel-planner/**/* 33 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description of the change 2 | 3 | 4 | ## Motivation 5 | 6 | 7 | ## Type of change 8 | Choose one: (Bug fix | Feature request | Documentation | Other) 9 | 10 | ## Checklist 11 | 12 | - [ ] I have performed a self-review of my code. 13 | - [ ] I have added detailed comments to my code where applicable. 14 | - [ ] I have verified that my change does not break existing code. 15 | - [ ] My PR is based on the latest changes of the main branch (if unsure, please run `git pull --rebase upstream main`). 16 | - [ ] I am familiar with the [Google Style Guide](https://google.github.io/styleguide/) for the language I have coded in. 17 | - [ ] I have read through the [Contributing Guide](https://github.com/google/generative-ai-docs/blob/main/CONTRIBUTING.md) and signed the [Contributor License Agreement](https://cla.developers.google.com/about). 18 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: "PR Labeler" 2 | 3 | on: 4 | pull_request_target: 5 | types: ["opened", "reopened", "ready_for_review"] 6 | 7 | jobs: 8 | triage: 9 | permissions: 10 | contents: read 11 | pull-requests: write 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/labeler@v4 15 | if: ${{ github.event.pull_request.draft == false }} 16 | -------------------------------------------------------------------------------- /.github/workflows/remove-issue-labels.yml: -------------------------------------------------------------------------------- 1 | name: Remove issue labels 2 | 3 | on: 4 | issues: 5 | types: [closed] 6 | 7 | jobs: 8 | remove_label: 9 | permissions: 10 | contents: read 11 | issues: write 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions-ecosystem/action-remove-labels@v1 15 | with: 16 | labels: | 17 | status:triaged 18 | status:more data needed 19 | -------------------------------------------------------------------------------- /.github/workflows/remove-pr-labels.yml: -------------------------------------------------------------------------------- 1 | name: Remove PR Labels 2 | 3 | on: 4 | pull_request_target: 5 | types: ["closed", "merged"] 6 | 7 | jobs: 8 | remove_label: 9 | permissions: 10 | contents: read 11 | pull-requests: write 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions-ecosystem/action-remove-labels@v1 15 | with: 16 | labels: | 17 | status:awaiting review 18 | status:awaiting user response 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.pyc 2 | **/*.rws 3 | **/.DS_Store 4 | **/.idea 5 | **/.ipynb_checkpoints 6 | **/proofreading 7 | **/venv 8 | **/.python-version 9 | **/node_modules 10 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @google/generative-ai-admin 2 | 3 | # demos/palm/web/talking-character 4 | # demos/palm/web/mood-food 5 | # demos/palm/web/travel-planner 6 | # demos/palm/web/list-it 7 | # demos/palm/web/quick-prompt 8 | # demos/palm/web/textfx 9 | examples/gemini/python/docs-agent @nickvander @rundong08 @Meggin @kyolee415 10 | examples/gemini/node/flutter_theme_agent/ @khanhnwin @joefernandez 11 | demos/palm/node/pipet-code-agent @joefernandez @shilpakancharla @markmcd 12 | 13 | templates/ @google/ai-studio-team 14 | site/ @google/generative-ai-site-team 15 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We would love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows [Google's Open Source Community 24 | Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) 32 | for this purpose. 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Google Gemini API Website & Documentation 2 | 3 | These are the source files for the guide and tutorials on 4 | the [Generative AI developer site](https://ai.google.dev/), home to 5 | the Gemini API and Gemma. 6 | 7 | | Path | Description | 8 | | ---- | ----------- | 9 | | [`site/`](site/) | Notebooks and other content used directly on ai.google.dev. | 10 | | [`demos/`](demos/) | Demos apps. Larger than examples, typically consists of working apps. | 11 | | [`examples/`](examples/) | Examples. Smaller, single-purpose code for demonstrating specific concepts. | 12 | 13 | 14 | 15 | To contribute to the site documentation, please read 16 | [CONTRIBUTING.md](CONTRIBUTING.md). 17 | 18 | To contribute as a demo app maintainer, please read 19 | [DEMO_MAINTAINERS.md](DEMO_MAINTAINERS.md). 20 | 21 | To file an issue, please use the 22 | [GitHub issue tracker](https://github.com/google/generative-ai-docs/issues/new). 23 | 24 | ## License 25 | 26 | [Apache License 2.0](LICENSE) 27 | -------------------------------------------------------------------------------- /demos/palm/README.md: -------------------------------------------------------------------------------- 1 | # PaLM API demos 2 | 3 | Herein lies demo apps referenced by the PaLM API site. 4 | 5 | Demos are considered to be larger than examples and consist of working apps. 6 | 7 | Smaller, specific examples can be found in the 8 | [`examples/`](../../examples/palm) directory. 9 | 10 | ## Updates 11 | 12 | Some of these code projects have been updated and moved to the /examples/gemini directory, including: 13 | 14 | - **Docs Agent** - /demos/palm/python/docs-agent/ moved to: 15 | [/examples/gemini/python/docs-agent/](https://github.com/google/generative-ai-docs/tree/main/examples/gemini/python/docs-agent) 16 | - **Pipet Code Agent** - /demos/palm/node/pipet-code-agent/ moved to: 17 | [/examples/gemini/node/pipet-code-agent/](https://github.com/google/generative-ai-docs/tree/main/examples/gemini/node/pipet-code-agent) -------------------------------------------------------------------------------- /demos/palm/web/list-it/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | module.exports = { 18 | env: { 19 | browser: true, 20 | es2021: true, 21 | node: true 22 | }, 23 | extends: [ 24 | 'eslint:recommended', 25 | 'plugin:react/recommended', 26 | 'plugin:jsx-a11y/recommended', 27 | 'plugin:react/jsx-runtime', 28 | 'plugin:prettier/recommended', 29 | 'plugin:react-hooks/recommended' 30 | ], 31 | overrides: [], 32 | parserOptions: { 33 | ecmaVersion: 'latest', 34 | sourceType: 'module' 35 | }, 36 | plugins: ['react', 'react-hooks', 'prettier', 'jsx-a11y'], 37 | rules: {} 38 | } 39 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/.gcloudignore: -------------------------------------------------------------------------------- 1 | # This file specifies files that are _not_ uploaded to Google Cloud 2 | 3 | # using gcloud. It follows the same syntax as .gitignore, with the addition of 4 | 5 | # "#!include" directives (which insert the entries of the given .gitignore-style 6 | 7 | # file at that point). 8 | 9 | # 10 | 11 | # For more information, run: 12 | 13 | # $ gcloud topic gcloudignore 14 | 15 | # 16 | 17 | .gcloudignore 18 | 19 | # If you would like to upload your .git directory, .gitignore file or files 20 | 21 | # from your .gitignore file, remove the corresponding line 22 | 23 | # below: 24 | 25 | .git 26 | .gitignore 27 | 28 | # Python pycache: 29 | 30 | **pycache**/ 31 | 32 | # Ignored by the build system 33 | 34 | /setup.cfg 35 | node_modules/ 36 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 80, 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "bracketSpacing": false, 7 | "arrowParens": "avoid", 8 | "endOfLine": "lf", 9 | "trailingComma": "none" 10 | } 11 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows 24 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use GitHub pull requests for this purpose. Consult 32 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 33 | information on using pull requests. 34 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/app.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | runtime: python39 16 | 17 | handlers: 18 | - url: / 19 | static_files: dist/index.html 20 | upload: dist/index.html 21 | 22 | - url: /(.*) 23 | static_files: dist/\1 24 | upload: dist/(.*) 25 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/dev.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | service: dev 16 | 17 | runtime: python39 18 | 19 | handlers: 20 | - url: / 21 | static_files: dist/index.html 22 | upload: dist/index.html 23 | 24 | - url: /(.*) 25 | static_files: dist/\1 26 | upload: dist/(.*) 27 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "listit", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "author": "Aaron Wade ", 7 | "scripts": { 8 | "dev": "vite --host", 9 | "build": "vite build", 10 | "preview": "vite preview", 11 | "start": "npm run dev", 12 | "lint": "eslint \"src/**/*.{js,jsx,json}\"", 13 | "lint:fix": "eslint . --fix" 14 | }, 15 | "dependencies": { 16 | "classnames": "^2.3.2", 17 | "firebase": "^9.20.0", 18 | "lodash.shuffle": "^4.2.0", 19 | "prop-types": "^15.8.1", 20 | "react": "^18.2.0", 21 | "react-dom": "^18.2.0", 22 | "uuid": "^9.0.0", 23 | "zustand": "^4.3.2" 24 | }, 25 | "devDependencies": { 26 | "@types/react": "^18.0.26", 27 | "@types/react-dom": "^18.0.9", 28 | "@vitejs/plugin-react": "^3.0.0", 29 | "eslint": "^8.35.0", 30 | "eslint-config-prettier": "^8.6.0", 31 | "eslint-plugin-jsx-a11y": "^6.7.1", 32 | "eslint-plugin-prettier": "^4.2.1", 33 | "eslint-plugin-react": "^7.32.2", 34 | "eslint-plugin-react-hooks": "^4.6.0", 35 | "prettier": "^2.8.4", 36 | "sass": "^1.57.1", 37 | "vite": "^4.5.2", 38 | "vite-plugin-svgr": "^2.4.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/assets/icons/close.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const Close = () => { 18 | return ( 19 | 26 | 30 | 31 | ) 32 | } 33 | 34 | export default Close 35 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/listLoading/listLoading.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import c from 'classnames' 18 | import Loading from '~/components/ui/loading/loading' 19 | 20 | import styles from './listLoading.module.scss' 21 | 22 | const ListLoading = () => { 23 | return ( 24 |
25 | 26 |
27 | ) 28 | } 29 | 30 | export default ListLoading 31 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/listLoading/listLoading.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | .listLoading { 18 | text-align: center; 19 | 20 | .spinner { 21 | justify-content: center; 22 | } 23 | 24 | h1 { 25 | padding-top: 15px; 26 | padding-bottom: 15px; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/listSuggestions/listSuggestions.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '~/styles/variables.scss'; 18 | 19 | .listSuggestions { 20 | .label { 21 | display: block; 22 | margin-bottom: 8px; 23 | line-height: 28px; 24 | color: $md-grey-700; 25 | 26 | @media screen and (min-width: #{$containerWidth + 1px}) { 27 | font-size: 18px; 28 | margin-bottom: 16px; 29 | } 30 | } 31 | 32 | .button { 33 | display: block; 34 | margin-bottom: 8px; 35 | @media screen and (min-width: #{$containerWidth + 1px}) { 36 | margin-bottom: 16px; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/ui/icon/icon.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import c from 'classnames' 18 | import PropTypes from 'prop-types' 19 | 20 | import styles from './icon.module.scss' 21 | 22 | const Icon = ({icon, type}) => ( 23 | 27 | {icon} 28 | 29 | ) 30 | 31 | Icon.propTypes = { 32 | icon: PropTypes.string.isRequired, 33 | type: PropTypes.string 34 | } 35 | 36 | export default Icon 37 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/ui/icon/icon.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | .icon { 18 | display: inline-block; 19 | // height: 20px; 20 | // width: 20px; 21 | color: currentColor; 22 | } 23 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/ui/loading/loading.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import c from 'classnames' 18 | import PropTypes from 'prop-types' 19 | 20 | import styles from './loading.module.scss' 21 | 22 | const Loading = ({text, className}) => { 23 | return ( 24 |
25 |
26 | {text && {text}} 27 |
28 | ) 29 | } 30 | 31 | Loading.propTypes = { 32 | text: PropTypes.string, 33 | className: PropTypes.string 34 | } 35 | 36 | export default Loading 37 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/ui/loading/loading.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '~/styles/variables.scss'; 18 | 19 | .loading { 20 | display: flex; 21 | align-items: center; 22 | gap: 8px; 23 | 24 | .text { 25 | font-size: 16px; 26 | line-height: 30px; 27 | 28 | @media screen and (min-width: #{$containerWidth + 1px}) { 29 | font-size: 18px; 30 | line-height: 60px; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/components/ui/spacer/spacer.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '~/styles/variables.scss'; 18 | 19 | .spacer { 20 | width: 100%; 21 | padding-left: 16px; 22 | padding-right: 16px; 23 | margin-top: 32px; 24 | margin-bottom: 32px; 25 | 26 | svg { 27 | width: 100%; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/main.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import ReactDOM from 'react-dom/client' 18 | import App from './App' 19 | import './styles/app.scss' 20 | 21 | ReactDOM.createRoot(document.getElementById('root')).render() 22 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/src/styles/variables.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /// layout 18 | $containerWidth: 600px; 19 | $containerWidthWide: 721; 20 | 21 | /// typography 22 | $base-font-family: 'Space Grotesk', monospace; 23 | $base-font-size: 14px; 24 | 25 | /// colors 26 | $md-white: #fff; 27 | $md-grey-50: #f8f9fa; 28 | $md-grey-300: #dadce0; 29 | $md-grey-700: #5f6368; 30 | $md-grey-800: #3c4043; 31 | $md-grey-900: #202124; 32 | $md-green-50: #e6f4ea; 33 | $md-green-100: #ceead6; 34 | $md-green-700: #188038; 35 | 36 | $c-main: $md-green-700; 37 | $c-bg: $md-grey-50; 38 | $c-border: $md-grey-300; 39 | $c-text: $md-grey-900; 40 | 41 | /// shadow 42 | $soft-shadow: 0px 4px 16px rgba(0, 0, 0, 0.1); 43 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/staging.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | service: staging 16 | 17 | runtime: python39 18 | 19 | handlers: 20 | - url: / 21 | static_files: dist/index.html 22 | upload: dist/index.html 23 | 24 | - url: /(.*) 25 | static_files: dist/\1 26 | upload: dist/(.*) 27 | -------------------------------------------------------------------------------- /demos/palm/web/list-it/vite.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import path from 'path' 18 | import {defineConfig} from 'vite' 19 | import react from '@vitejs/plugin-react' 20 | import svgr from 'vite-plugin-svgr' 21 | 22 | export default defineConfig({ 23 | server: {port: 5555}, 24 | plugins: [svgr(), react()], 25 | resolve: { 26 | alias: { 27 | '~': path.resolve(__dirname, './src') 28 | } 29 | } 30 | }) 31 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/.env: -------------------------------------------------------------------------------- 1 | VITE_GOOGLE_GENERATIVE_LANGUAGE_API_KEY="" -------------------------------------------------------------------------------- /demos/palm/web/mood-food/.eslintignore: -------------------------------------------------------------------------------- 1 | // .eslintignore 2 | build/* 3 | public/* 4 | src/service-worker.js 5 | src/serviceWorkerRegistration.js 6 | src/setupTests.js 7 | src/reportWebVitals.js 8 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/.gcloudignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | /[!.]* 3 | /.?* 4 | 5 | # Except the Cloud Function files we want to deploy 6 | !/app.yaml 7 | !/dist/** 8 | !/main.py 9 | !/requirements.txt 10 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Python 27 | .venv 28 | __pycache__ 29 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | package-lock.json 4 | public 5 | src/assets/lotties/* 6 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "tabWidth": 2 6 | } 7 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We would love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows [Google's Open Source Community 24 | Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) 32 | for this purpose. 33 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/app.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | runtime: python310 16 | 17 | handlers: 18 | - url: / 19 | static_files: dist/index.html 20 | upload: dist/index.html 21 | 22 | - url: /chat 23 | static_files: dist/index.html 24 | upload: dist/index.html 25 | 26 | - url: /(.*) 27 | static_files: dist/\1 28 | upload: dist/(.*) 29 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/config-overrides.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const webpack = require('webpack'); 18 | 19 | module.exports = function override(config) { 20 | config.resolve.fallback = { 21 | process: require.resolve('process/browser'), 22 | zlib: require.resolve('browserify-zlib'), 23 | stream: require.resolve('stream-browserify'), 24 | util: require.resolve('util'), 25 | buffer: require.resolve('buffer'), 26 | asset: require.resolve('assert'), 27 | }; 28 | 29 | config.plugins.push( 30 | new webpack.ProvidePlugin({ 31 | process: 'process/browser.js', 32 | Buffer: ['buffer', 'Buffer'], 33 | }) 34 | ); 35 | 36 | return config; 37 | }; 38 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/docs/llm_prompt_design_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/docs/llm_prompt_design_diagram.png -------------------------------------------------------------------------------- /demos/palm/web/mood-food/docs/mood_food_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/docs/mood_food_demo.gif -------------------------------------------------------------------------------- /demos/palm/web/mood-food/docs/mood_food_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/docs/mood_food_header.png -------------------------------------------------------------------------------- /demos/palm/web/mood-food/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "baseUrl": "." 6 | }, 7 | "include": ["src/**/*", "config-overrides.js"], 8 | "exclude": ["node_modules"] 9 | } 10 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/assets/icons/Close.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | 19 | export default (background, stroke) => { 20 | return ( 21 | 22 | 26 | 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/assets/icons/SolidArrowDown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/assets/icons/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import ChefLogo from './ChefLogo'; 18 | import Close from './Close'; 19 | import Decorator from './Decorator'; 20 | import MoodFoodLogo from './MoodFoodLogo'; 21 | import ServingLogo from './ServingLogo'; 22 | 23 | export { ChefLogo, Close, Decorator, MoodFoodLogo, ServingLogo }; 24 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/assets/patterns/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import pattern1 from './pattern1'; 18 | import pattern2 from './pattern2'; 19 | import pattern3 from './pattern3'; 20 | import pattern4 from './pattern4'; 21 | import pattern5 from './pattern5'; 22 | import pattern6 from './pattern6'; 23 | 24 | export default [pattern1, pattern2, pattern3, pattern4, pattern5, pattern6]; 25 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/components/PredefineMessage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import { Paper } from '@mui/material'; 19 | 20 | export default function ({ onClick, children }) { 21 | return ( 22 | 33 | {children} 34 | 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/data/fonts.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export default [ 18 | 'Cinzel Decorative', 19 | 'Josefin Sans', 20 | 'Milonga', 21 | 'Sacramento', 22 | 'Tulpen One', 23 | 'Ultra', 24 | 'Urbanist', 25 | 'Wire One', 26 | ]; 27 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/data/palettes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // [background, typo] 18 | 19 | export default [ 20 | ['#423443', '#92B9F8'], 21 | ['#213E41', '#C2CDCE'], 22 | ['#222222', '#E2773D'], 23 | ['#93BD9B', '#847749'], 24 | ['#A8AFBC', '#7B633E'], 25 | ['#DED7CD', '#984E27'], 26 | ['#183122', '#DBA1AC'], 27 | ['#847749', '#000000'], 28 | ['#444964', '#E7EBEF'], 29 | ['#EEECE1', '#D695A2'], 30 | ]; 31 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Bold.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-BoldItalic.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Italic.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Medium.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-MediumItalic.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/src/fonts/GoogleSans/GoogleSans-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/src/utils/orderlist.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const frontNumberCleaner = (str) => { 18 | const reg = /^[0-9]+[.)]/; 19 | return str.replace(reg, '').trim(); 20 | }; 21 | 22 | export { frontNumberCleaner }; 23 | -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/CinzelDecorative/CinzelDecorative-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/CinzelDecorative/CinzelDecorative-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/JosefinSans/JosefinSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/JosefinSans/JosefinSans-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/Milonga/Milonga-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/Milonga/Milonga-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/Sacramento/Sacramento-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/Sacramento/Sacramento-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/TulpenOne/TulpenOne-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/TulpenOne/TulpenOne-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/Ultra/Ultra-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/Ultra/Ultra-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/Urbanist/Urbanist-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/Urbanist/Urbanist-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/mood-food/third_party/fonts/WireOne/WireOne-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/mood-food/third_party/fonts/WireOne/WireOne-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | module.exports = { 18 | env: { 19 | browser: true, 20 | es2021: true, 21 | node: true 22 | }, 23 | extends: [ 24 | 'eslint:recommended', 25 | 'plugin:react/recommended', 26 | 'plugin:jsx-a11y/recommended', 27 | 'plugin:react/jsx-runtime', 28 | 'plugin:prettier/recommended', 29 | 'plugin:react-hooks/recommended' 30 | ], 31 | overrides: [], 32 | parserOptions: { 33 | ecmaVersion: 'latest', 34 | sourceType: 'module' 35 | }, 36 | plugins: ['react', 'react-hooks', 'prettier', 'jsx-a11y'], 37 | rules: {} 38 | } 39 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/.gcloudignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | src/ 3 | public/ 4 | package.json 5 | package-lock.json 6 | vite.config.js 7 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 80, 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "bracketSpacing": false, 7 | "arrowParens": "avoid", 8 | "endOfLine": "lf", 9 | "trailingComma": "none" 10 | } 11 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows 24 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use GitHub pull requests for this purpose. Consult 32 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 33 | information on using pull requests. 34 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/app.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | runtime: python39 16 | 17 | handlers: 18 | - url: / 19 | static_files: dist/index.html 20 | upload: dist/index.html 21 | 22 | - url: /(.*) 23 | static_files: dist/\1 24 | upload: dist/(.*) 25 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/dev.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | service: dev 16 | 17 | runtime: python39 18 | 19 | handlers: 20 | - url: / 21 | static_files: dist/index.html 22 | upload: dist/index.html 23 | 24 | - url: /(.*) 25 | static_files: dist/\1 26 | upload: dist/(.*) 27 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "quickprompt", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "author": "Aaron Wade ", 7 | "scripts": { 8 | "dev": "vite --host", 9 | "build": "vite build", 10 | "preview": "vite preview", 11 | "start": "npm run dev", 12 | "lint": "eslint \"src/**/*.{js,jsx,json}\"", 13 | "lint:fix": "eslint . --fix", 14 | "check-env": "node -e 'console.log(process.env)' | grep npm" 15 | }, 16 | "dependencies": { 17 | "@react-spring/web": "^9.6.1", 18 | "@use-gesture/react": "^10.2.24", 19 | "classnames": "^2.3.2", 20 | "firebase": "^9.21.0", 21 | "lodash.shuffle": "^4.2.0", 22 | "react": "^18.2.0", 23 | "react-dom": "^18.2.0", 24 | "uuid": "^9.0.0", 25 | "zustand": "^4.3.2" 26 | }, 27 | "devDependencies": { 28 | "@types/react": "^18.0.26", 29 | "@types/react-dom": "^18.0.9", 30 | "@vitejs/plugin-react": "^3.0.0", 31 | "eslint": "^8.35.0", 32 | "eslint-config-prettier": "^8.6.0", 33 | "eslint-plugin-jsx-a11y": "^6.7.1", 34 | "eslint-plugin-prettier": "^4.2.1", 35 | "eslint-plugin-react": "^7.32.2", 36 | "eslint-plugin-react-hooks": "^4.6.0", 37 | "prettier": "^2.8.4", 38 | "sass": "^1.57.1", 39 | "vite": "^4.5.2" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/apple-touch-icon.png -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/favicon-16x16.png -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/favicon-32x32.png -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/favicon.ico -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/img/emojis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/img/emojis.png -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/sounds/forbidden-word.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/sounds/forbidden-word.mp3 -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/sounds/game-end.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/sounds/game-end.mp3 -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/public/sounds/point-get.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/quick-prompt/public/sounds/point-get.mp3 -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/components/generic/container/container.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import PropTypes from 'prop-types' 18 | import c from 'classnames' 19 | import styles from './container.module.scss' 20 | 21 | const Container = ({children, inset, className}) => { 22 | return ( 23 |
24 |
{children}
25 |
26 | ) 27 | } 28 | 29 | Container.propTypes = { 30 | children: PropTypes.node, 31 | inset: PropTypes.bool, 32 | className: PropTypes.string 33 | } 34 | 35 | export default Container 36 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/components/generic/statusBar/statusBar.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import PropTypes from 'prop-types' 18 | import c from 'classnames' 19 | import Timer from '../../ui/timer/timer' 20 | import Score from '../../ui/score/score' 21 | import styles from './statusBar.module.scss' 22 | 23 | const StatusBar = ({className}) => { 24 | return ( 25 |
26 | 27 | 28 |
29 | ) 30 | } 31 | 32 | StatusBar.propTypes = { 33 | className: PropTypes.string 34 | } 35 | 36 | export default StatusBar 37 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/components/generic/statusBar/statusBar.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '../../../styles/variables'; 18 | 19 | .statusBar { 20 | display: flex; 21 | align-items: center; 22 | 23 | button { 24 | margin-left: 25px; 25 | font-size: 20px; 26 | } 27 | 28 | .timer { 29 | flex: 1; 30 | margin-right: 16px; 31 | } 32 | 33 | @media screen and (min-width: $desktop) { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/components/generic/toggle/toggle.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import PropTypes from 'prop-types' 18 | import c from 'classnames' 19 | import styles from './toggle.module.scss' 20 | 21 | const Toggle = ({active}) => { 22 | return ( 23 |
24 |
25 |
26 | ) 27 | } 28 | 29 | Toggle.propTypes = { 30 | active: PropTypes.bool 31 | } 32 | 33 | export default Toggle 34 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/components/generic/toggle/toggle.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '../../../styles/variables'; 18 | 19 | .toggle { 20 | width: 39px; 21 | height: 24px; 22 | background: $gray; 23 | transition: 300ms ease; 24 | &.active { 25 | background: $bright_orange; 26 | .slider { 27 | transform: translateX(100%); 28 | } 29 | } 30 | 31 | .slider { 32 | width: 18px; 33 | height: 18px; 34 | background: $white; 35 | position: absolute; 36 | top: 3px; 37 | left: 0; 38 | transform: translateX(3px); 39 | transition: 300ms ease; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/components/layouts/gameOverScreen/gameOverScreen.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '../../../styles/variables'; 18 | 19 | .gameOverScreen { 20 | position: relative; 21 | display: flex; 22 | flex-direction: column; 23 | justify-content: flex-start; 24 | width: 100%; 25 | height: 100%; 26 | overflow: auto; 27 | 28 | .spacer { 29 | margin-bottom: 16px; 30 | @media screen and (min-width: $desktop) { 31 | margin-bottom: 24px; 32 | } 33 | } 34 | .spacerLarge { 35 | margin-bottom: 40px; 36 | @media screen and (min-width: $desktop) { 37 | margin-bottom: 64px; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/components/ui/score/score.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import PropTypes from 'prop-types' 18 | import c from 'classnames' 19 | import {useScore} from '../../../store' 20 | import styles from './score.module.scss' 21 | 22 | const Score = ({className}) => { 23 | const score = useScore() 24 | 25 | return ( 26 |
27 | Score{score} 28 |
29 | ) 30 | } 31 | 32 | Score.propTypes = { 33 | className: PropTypes.string 34 | } 35 | 36 | export default Score 37 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/lib/error_responses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export default [ 18 | 'Sorry, not sure what you mean...', 19 | 'I’m not getting it... give me another?', 20 | 'Sorry, I don’t know what you mean...', 21 | 'Not sure... try another?' 22 | ] 23 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/lib/excluded_words.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export default [ 18 | 'the', 19 | 'be', 20 | 'to', 21 | 'of', 22 | 'and', 23 | 'a', 24 | 'in', 25 | 'I', 26 | 'it', 27 | 'for', 28 | 'not', 29 | 'on', 30 | 'he', 31 | 'as', 32 | 'you', 33 | 'do', 34 | 'at', 35 | 'but', 36 | 'his', 37 | 'by', 38 | 'we', 39 | 'her', 40 | 'she', 41 | 'or', 42 | 'an', 43 | 'my', 44 | 'so', 45 | 'up', 46 | 'if', 47 | 'go', 48 | 'me', 49 | 'no', 50 | 'him', 51 | 'its', 52 | "it's", 53 | 'us' 54 | ] 55 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/main.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import ReactDOM from 'react-dom/client' 18 | import App from './App' 19 | import './styles/app.scss' 20 | 21 | ReactDOM.createRoot(document.getElementById('root')).render() 22 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/src/styles/variables.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | $desktop: 768px; 18 | 19 | $height_l: 550px; 20 | $height_xl: 720px; 21 | 22 | $black: #000000; 23 | $white: #ffffff; 24 | $gray: #5f6368; 25 | $light_grey: #f1f3f4; 26 | $medium_grey: #dadce0; 27 | $dark_grey: #3c4043; 28 | $orange: #af5a00; 29 | $bright_orange: #fbbc04; 30 | $dark_orange: #9f5100; 31 | $light_orange: #fef7e0; 32 | $drop_shadow: #feefc3; 33 | 34 | $dark: #151515; 35 | $tomato: #e24326; 36 | $mid_grey: #666666; 37 | 38 | $highlight_guess: #fde293; 39 | $highlight_forbidden: #f6aea9; 40 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/staging.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | service: staging 16 | 17 | runtime: python39 18 | 19 | handlers: 20 | - url: / 21 | static_files: dist/index.html 22 | upload: dist/index.html 23 | 24 | - url: /(.*) 25 | static_files: dist/\1 26 | upload: dist/(.*) 27 | -------------------------------------------------------------------------------- /demos/palm/web/quick-prompt/vite.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import path from 'path' 18 | import {defineConfig} from 'vite' 19 | import react from '@vitejs/plugin-react' 20 | 21 | export default defineConfig({ 22 | server: {port: 5555}, 23 | plugins: [react()], 24 | resolve: { 25 | alias: { 26 | '~': path.resolve(__dirname, './src') 27 | } 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We would love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows [Google's Open Source Community 24 | Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) 32 | for this purpose. 33 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/docs/llm_prompt_design_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/docs/llm_prompt_design_diagram.png -------------------------------------------------------------------------------- /demos/palm/web/talking-character/docs/talking-character-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/docs/talking-character-demo.gif -------------------------------------------------------------------------------- /demos/palm/web/talking-character/docs/talking-character-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/docs/talking-character-header.png -------------------------------------------------------------------------------- /demos/palm/web/talking-character/docs/talking-character-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/docs/talking-character-screen.png -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/Doggo07.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/Doggo07.glb -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/ZEPETO_TORSO_3_clean2.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/ZEPETO_TORSO_3_clean2.glb -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/favicon.ico -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/logo192.png -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/logo512.png -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.data -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.fetch.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.fetch.js -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.html -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.mem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.mem -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.wasm -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.wasm.debug.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.wasm.debug.wasm -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.wasm.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.wasm.map -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.worker.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_blendshapes_internal.worker.js -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_demo.binarypb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_demo.binarypb -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v1/talking_heads_microphone_assets.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v1/talking_heads_microphone_assets.data -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.data -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.fetch.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.fetch.js -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.html -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.mem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.mem -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.wasm -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.wasm.debug.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.wasm.debug.wasm -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.wasm.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.wasm.map -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.worker.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_blendshapes_internal.worker.js -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_demo.binarypb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_demo.binarypb -------------------------------------------------------------------------------- /demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_microphone_assets.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/talking-character/public/talking_head_v2/talking_heads_v2_microphone_assets.data -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import { render, screen } from '@testing-library/react'; 19 | import { App } from './App'; 20 | 21 | test('renders learn react link', () => { 22 | render(); 23 | const linkElement = screen.getByText(/learn react/i); 24 | expect(linkElement).toBeInTheDocument(); 25 | }); 26 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/App.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import './App.css'; 19 | 20 | import { BrowserRouter } from 'react-router-dom'; 21 | import { Router } from './routes'; 22 | 23 | /** App */ 24 | export function App() { 25 | return ( 26 | 27 | 28 | 29 | ); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/components/Layout/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | 19 | /** Main Layout Props */ 20 | export interface MainLayoutProps { 21 | children: React.ReactNode; 22 | } 23 | 24 | /** Layout component. */ 25 | export function Layout(props : MainLayoutProps) { 26 | return ( 27 |
34 | {props.children} 35 |
36 | ); 37 | } -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/components/ThreeJS/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | 19 | /** ThreeJS component. */ 20 | export function ThreeJS() { 21 | return (
ThreeJS
); 22 | } -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/context/constants.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export const GOOGLE_CLOUD_API_KEY = ''; // Fill in your API key 18 | 19 | export const LANGUAGE_MODEL_API_KEY = ''; // Fill in your API key 20 | 21 | export const LANGUAGE_MODEL_BASE_URL = 22 | 'https://generativelanguage.googleapis.com'; 23 | 24 | export const LANGUAGE_MODEL_URL = `${ 25 | LANGUAGE_MODEL_BASE_URL}/v1beta1/models/chat-bison-001:generateMessage?key=${ 26 | LANGUAGE_MODEL_API_KEY}`; 27 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /// 18 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import {ReportHandler} from 'web-vitals'; 18 | 19 | /** Report web vitals v */ 20 | export function reportWebVitals(onPerfEntry?: ReportHandler) { 21 | if (onPerfEntry && onPerfEntry instanceof Function) { 22 | import('web-vitals').then(({getCLS, getFID, getFCP, getLCP, getTTFB}) => {getCLS(onPerfEntry); getFID(onPerfEntry); getFCP(onPerfEntry); getLCP(onPerfEntry); getTTFB(onPerfEntry);}); 23 | } 24 | } -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/routes/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import { useRoutes } from 'react-router-dom'; 19 | import Character from '../pages/character'; 20 | import Personality from '../pages/personality'; 21 | 22 | /** Router */ 23 | export function Router() { 24 | return useRoutes([ 25 | { 26 | path: '/', 27 | element: , 28 | }, 29 | { 30 | path: '/personality', 31 | element: , 32 | }, 33 | ]); 34 | } 35 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 18 | // allows you to do things like: 19 | // expect(element).toHaveTextContent(/react/i) 20 | // learn more: https://github.com/testing-library/jest-dom 21 | import '@testing-library/jest-dom'; 22 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/third_party/METADATA: -------------------------------------------------------------------------------- 1 | name: "Mediapipe" 2 | description: 3 | "Cross-platform, customizable ML solutions for live and streaming media." 4 | 5 | third_party { 6 | url { 7 | type: GIT 8 | value: "https://github.com/google/mediapipe" 9 | } 10 | version: "0.9.3.0" 11 | last_upgrade_date { year: 2023 month: 05 day: 24 } 12 | license_type: PERMISSIVE 13 | local_modifications: "None" 14 | } 15 | -------------------------------------------------------------------------------- /demos/palm/web/talking-character/third_party/mediapipe/web/graph_runner/platform_utils.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 The MediaPipe Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** Returns whether the underlying rendering engine is WebKit. */ 18 | export function isWebKit(browser = navigator) { 19 | const userAgent = browser.userAgent; 20 | // Note that this returns true for Chrome on iOS (which is running WebKit) as 21 | // it uses "CriOS". 22 | return userAgent.includes('Safari') && !userAgent.includes('Chrome'); 23 | } -------------------------------------------------------------------------------- /demos/palm/web/talking-character/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "types": [ 10 | "@types/dom-speech-recognition" 11 | ], 12 | "allowJs": true, 13 | "skipLibCheck": true, 14 | "esModuleInterop": true, 15 | "allowSyntheticDefaultImports": true, 16 | "strict": true, 17 | "forceConsistentCasingInFileNames": true, 18 | "noFallthroughCasesInSwitch": true, 19 | "module": "esnext", 20 | "moduleResolution": "node", 21 | "resolveJsonModule": true, 22 | "isolatedModules": true, 23 | "noEmit": true, 24 | "jsx": "react-jsx", 25 | "downlevelIteration": true }, 26 | "include": [ 27 | "src" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ -------------------------------------------------------------------------------- /demos/palm/web/textfx/.gcloudignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | src/ 3 | public/ 4 | package.json 5 | package-lock.json 6 | vite.config.js 7 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | tsconfig.tsbuildinfo 27 | *.tsbuildinfo 28 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "bracketSpacing": false, 4 | "endOfLine": "lf", 5 | "printWidth": 80, 6 | "semi": false, 7 | "singleQuote": true, 8 | "tabWidth": 2, 9 | "trailingComma": "none" 10 | } 11 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows 24 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use GitHub pull requests for this purpose. Consult 32 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 33 | information on using pull requests. 34 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/app.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | runtime: python39 16 | 17 | handlers: 18 | - url: / 19 | static_files: dist/index.html 20 | upload: dist/index.html 21 | 22 | - url: /(.*) 23 | static_files: dist/\1 24 | upload: dist/(.*) 25 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/dev.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | service: dev 16 | 17 | runtime: python39 18 | 19 | handlers: 20 | - url: / 21 | static_files: dist/index.html 22 | upload: dist/index.html 23 | 24 | - url: /(.*) 25 | static_files: dist/\1 26 | upload: dist/(.*) 27 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/android-chrome-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/public/android-chrome-144x144.png -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/public/apple-touch-icon.png -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/assets/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/public/assets/loading.gif -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | #da532c 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/public/favicon-16x16.png -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/public/favicon-32x32.png -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/public/favicon.ico -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/public/mstile-150x150.png -------------------------------------------------------------------------------- /demos/palm/web/textfx/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-144x144.png", 7 | "sizes": "144x144", 8 | "type": "image/png" 9 | } 10 | ], 11 | "theme_color": "#ffffff", 12 | "background_color": "#ffffff", 13 | "display": "standalone" 14 | } 15 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/assets/images/landing-right-col-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/src/assets/images/landing-right-col-background.jpg -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/assets/images/landing-video-poster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/src/assets/images/landing-video-poster.jpg -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/assets/images/welcome/welcome-step-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/src/assets/images/welcome/welcome-step-1.jpg -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/assets/images/welcome/welcome-step-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/src/assets/images/welcome/welcome-step-2.jpg -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/assets/images/welcome/welcome-step-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/textfx/src/assets/images/welcome/welcome-step-3.jpg -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/checkbox/checkbox.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import styles from './checkbox.module.scss' 18 | 19 | interface ICheckbox { 20 | checked: boolean 21 | onChange: any 22 | } 23 | 24 | const Checkbox = ({checked, onChange}: ICheckbox) => { 25 | return ( 26 | 30 | ) 31 | } 32 | 33 | export default Checkbox 34 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/icon/icon-set/arrow.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const Arrow = (props: any) => { 18 | return ( 19 | 27 | 31 | 32 | ) 33 | } 34 | 35 | export default Arrow 36 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/icon/icon-set/dropdown.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const Dropdown = (props: any) => { 18 | return ( 19 | 27 | 28 | 29 | ) 30 | } 31 | 32 | export default Dropdown 33 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/icon/icon-set/pinSolid.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const PinSolid = (props: any) => { 18 | return ( 19 | 27 | 31 | 32 | ) 33 | } 34 | 35 | export default PinSolid 36 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/icon/icon-set/save.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const Save = (props: any) => { 18 | return ( 19 | 27 | 33 | 34 | ) 35 | } 36 | 37 | export default Save 38 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/icon/icon-set/saved.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const Saved = (props: any) => { 18 | return ( 19 | 27 | 31 | 32 | ) 33 | } 34 | 35 | export default Saved 36 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/icon/icon-set/swiperArrow.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const SwiperArrow = (props: any) => { 18 | return ( 19 | 27 | 31 | 32 | ) 33 | } 34 | 35 | export default SwiperArrow 36 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/icon/icon.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | .icon { 18 | aspect-ratio: 1/1; 19 | height: auto; 20 | } 21 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/input/input.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '~/styles/variables'; 18 | 19 | .root { 20 | -webkit-appearance: none; 21 | background: transparent; 22 | border: none; 23 | border-bottom: 1px solid $white; 24 | border-radius: 0; 25 | box-shadow: none; 26 | color: $white; 27 | font-family: 'Google Sans Display'; 28 | font-size: 24px; 29 | font-style: normal; 30 | font-weight: 400; 31 | height: 40px; 32 | outline: none; 33 | width: auto; 34 | } 35 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/input/input.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import styles from './input.module.scss' 18 | import c from 'classnames' 19 | 20 | interface IInput { 21 | label: string 22 | onChange: (value: string) => void 23 | autoFocus?: boolean 24 | disabled?: boolean 25 | [x: string]: any 26 | } 27 | 28 | const Input = ({label, onChange, ...rest}: IInput) => { 29 | return ( 30 | onChange(e.target.value)} 33 | className={c(styles.root)} 34 | placeholder={label} 35 | {...rest} 36 | /> 37 | ) 38 | } 39 | 40 | export default Input 41 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/portal/portal.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import {useEffect} from 'react' 18 | import ReactDOM from 'react-dom' 19 | 20 | function Portal({children}: any) { 21 | useEffect(() => { 22 | const el = document.createElement('div') 23 | document.getElementById('root')?.appendChild(el) 24 | 25 | return () => { 26 | // document.body.removeChild(el) 27 | document.getElementById('root')?.removeChild(el) 28 | } 29 | }, []) 30 | 31 | return ReactDOM.createPortal( 32 | children, 33 | document.getElementById('root') || document.body 34 | ) 35 | } 36 | 37 | export default Portal 38 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/speechToText/speechToText.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | .root { 18 | height: 4.8rem; 19 | position: relative; 20 | width: 4.8rem; 21 | } 22 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/components/generic/viewAllToggle/viewAllToggle.module.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import '~/styles/variables'; 18 | 19 | .root { 20 | border: 1px solid $toggle_grey; 21 | border-radius: 100px; 22 | color: $toggle_grey; 23 | display: inline-block; 24 | font-family: $font_text; 25 | font-size: 0.9rem; 26 | font-weight: 700; 27 | height: 2rem; 28 | letter-spacing: 0.1rem; 29 | line-height: 1.9rem; 30 | padding: 0 0.8rem; 31 | text-transform: uppercase; 32 | transition: $fadeDuration ease; 33 | white-space: nowrap; 34 | 35 | &:hover { 36 | border-color: $light; 37 | color: $light; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/hooks/useOnScreen.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import {useEffect, useState} from 'react' 18 | 19 | const useOnScreen = (ref: any, rootMargin = '0px 0px 0px 0px') => { 20 | const [onScreen, setOnScreen] = useState(false) 21 | 22 | useEffect(() => { 23 | const observer = new IntersectionObserver( 24 | ([entry]) => { 25 | setOnScreen(entry.isIntersecting) 26 | }, 27 | { 28 | rootMargin 29 | } 30 | ) 31 | 32 | observer.observe(ref.current) 33 | 34 | return () => { 35 | observer.disconnect() 36 | } 37 | }, [ref]) 38 | 39 | return onScreen 40 | } 41 | 42 | export default useOnScreen 43 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export const find = ( 18 | querySelector: string, 19 | element: Document | HTMLElement | HTMLDivElement | any = document 20 | ) => Array.prototype.slice.call(element.querySelectorAll(querySelector)) 21 | 22 | export const scrollIntoViewWithOffset = (elementRef: any, offset: number) => { 23 | const mainScreenEl = find('.js-mainScreen')[0] 24 | mainScreenEl?.scrollTo({ 25 | behavior: 'smooth', 26 | top: elementRef.current.offsetTop - offset 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/main.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import ReactDOM from 'react-dom/client' 18 | import App from './App' 19 | 20 | import './styles/app.scss' 21 | 22 | const root = document.getElementById('root') 23 | if (root) { 24 | ReactDOM.createRoot(root).render() 25 | } 26 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/styles/app.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @import './variables.scss'; 18 | 19 | @import 'swiper/scss'; 20 | @import 'swiper/scss/pagination'; 21 | 22 | @import './base.scss'; 23 | @import './typography.scss'; 24 | @import './tooltip.scss'; 25 | 26 | :root { 27 | --color-highlight: #{$tennis}; 28 | } 29 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/styles/tooltip.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | .tippy-box { 18 | background-color: $dark; 19 | border-radius: 8px; 20 | color: $white; 21 | font-size: 1.1rem; 22 | line-height: 1.5rem; 23 | } 24 | 25 | .tippy-content { 26 | padding: 6px 8px; 27 | } 28 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/src/styles/typography.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | h1, 18 | h2, 19 | h3 { 20 | font-family: $font_heading; 21 | } 22 | 23 | h1 { 24 | font-family: $font_heading; 25 | font-size: 4.8rem; 26 | font-weight: 400; 27 | letter-spacing: -0.05em; 28 | line-height: 1; 29 | 30 | @media screen and (min-width: $large) { 31 | font-size: 7.2rem; 32 | } 33 | } 34 | 35 | p { 36 | font-size: $base_font_size; 37 | line-height: 2.1rem; 38 | } 39 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/staging.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | service: staging 16 | 17 | runtime: python39 18 | 19 | handlers: 20 | - url: / 21 | static_files: dist/index.html 22 | upload: dist/index.html 23 | 24 | - url: /(.*) 25 | static_files: dist/\1 26 | upload: dist/(.*) 27 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "baseUrl": ".", 5 | "downlevelIteration": true, 6 | "esModuleInterop": true, 7 | "forceConsistentCasingInFileNames": true, 8 | "incremental": true, 9 | "isolatedModules": true, 10 | "jsx": "preserve", 11 | "lib": ["dom", "dom.iterable", "esnext"], 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "noEmit": true, 15 | "paths": { 16 | "~/*": ["./src/*"] 17 | }, 18 | "plugins": [ 19 | { 20 | "name": "typescript-plugin-css-modules" 21 | } 22 | ], 23 | "resolveJsonModule": true, 24 | "skipLibCheck": true, 25 | "strict": true, 26 | "target": "es5", 27 | "types": ["vite/client"] 28 | }, 29 | "exclude": ["node_modules"], 30 | "include": ["**/*.ts", "**/*.tsx"] 31 | } 32 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | declare module '*.module.scss' 18 | -------------------------------------------------------------------------------- /demos/palm/web/textfx/vite.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import path from 'path' 18 | import {defineConfig} from 'vite' 19 | import react from '@vitejs/plugin-react' 20 | 21 | export default defineConfig({ 22 | server: {port: 5555}, 23 | plugins: [react()], 24 | resolve: { 25 | alias: { 26 | '~': path.resolve(__dirname, './src') 27 | } 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/.env: -------------------------------------------------------------------------------- 1 | VITE_GOOGLE_MAPS_API_KEY="" 2 | VITE_GOOGLE_GENERATIVE_LANGUAGE_API_KEY="" -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/.eslintignore: -------------------------------------------------------------------------------- 1 | // .eslintignore 2 | build/* 3 | public/* 4 | src/service-worker.js 5 | src/serviceWorkerRegistration.js 6 | src/setupTests.js 7 | src/reportWebVitals.js 8 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/.gcloudignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | /[!.]* 3 | /.?* 4 | 5 | # Except the Cloud Function files we want to deploy 6 | !/app.yaml 7 | !/dist/** 8 | !/main.py 9 | !/requirements.txt 10 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Python 27 | .venv 28 | __pycache__ 29 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | package-lock.json 4 | public 5 | 6 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "tabWidth": 2 6 | } 7 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/CONTRIBUTING: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement (CLA). You (or your employer) retain the copyright to your 10 | contribution; this simply gives us permission to use and redistribute your 11 | contributions as part of the project. Head over to 12 | to see your current agreements on file or 13 | to sign a new one. 14 | 15 | You generally only need to submit a CLA once, so if you've already submitted one 16 | (even if it was for a different project), you probably don't need to do it 17 | again. 18 | 19 | ## Code Reviews 20 | 21 | All submissions, including submissions by project members, require review. We 22 | use GitHub pull requests for this purpose. Consult 23 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 24 | information on using pull requests. 25 | 26 | ## Community Guidelines 27 | 28 | This project follows 29 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/app.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | runtime: nodejs18 16 | 17 | handlers: 18 | - url: / 19 | static_files: dist/index.html 20 | upload: dist/index.html 21 | 22 | - url: /chat 23 | static_files: dist/index.html 24 | upload: dist/index.html 25 | 26 | - url: /(.*) 27 | static_files: dist/\1 28 | upload : dist/(.*) 29 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/config-overrides.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const webpack = require('webpack'); 18 | 19 | module.exports = function override(config) { 20 | config.resolve.fallback = { 21 | process: require.resolve('process/browser'), 22 | zlib: require.resolve('browserify-zlib'), 23 | stream: require.resolve('stream-browserify'), 24 | util: require.resolve('util'), 25 | buffer: require.resolve('buffer'), 26 | asset: require.resolve('assert'), 27 | }; 28 | 29 | config.plugins.push( 30 | new webpack.ProvidePlugin({ 31 | process: 'process/browser.js', 32 | Buffer: ['buffer', 'Buffer'], 33 | }) 34 | ); 35 | 36 | return config; 37 | }; 38 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/docs/llm_prompt_design_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/docs/llm_prompt_design_diagram.png -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/docs/wanderlust_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/docs/wanderlust_demo.gif -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/docs/wanderlust_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/docs/wanderlust_demo.png -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/docs/wanderlust_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/docs/wanderlust_header.png -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "baseUrl": "." 6 | }, 7 | "include": ["src/**/*", "config-overrides.js"], 8 | "exclude": ["node_modules"] 9 | } 10 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/public/onboarding.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/public/onboarding.jpg -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/App.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #root { 18 | margin: 0 auto; 19 | /* background-color: #cbcbcb; */ 20 | background-color: #FCF6F2; 21 | } 22 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import './App.css'; 19 | 20 | function App() { 21 | return
; 22 | } 23 | 24 | export default App; 25 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/components/Layout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import Div100vh from 'react-div-100vh'; 19 | 20 | export default function ({ children }) { 21 | return {children}; 22 | } 23 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/components/MainLayout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import { Container } from '@mui/material'; 19 | 20 | import Router from 'src/routes'; 21 | import { BrowserRouter } from 'react-router-dom'; 22 | import Layout from './Layout'; 23 | 24 | export default function () { 25 | return ( 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Bold.ttf -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-BoldItalic.ttf -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Italic.ttf -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Medium.ttf -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-MediumItalic.ttf -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/demos/palm/web/travel-planner/src/fonts/GoogleSans/GoogleSans-Regular.ttf -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/guards/GuestGuard.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import PropTypes from 'prop-types'; 19 | import { Navigate } from 'react-router-dom'; 20 | import useAuth from '../hooks/useAuth'; 21 | 22 | // ---------------------------------------------------------------------- 23 | 24 | GuestGuard.propTypes = { 25 | children: PropTypes.node, 26 | }; 27 | 28 | export default function GuestGuard({ children }) { 29 | const { isAuthenticated } = useAuth(); 30 | if (isAuthenticated) { 31 | return ; 32 | } 33 | 34 | return <>{children}; 35 | } 36 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import ReactDOM from 'react-dom/client'; 19 | import App from './App'; 20 | import MainLayout from './components/MainLayout'; 21 | import './index.css'; 22 | import 'swiper/css'; 23 | import 'swiper/css/pagination'; 24 | 25 | ReactDOM.createRoot(document.getElementById('root')).render( 26 | 27 | 28 | 29 | 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/routes/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import { useRoutes } from 'react-router-dom'; 19 | import Index from 'src/pages'; 20 | import Onboarding from 'src/pages/onboarding'; 21 | 22 | export default function Router() { 23 | return useRoutes([ 24 | { 25 | path: 'chat', 26 | element: ( 27 | 28 | ), 29 | }, 30 | { 31 | path: '/', 32 | element: ( 33 | 34 | 35 | ) 36 | } 37 | ]); 38 | } 39 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/utils/fetchImage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | export const fetchImage = (imgSrc) => { 19 | return new Promise(async (resolve, reject) => { 20 | try { 21 | const res = await fetch(imgSrc, { method: 'GET', mode: "no-cors" }) 22 | if (res.status === 404) { 23 | reject(false) 24 | } else { 25 | resolve(true) 26 | } 27 | } catch (error) { 28 | reject(false) 29 | } 30 | }) 31 | } 32 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/utils/gtag.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export const signIn_GA = () => { 18 | if (window.gtag) { 19 | window.gtag("event", "sign_in", { 20 | 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/utils/iframeUtils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export const sendMessageToParent = (message) => { 18 | if(window.parent) { 19 | window.parent.postMessage( 20 | message, 21 | "*" 22 | ) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/utils/loadScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export const loadScript = (src) => 18 | new Promise((resolve, reject) => { 19 | if (document.querySelector(`script[src="${src}"]`)) return resolve(); 20 | const script = document.createElement("script"); 21 | script.src = src; 22 | script.onload = () => resolve(); 23 | script.onerror = (err) => reject(err); 24 | document.body.appendChild(script); 25 | }); 26 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/utils/prompt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const createBardPrompt = (msgs) => { 18 | const prompt = msgs.map( ({content, author} )=> {return { content, author}}) 19 | return prompt; 20 | } 21 | 22 | export { createBardPrompt }; 23 | -------------------------------------------------------------------------------- /demos/palm/web/travel-planner/src/utils/sleep.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export default function (ms) { 18 | return new Promise((resolve) => setTimeout(resolve, ms)); 19 | } 20 | -------------------------------------------------------------------------------- /examples/gemini/javascript/langchain_quickstart_node/.gitignore: -------------------------------------------------------------------------------- 1 | image.jpg 2 | -------------------------------------------------------------------------------- /examples/gemini/javascript/langchain_quickstart_node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gemini-langchain-quickstart-node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "main.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "node main.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "Apache-2.0", 13 | "private": true, 14 | "dependencies": { 15 | "@langchain/google-genai": "^0.0.7" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module" 7 | }, 8 | "plugins": [ 9 | "@typescript-eslint" 10 | ], 11 | "rules": { 12 | "@typescript-eslint/naming-convention": "warn", 13 | "@typescript-eslint/semi": "warn", 14 | "curly": "warn", 15 | "eqeqeq": "warn", 16 | "no-throw-literal": "warn", 17 | "semi": "off" 18 | }, 19 | "ignorePatterns": [ 20 | "out", 21 | "dist", 22 | "**/*.d.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | dist 3 | node_modules 4 | .vscode-test/ 5 | *.vsix 6 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Run Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "${defaultBuildTask}" 19 | }, 20 | { 21 | "name": "Extension Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "args": [ 25 | "--extensionDevelopmentPath=${workspaceFolder}", 26 | "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" 27 | ], 28 | "outFiles": [ 29 | "${workspaceFolder}/out/test/**/*.js" 30 | ], 31 | "preLaunchTask": "${defaultBuildTask}" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | src/** 4 | .gitignore 5 | .yarnrc 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/.eslintrc.json 9 | **/*.map 10 | **/*.ts 11 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "flutter-theme-agent" extension will be documented in this file. 4 | 5 | ## v0.0.1 6 | 7 | - Initial release. Provides commands for generating Flutter code for a ThemeData and the following components: ButtonStyle, ColorScheme, TextTheme. -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We would love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows [Google's Open Source Community 24 | Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) 32 | for this purpose. -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/flutter-theme-agent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/node/flutter_theme_agent/flutter-theme-agent.png -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/src/components/component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Provide instructions for the AI language model 18 | // This approach uses a few-shot technique, providing a few examples. 19 | export const PROMPT_PRIMING = ` 20 | You are an expert Flutter developer, your Flutter code is thorough, 21 | easily human readable and and up to date with the latest stable 22 | version of Flutter. You only provide the constructor object without 23 | any additional information and remove markdown formatting. The code can be inserted 24 | inline into existing code and works. 25 | `; 26 | 27 | -------------------------------------------------------------------------------- /examples/gemini/node/flutter_theme_agent/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2020", 5 | "outDir": "out", 6 | "lib": [ 7 | "ES2020" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "strict": false /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module" 7 | }, 8 | "plugins": [ 9 | "@typescript-eslint" 10 | ], 11 | "rules": { 12 | "@typescript-eslint/naming-convention": "warn", 13 | "@typescript-eslint/semi": "warn", 14 | "curly": "warn", 15 | "eqeqeq": "warn", 16 | "no-throw-literal": "warn", 17 | "semi": "off" 18 | }, 19 | "ignorePatterns": [ 20 | "out", 21 | "dist", 22 | "**/*.d.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | out 15 | 16 | # Editor directories and files 17 | .idea 18 | .DS_Store 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | 25 | tsconfig.tsbuildinfo 26 | *.tsbuildinfo 27 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Run Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "${defaultBuildTask}" 19 | }, 20 | { 21 | "name": "Extension Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "args": [ 25 | "--extensionDevelopmentPath=${workspaceFolder}", 26 | "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" 27 | ], 28 | "outFiles": [ 29 | "${workspaceFolder}/out/test/**/*.js" 30 | ], 31 | "preLaunchTask": "${defaultBuildTask}" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | src/** 4 | .gitignore 5 | .yarnrc 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/.eslintrc.json 9 | **/*.map 10 | **/*.ts 11 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "pipet-code-agent" extension are documented in this file. 4 | 5 | ## v0.0.1 6 | 7 | - Initial release. Provides commands for generating code comments and code reviews 8 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We would love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows [Google's Open Source Community 24 | Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) 32 | for this purpose. -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/pipet-snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/node/pipet-code-agent/pipet-snippet.png -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/src/extension.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import * as vscode from 'vscode'; 18 | import { generateComment } from './comments'; 19 | import { generateReview } from './review'; 20 | 21 | 22 | export function activate(context: vscode.ExtensionContext) { 23 | vscode.commands.registerCommand('pipet-code-agent.commentCode', generateComment); 24 | vscode.commands.registerCommand('pipet-code-agent.reviewCode', generateReview); 25 | } 26 | 27 | 28 | export function deactivate() { } 29 | -------------------------------------------------------------------------------- /examples/gemini/node/pipet-code-agent/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2020", 5 | "outDir": "out", 6 | "lib": [ 7 | "ES2020" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "strict": true /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We would love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our Community Guidelines 22 | 23 | This project follows [Google's Open Source Community 24 | Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code Reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) 32 | for this purpose. 33 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/apps_script/main.gs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Defines the gmail search query for saving emails to markdown 18 | var SEARCH_QUERY = 'subject: psa to:my-mailing-list@example.com'; 19 | // Defines the directory to output the emails in markdown format 20 | var folderOutput = "PSA-output" 21 | // Defines the directory that has your docs content 22 | var folderInput = "input-folder" 23 | 24 | function main() { 25 | convertDriveFolderToMDForDocsAgent(folderInput); 26 | exportEmailsToMarkdown(SEARCH_QUERY, folderOutput); 27 | } 28 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/apps-script-screenshot-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/apps-script-screenshot-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-architecture-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-architecture-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-architecture-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-architecture-02.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-benchmarks-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-benchmarks-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-chat-app-screenshot-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-chat-app-screenshot-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-embeddings-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-embeddings-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-embeddings-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-embeddings-02.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-pre-processing-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-pre-processing-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-prompt-structure-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-prompt-structure-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs/images/docs-agent-ui-screenshot-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs/images/docs-agent-ui-screenshot-01.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/agents/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/agents/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/benchmarks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/benchmarks/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/benchmarks/results.out: -------------------------------------------------------------------------------- 1 | Similarity (-1, 1) Question 2 | ================== ======== 3 | 0.9693597667161213 What is inside the Flutter SDK? 4 | 0.8810758779307981 Does Flutter work with any editors or IDEs? 5 | 0.8760932771858571 Does Flutter come with a framework? 6 | 0.8924252745816632 Does Flutter come with widgets? 7 | 0.8637181105900334 Does Flutter support Material Design? 8 | 0.9340505894484676 Does Flutter come with a testing framework? 9 | 0.9192416276439515 Does Flutter come with debugging tools? 10 | 0.7491969164696617 Does Flutter come with a dependency injection framework? 11 | 0.7895399136265219 What technology is Flutter built with? 12 | 0.7802681514431923 What language is Flutter written in? 13 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/interfaces/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | from flask import Flask 18 | from docs_agent.interfaces.chatbot import chatui 19 | from docs_agent.utilities import config 20 | 21 | 22 | def create_app(product: config.ProductConfig, app_mode: str = "web"): 23 | app = Flask(__name__) 24 | app.register_blueprint(chatui.construct_blueprint(product_config=product, app_mode=app_mode)) 25 | return app 26 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/static/css/chatbox.css: -------------------------------------------------------------------------------- 1 | ../../../../../third_party/css/chatbox.css -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/static/css/style-logs.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | .log-pre { 18 | font-size: small; 19 | font-family: monospace; 20 | text-wrap: pretty; 21 | word-break: break-all; 22 | } 23 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/static/images/favicon.png -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/admin/debugs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ product }} Docs Agent admin page 10 | 11 | 12 | {% if debug_info %} 13 |
14 |

{{ product }} Docs Agent

15 |
16 |
17 |

Debug information

18 |
{{ debug_info }}
19 |

20 |
21 |
22 | {% endif %} 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/admin/logs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ product }} Docs Agent admin page 10 | 11 | 12 | {% if logs %} 13 |
14 |

{{ product }} Docs Agent

15 |
16 |
17 |

Answerable scores

18 |
{{ answerable_logs }}
19 |

Logs

20 |
{{ logs }}
21 |

22 |
23 |
24 | {% endif %} 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-experimental/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ product }} ChatBot 9 | 10 | 11 |
12 |

{{ product }} Docs Agent

13 |
14 |
15 | {% block content %} {% endblock %} 16 |
17 |
18 |
19 |
20 |
21 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-experimental/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'chatui/base.html' %} 2 | 3 | {% block content %} 4 | 10 | 13 | {% if response %} 14 |
15 | {% include 'chatui-experimental/result.html' %} 16 |
17 | {% endif %} 18 | {% endblock %} -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-full/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ product }} ChatBot 9 | 10 | 11 |
12 |

{{ product }} Docs Agent 1.5

13 |
14 |
15 | {% block content %} {% endblock %} 16 |
17 |
18 |
19 |
20 |
21 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-full/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'chatui-full/base.html' %} 2 | 3 | {% block content %} 4 | 10 | 11 | {% if response %} 12 |
13 | {% include 'chatui-full/result.html' %} 14 |
15 | {% endif %} 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-widget-pro/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ product }} ChatBot 9 | 10 | 11 |
12 |

{{ product }} Docs Agent 1.5

13 |
14 |
15 | {% block content %} {% endblock %} 16 |
17 |
18 |
19 |
20 |
21 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-widget-pro/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'chatui-widget-pro/base.html' %} 2 | 3 | {% block content %} 4 | 10 | 11 | {% if response %} 12 |
13 | {% include 'chatui-widget-pro/result.html' %} 14 |
15 | {% endif %} 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-widget/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ product }} ChatBot 9 | 10 | 11 |
12 |

{{ product }} Docs Agent

13 |
14 |
15 | {% block content %} {% endblock %} 16 |
17 |
18 |
19 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui-widget/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'chatui-widget/base.html' %} 2 | 3 | {% block content %} 4 | 10 | 11 | {% if response %} 12 |
13 | {% include 'chatui-widget/result.html' %} 14 |
15 | {% endif %} 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ product }} ChatBot 9 | 10 | 11 |
12 |

{{ product }} Docs Agent

13 |
14 |
15 | {% block content %} {% endblock %} 16 |
17 |
18 |
19 |
20 |
21 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/chatbot/templates/chatui/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'chatui/base.html' %} 2 | 3 | {% block content %} 4 | 10 | 11 | {% if response %} 12 |
13 | {% include 'chatui/result.html' %} 14 |
15 | {% endif %} 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/interfaces/cli/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/interfaces/cli/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/memory/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/memory/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/models/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/models/aqa.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | from docs_agent.models.aqa_models import AQA 18 | from docs_agent.models.base import AQAModel 19 | 20 | 21 | class AQAModelFactory: 22 | """Factory for creating AQA model instances.""" 23 | 24 | @staticmethod 25 | def create_model() -> AQAModel: 26 | """Creates and returns an AQA model instance.""" 27 | return AQA() 28 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/models/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/models/tools/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/postprocess/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/postprocess/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/preprocess/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/preprocess/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/preprocess/splitters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/preprocess/splitters/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/storage/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/storage/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/tests/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/tests/cli_unit_tests.py: -------------------------------------------------------------------------------- 1 | """Unit tests for Docs Agent CLI.""" 2 | 3 | import unittest 4 | 5 | 6 | class DocsAgentCLIUnitTest(unittest.TestCase): 7 | def test_basic(self): 8 | self.assertEqual('hello'.upper(), 'HELLO') 9 | 10 | if __name__ == "__main__": 11 | unittest.main() 12 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/tests/utilities/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/tests/utilities/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/docs_agent/utilities/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/docs_agent/utilities/__init__.py -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/scripts/tellme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright 2023 Google LLC 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | # IF NECESSARY, ADJUST THIS PATH TO YOUR `docs-agent` DIRECTORY. 20 | docs_agent_dir="$HOME/docs-agent" 21 | 22 | # Check if the POETRY_ACTIVE environment variable is set 23 | if [ -z "$POETRY_ACTIVE" ]; then 24 | cd "$docs_agent_dir" && poetry run agent tellme $@ 25 | else 26 | agent tellme $@ 27 | fi 28 | 29 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/tasks/describe-images-from-doc-replace.yaml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - name: "DescribeImagesFromDocReplace" 3 | model: "models/gemini-2.0-flash" 4 | description: > 5 | An agent that extracts all image files names in an input doc and generates alt text for the images. 6 | preamble: > 7 | When you generate a response for alt text, your suggestion should not start with Picture of, Image 8 | of, or Screenshot of. Your new alt text suggestion must be fewer than 125 characters. Do not exceed 9 | 125 characters. Provide the option that is most suitable for alt text. Output only the alt text 10 | suggestion. Do not include any explanations or commentary. Do not include end punctuation. 11 | steps: 12 | - prompt: "extract_replace_image_alt_text.py" 13 | function: "script" 14 | description: > 15 | This script extract all image files found in the input file and store the list of image file 16 | names in the agent_out/image_paths.txt file. 17 | flags: 18 | script_input: "" 19 | default_input: "./README.md" 20 | 21 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/tasks/extract-workflows-task.yaml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - name: "ExtractWorkflows" 3 | model: "models/gemini-2.0-flash" 4 | description: > 5 | An agent that extracts workflows from a source doc. 6 | steps: 7 | - prompt: > 8 | Summarize the contents of this document in a concise and informative manner. 9 | Focus on the key procedures, steps, or workflows described. 10 | flags: 11 | file: "" 12 | default_input: "./README.md" 13 | - prompt: > 14 | Identify and list all key workflows described in the document. Provide a brief 15 | description for each workflow, highlighting its purpose and key steps. 16 | - prompt: > 17 | Identify all command lines used in the workflows described in the document. 18 | Focus on command lines that are essential for executing the workflow steps. 19 | - prompt: > 20 | For each identified command line, provide a detailed description of its function 21 | and purpose. Include specific examples of its usage, showcasing how it is 22 | integrated within the workflows. 23 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/tasks/help-polish-prompts-task.yaml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - name: "HelpPolishPrompts" 3 | model: "models/gemini-1.5-flash-latest" 4 | description: > 5 | An agent that helps polish prompts in a task file. 6 | preamble: > 7 | When writing a prompt, always be direct and concise. 8 | steps: 9 | - prompt: > 10 | Revise the prompts in this task YAML file to improve their effectiveness 11 | in generating responses. 12 | flags: 13 | file: "" 14 | default_input: "./tasks/index-page-generator-task.yaml" 15 | file_ext: "yaml" 16 | - prompt: > 17 | Replace the original prompts in the task YAML file with the revised prompts. 18 | - prompt: > 19 | Suggest additional prompts relevant to the main task in this task YAML file. 20 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/tasks/prepare-podcast-from-dir.yaml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - name: "PreparePodcasteFromDir" 3 | model: "models/gemini-1.5-pro-latest" 4 | description: "An agent that helps prepare a podcast from a directory of markdown files." 5 | preamble: "When writing a prompt, always be direct and concise." 6 | steps: 7 | - prompt: "Read these documentation files and create a markdown document 8 | that highlights the parts that are to the most interesting to talk 9 | about in a podcast. Make sure to also include 10 | interesting topics to talk about. Most listeners will be software 11 | engineers, so make sure to highlight technical topics. Also make sure 12 | the conversation flows well and is centered around using tooling 13 | when possible. You should list at least 5 high level topics to talk about. 14 | At the top of the file include the text: \"Use this script to organize 15 | the podcast show that you are about to record.\"" 16 | flags: 17 | allfiles: "" 18 | default_input: "~/docs/" 19 | file_ext: "md" 20 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/tasks/release-notes-task.yaml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - name: "DraftReleaseNotes" 3 | model: "models/gemini-1.5-flash" 4 | description: "An agent that generates a draft of Docs Agent release notes from git commit messages." 5 | preamble: "When generating release notes, limit the total number of key features and updates to 5 or fewer entries." 6 | steps: 7 | - prompt: "git --no-pager log --since=2024-06-15" 8 | function: "posix" 9 | description: "Load the git log commit messages from the local Docs Agent checkout since a target date." 10 | - prompt: "Please extract a list of key features and improvements from the provided git log commit messages, focusing on those that are most impactful and relevant for developers." 11 | - prompt: "Based on the extracted key features and improvements, write a concise and informative release notes draft. Use clear and concise language, focusing on the benefits and value provided to developers." 12 | - prompt: "Revise the release notes draft to enhance readability and structure. Format the release notes using bullet points for clarity and limit each entry to a maximum of two sentences." 13 | 14 | -------------------------------------------------------------------------------- /examples/gemini/python/docs-agent/vector_stores/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/generative-ai-docs/64dfc59c429d9cf45841351d532e58a61c941bcc/examples/gemini/python/docs-agent/vector_stores/.gitkeep -------------------------------------------------------------------------------- /examples/palm/README.md: -------------------------------------------------------------------------------- 1 | # PaLM API examples 2 | 3 | Herein lies example code referenced by the PaLM API site. 4 | 5 | Examples are typically small, single-purpose code used to demonstrate one 6 | specific concept. They should still compile but may be very minimal. 7 | 8 | Larger examples live in the [`demos/`](../../demos/palm) directory. 9 | 10 | -------------------------------------------------------------------------------- /examples/palm/java/DELETEME: -------------------------------------------------------------------------------- 1 | Placeholder to reserve directory structure until files are added. 2 | -------------------------------------------------------------------------------- /examples/palm/python/DELETEME: -------------------------------------------------------------------------------- 1 | Placeholder to reserve directory structure until files are added. 2 | -------------------------------------------------------------------------------- /site/en/README.md: -------------------------------------------------------------------------------- 1 | # Generative AI Developer Docs 2 | 3 | These are the source files for the Generative AI and PaLM API site. The 4 | structure from this directory mirrors the site from the root. 5 | -------------------------------------------------------------------------------- /third_party/README.md: -------------------------------------------------------------------------------- 1 | # third-party content 2 | 3 | Each individual sub-project is managing its own third-party contents. They will 4 | be symlinked from here. 5 | -------------------------------------------------------------------------------- /third_party/docs-agent: -------------------------------------------------------------------------------- 1 | ../examples/gemini/python/docs-agent/third_party -------------------------------------------------------------------------------- /third_party/mood-food: -------------------------------------------------------------------------------- 1 | ../demos/palm/web/mood-food/third_party --------------------------------------------------------------------------------