Skip to content

Commit

Permalink
Add canonical textgen samples (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored Jul 3, 2024
1 parent 5739e2a commit e23e99a
Show file tree
Hide file tree
Showing 20 changed files with 305 additions and 658 deletions.
21 changes: 0 additions & 21 deletions samples/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,6 @@ It’s strongly recommended that you do not check an API key into your version c

This sample assumes that you're providing an `API_KEY` environment variable.

## Features

### Simple examples

- [`simple-text.js`](simple-text.js) - Text-only input
- [`simple-text-and-images.js`](simple-text-and-images.js) - Text-and-images input (multimodal)
- [`simple-chat.js`](simple-chat.js) - Dialog language tasks, using `ChatSession` class
- [`simple-config.js`](simple-config.js) - Configuring model parameters
- [`simple-embedding.js`](simple-embedding.js) - Embeddings, using the `embedding-001` model

### More examples

- [`advanced-text.js`](advanced-text.js) - Using `countTokens`, `safetySettings` and streaming with a text-only input
- [`advanced-text-and-images.js`](advanced-text-and-images.js) - Using `countTokens`, `generationConfig` and streaming with multimodal input
- [`advanced-chat.js`](advanced-chat.js) - Using `countTokens`, `generationConfig` and streaming with multi-turn conversations
- [`advanced-embeddings.js`](advanced-embeddings.js) - Using `batchEmbedContents`
- [`advanced-function-calling.js`](advanced-function-calling.js) - Using function calling
- [`advanced-code-execution.js`](advanced-code-execution.js) - Using the code execution feature
- [`content-caching.js`](content-caching.js) - Using `GoogleAICacheManager`
- [`file-upload.js`](file-upload.js) - Using `GoogleAIFileManager`

## Documentation

- [Quickstart: Get started with the Gemini API in Node.js applications](https://ai.google.dev/tutorials/node_quickstart)
44 changes: 0 additions & 44 deletions samples/node/advanced-text.js

This file was deleted.

Binary file added samples/node/media/Big_Buck_Bunny.mp4
Binary file not shown.
Binary file added samples/node/media/firefighter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/node/media/jetpack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/node/media/piranha.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/node/media/samplesmall.mp3
Binary file not shown.
37 changes: 0 additions & 37 deletions samples/node/simple-text-and-images.js

This file was deleted.

34 changes: 0 additions & 34 deletions samples/node/simple-text.js

This file was deleted.

Loading

0 comments on commit e23e99a

Please sign in to comment.