diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 568d4d4110..a53ca044d0 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -17,7 +17,6 @@ assign_issues_by: - "api: asset" to: - GoogleCloudPlatform/cloud-asset-analysis-team - - GoogleCloudPlatform/cloud-asset-platform-team - labels: - 'api: bigtable' - 'api: datastore' @@ -47,7 +46,6 @@ assign_prs_by: - "api: asset" to: - GoogleCloudPlatform/cloud-asset-analysis-team - - GoogleCloudPlatform/cloud-asset-platform-team - labels: - 'api: bigtable' - 'api: datastore' diff --git a/.github/workflows/flakybot.yaml b/.github/workflows/flakybot.yaml index ee25e21394..a70cb87bba 100644 --- a/.github/workflows/flakybot.yaml +++ b/.github/workflows/flakybot.yaml @@ -28,26 +28,5 @@ jobs: contents: 'read' id-token: 'write' steps: - - name: authenticate - uses: 'google-github-actions/auth@62cf5bd3e4211a0a0b51f2c6d6a37129d828611d' # v2 - with: - workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider' - service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com' - create_credentials_file: 'true' - access_token_lifetime: 600s - - name: download test results - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 - with: - name: test-results - - name: download FlakyBot - run: | - curl -s -L https://github.com/googleapis/repo-automation-bots/archive/refs/tags/flakybot-v${{ env.FLAKYBOT_VERSION }}.tar.gz -o flakybot.tar.gz - tar xzf flakybot.tar.gz - cp -rT repo-automation-bots-flakybot-v${{ env.FLAKYBOT_VERSION}}/packages/flakybot/ . - - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 - with: - cache: true - cache-dependency-path: '${{ github.workspace }}/go.sum' - go-version-file: '${{ github.workspace }}/go.mod' - - name: run FlakyBot - run: go run flakybot.go --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + - name: DISABLED run FlakyBot + run: echo flakybot error reporting disabled \ No newline at end of file diff --git a/.github/workflows/security-center-snippets.yaml b/.github/workflows/security-center-snippets.yaml index bea58c672e..320f9eb07a 100644 --- a/.github/workflows/security-center-snippets.yaml +++ b/.github/workflows/security-center-snippets.yaml @@ -18,8 +18,7 @@ on: branches: - main paths: - - 'security-center/snippets/v1/**' - - 'security-center/snippets/package.json' + - 'security-center/snippets/**' - '.github/workflows/security-center-snippets.yaml' pull_request: types: diff --git a/.kokoro/build-with-appengine.sh b/.kokoro/build-with-appengine.sh index 2d12bbf62a..c7c452c5c5 100755 --- a/.kokoro/build-with-appengine.sh +++ b/.kokoro/build-with-appengine.sh @@ -61,19 +61,6 @@ trap cleanup EXIT HUP # Install dependencies and run tests npm install -# If tests are running against main, configure FlakyBot -# to open issues on failures: -if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"release"* ]]; then - export MOCHA_REPORTER_SUITENAME=${PROJECT} - notify_flakybot() { - # Call the original trap function. - cleanup - chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot - $KOKORO_GFILE_DIR/linux_amd64/flakybot - } - trap notify_flakybot EXIT HUP -fi - npm test exit $? diff --git a/.kokoro/build-with-run.sh b/.kokoro/build-with-run.sh index 989989ff06..94040df99d 100755 --- a/.kokoro/build-with-run.sh +++ b/.kokoro/build-with-run.sh @@ -118,17 +118,6 @@ export SERVICE_NAME="${SAMPLE_NAME}-${SUFFIX}" export NODE_ENV=development npm install -# If tests are running against main, configure FlakyBot -# to open issues on failures: -if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"release"* ]]; then - export MOCHA_REPORTER_SUITENAME=${PROJECT} - notify_flakybot() { - chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot - $KOKORO_GFILE_DIR/linux_amd64/flakybot - } - trap notify_flakybot EXIT HUP -fi - # Configure Cloud SQL variables for deploying idp-sql sample export DB_NAME="kokoro_ci" export DB_USER="kokoro_ci" diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 3e6de7cb29..e36f615e39 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -139,22 +139,6 @@ print_logfile() { echo '----- End ${MOCHA_REPORTER_OUTPUT} -----' } -# If tests are running against main, configure FlakyBot -# to open issues on failures: -if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"release"* ]]; then - export MOCHA_REPORTER_SUITENAME=${PROJECT} - cleanup() { - chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot - $KOKORO_GFILE_DIR/linux_amd64/flakybot - - # We can only set one trap per signal, so run `print_logfile` here - print_logfile - } - trap cleanup EXIT HUP -else - trap print_logfile EXIT HUP -fi - npm test exit $? diff --git a/CODEOWNERS b/CODEOWNERS index 55012d45e6..beba1e13c7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -26,12 +26,6 @@ secret-manager @GoogleCloudPlatform/dee-infra @GoogleCloudPlatform/nodejs-sample service-directory @GoogleCloudPlatform/dee-infra @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers webrisk @GoogleCloudPlatform/dee-infra @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -# DEE Platform Ops (DEEPO) -container @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -error-reporting @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -game-servers @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -monitoring @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers - # SoDa teams cloud-sql @GoogleCloudPlatform/infra-db-sdk @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers datastore @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers @@ -42,27 +36,11 @@ composer @GoogleCloudPlatform/cloud-dpes-composer @GoogleCloudPlatform/nodejs-sa monitoring/opencensus @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers # Data & AI -generative-ai @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -automl @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -cloud-language @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -contact-center-insights @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -datalabeling @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -dialogflow @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -dialogflow-cx @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -discoveryengine @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -document-ai @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/document-ai-samples-contributors @GoogleCloudPlatform/cloud-samples-reviewers -document-warehouse @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/document-ai-samples-contributors @GoogleCloudPlatform/cloud-samples-reviewers -mediatranslation @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -notebooks @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -speech @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -talent @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -texttospeech @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -translate @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -video-intelligence @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers -vision @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers +document-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/document-ai-samples-contributors @GoogleCloudPlatform/cloud-samples-reviewers +document-warehouse @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/document-ai-samples-contributors @GoogleCloudPlatform/cloud-samples-reviewers # Self-service -ai-platform @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/text-embedding @GoogleCloudPlatform/cloud-samples-reviewers +ai-platform @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/text-embedding @GoogleCloudPlatform/cloud-samples-reviewers asset @GoogleCloudPlatform/cloud-asset-analysis-team @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers dlp @GoogleCloudPlatform/googleapis-dlp @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers security-center @GoogleCloudPlatform/gcp-security-command-center @GoogleCloudPlatform/nodejs-samples-reviewers @GoogleCloudPlatform/cloud-samples-reviewers diff --git a/ai-platform/snippets/gemma2PredictGpu.js b/ai-platform/snippets/gemma2PredictGpu.js new file mode 100644 index 0000000000..47fce36788 --- /dev/null +++ b/ai-platform/snippets/gemma2PredictGpu.js @@ -0,0 +1,75 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +async function gemma2PredictGpu(predictionServiceClient) { + // [START generativeaionvertexai_gemma2_predict_gpu] + // Imports the Google Cloud Prediction Service Client library + const { + // TODO(developer): Uncomment PredictionServiceClient before running the sample. + // PredictionServiceClient, + helpers, + } = require('@google-cloud/aiplatform'); + /** + * TODO(developer): Update these variables before running the sample. + */ + const projectId = 'your-project-id'; + const endpointRegion = 'your-vertex-endpoint-region'; + const endpointId = 'your-vertex-endpoint-id'; + + // Default configuration + const config = {maxOutputTokens: 1024, temperature: 0.9, topP: 1.0, topK: 1}; + // Prompt used in the prediction + const prompt = 'Why is the sky blue?'; + + // Encapsulate the prompt in a correct format for GPUs + // Example format: [{inputs: 'Why is the sky blue?', parameters: {temperature: 0.9}}] + const input = { + inputs: prompt, + parameters: config, + }; + + // Convert input message to a list of GAPIC instances for model input + const instances = [helpers.toValue(input)]; + + // TODO(developer): Uncomment apiEndpoint and predictionServiceClient before running the sample. + // const apiEndpoint = `${endpointRegion}-aiplatform.googleapis.com`; + + // Create a client + // predictionServiceClient = new PredictionServiceClient({apiEndpoint}); + + // Call the Gemma2 endpoint + const gemma2Endpoint = `projects/${projectId}/locations/${endpointRegion}/endpoints/${endpointId}`; + + const [response] = await predictionServiceClient.predict({ + endpoint: gemma2Endpoint, + instances, + }); + + const predictions = response.predictions; + const text = predictions[0].stringValue; + + console.log('Predictions:', text); + // [END generativeaionvertexai_gemma2_predict_gpu] + return text; +} + +module.exports = gemma2PredictGpu; + +// TODO(developer): Uncomment below lines before running the sample. +// gemma2PredictGpu(...process.argv.slice(2)).catch(err => { +// console.error(err.message); +// process.exitCode = 1; +// }); diff --git a/ai-platform/snippets/gemma2PredictTpu.js b/ai-platform/snippets/gemma2PredictTpu.js new file mode 100644 index 0000000000..c854e97009 --- /dev/null +++ b/ai-platform/snippets/gemma2PredictTpu.js @@ -0,0 +1,77 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +async function gemma2PredictTpu(predictionServiceClient) { + // [START generativeaionvertexai_gemma2_predict_tpu] + // Imports the Google Cloud Prediction Service Client library + const { + // TODO(developer): Uncomment PredictionServiceClient before running the sample. + // PredictionServiceClient, + helpers, + } = require('@google-cloud/aiplatform'); + /** + * TODO(developer): Update these variables before running the sample. + */ + const projectId = 'your-project-id'; + const endpointRegion = 'your-vertex-endpoint-region'; + const endpointId = 'your-vertex-endpoint-id'; + + // Prompt used in the prediction + const prompt = 'Why is the sky blue?'; + + // Encapsulate the prompt in a correct format for TPUs + // Example format: [{prompt: 'Why is the sky blue?', temperature: 0.9}] + const input = { + prompt, + // Parameters for default configuration + maxOutputTokens: 1024, + temperature: 0.9, + topP: 1.0, + topK: 1, + }; + + // Convert input message to a list of GAPIC instances for model input + const instances = [helpers.toValue(input)]; + + // TODO(developer): Uncomment apiEndpoint and predictionServiceClient before running the sample. + // const apiEndpoint = `${endpointRegion}-aiplatform.googleapis.com`; + + // Create a client + // predictionServiceClient = new PredictionServiceClient({apiEndpoint}); + + // Call the Gemma2 endpoint + const gemma2Endpoint = `projects/${projectId}/locations/${endpointRegion}/endpoints/${endpointId}`; + + const [response] = await predictionServiceClient.predict({ + endpoint: gemma2Endpoint, + instances, + }); + + const predictions = response.predictions; + const text = predictions[0].stringValue; + + console.log('Predictions:', text); + // [END generativeaionvertexai_gemma2_predict_tpu] + return text; +} + +module.exports = gemma2PredictTpu; + +// TODO(developer): Uncomment below lines before running the sample. +// gemma2PredictTpu(...process.argv.slice(2)).catch(err => { +// console.error(err.message); +// process.exitCode = 1; +// }); diff --git a/ai-platform/snippets/test/gemma2Prediction.test.js b/ai-platform/snippets/test/gemma2Prediction.test.js new file mode 100644 index 0000000000..16b18d8f59 --- /dev/null +++ b/ai-platform/snippets/test/gemma2Prediction.test.js @@ -0,0 +1,135 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +const {expect} = require('chai'); +const {afterEach, describe, it} = require('mocha'); +const sinon = require('sinon'); +const gemma2PredictGpu = require('../gemma2PredictGpu.js'); +const gemma2PredictTpu = require('../gemma2PredictTpu.js'); + +const gpuResponse = `The sky appears blue due to a phenomenon called **Rayleigh scattering**. +**Here's how it works:** +1. **Sunlight:** Sunlight is composed of all the colors of the rainbow. +2. **Earth's Atmosphere:** When sunlight enters the Earth's atmosphere, it collides with tiny particles like nitrogen and oxygen molecules. +3. **Scattering:** These particles scatter the sunlight in all directions. However, blue light (which has a shorter wavelength) is scattered more effectively than other colors. +4. **Our Perception:** As a result, we see a blue sky because the scattered blue light reaches our eyes from all directions. +**Why not other colors?** +* **Violet light** has an even shorter wavelength than blue and is scattered even more. However, our eyes are less sensitive to violet light, so we perceive the sky as blue. +* **Longer wavelengths** like red, orange, and yellow are scattered less and travel more directly through the atmosphere. This is why we see these colors during sunrise and sunset, when sunlight has to travel through more of the atmosphere. +`; + +const tpuResponse = + 'The sky appears blue due to a phenomenon called **Rayleigh scattering**.'; + +describe('Gemma2 predictions', async () => { + const gemma2Endpoint = + 'projects/your-project-id/locations/your-vertex-endpoint-region/endpoints/your-vertex-endpoint-id'; + const configValues = { + maxOutputTokens: {kind: 'numberValue', numberValue: 1024}, + temperature: {kind: 'numberValue', numberValue: 0.9}, + topP: {kind: 'numberValue', numberValue: 1}, + topK: {kind: 'numberValue', numberValue: 1}, + }; + const prompt = 'Why is the sky blue?'; + const predictionServiceClientMock = { + predict: sinon.stub().resolves([]), + }; + + afterEach(() => { + sinon.reset(); + }); + + it('should run interference with GPU', async () => { + const expectedGpuRequest = { + endpoint: gemma2Endpoint, + instances: [ + { + kind: 'structValue', + structValue: { + fields: { + inputs: { + kind: 'stringValue', + stringValue: prompt, + }, + parameters: { + kind: 'structValue', + structValue: { + fields: configValues, + }, + }, + }, + }, + }, + ], + }; + + predictionServiceClientMock.predict.resolves([ + { + predictions: [ + { + stringValue: gpuResponse, + }, + ], + }, + ]); + + const output = await gemma2PredictGpu(predictionServiceClientMock); + + expect(output).include('Rayleigh scattering'); + expect(predictionServiceClientMock.predict.calledOnce).to.be.true; + expect(predictionServiceClientMock.predict.calledWith(expectedGpuRequest)) + .to.be.true; + }); + + it('should run interference with TPU', async () => { + const expectedTpuRequest = { + endpoint: gemma2Endpoint, + instances: [ + { + kind: 'structValue', + structValue: { + fields: { + ...configValues, + prompt: { + kind: 'stringValue', + stringValue: prompt, + }, + }, + }, + }, + ], + }; + + predictionServiceClientMock.predict.resolves([ + { + predictions: [ + { + stringValue: tpuResponse, + }, + ], + }, + ]); + + const output = await gemma2PredictTpu(predictionServiceClientMock); + + expect(output).include('Rayleigh scattering'); + expect(predictionServiceClientMock.predict.calledOnce).to.be.true; + expect(predictionServiceClientMock.predict.calledWith(expectedTpuRequest)) + .to.be.true; + }); +}); diff --git a/functions/billing/test/index.test.js b/functions/billing/test/index.test.js index 1d4ab188ab..47328b1d96 100644 --- a/functions/billing/test/index.test.js +++ b/functions/billing/test/index.test.js @@ -106,7 +106,7 @@ describe('functions/billing tests', () => { }); describe('functions_billing_stop', () => { - it('should disable billing when budget is exceeded', async () => { + xit('should disable billing when budget is exceeded', async () => { // Use functions framework to ensure sample follows GCF specification // (Invoking it directly works too, but DOES NOT ensure GCF compatibility) const jsonData = {costAmount: 500, budgetAmount: 400}; diff --git a/generative-ai/snippets/count-tokens/countTokens.js b/generative-ai/snippets/count-tokens/countTokens.js index 4515c6072a..54fed24dc1 100644 --- a/generative-ai/snippets/count-tokens/countTokens.js +++ b/generative-ai/snippets/count-tokens/countTokens.js @@ -35,8 +35,16 @@ async function countTokens( contents: [{role: 'user', parts: [{text: 'How are you doing today?'}]}], }; + // Prompt tokens count const countTokensResp = await generativeModel.countTokens(req); - console.log('count tokens response: ', countTokensResp); + console.log('Prompt tokens count: ', countTokensResp); + + // Send text to gemini + const result = await generativeModel.generateContent(req); + + // Response tokens count + const usageMetadata = result.response.usageMetadata; + console.log('Response tokens count: ', usageMetadata); } // [END generativeaionvertexai_gemini_token_count] diff --git a/generative-ai/snippets/safetySettings.js b/generative-ai/snippets/safetySettings.js index 80322f2cc5..082c01e636 100644 --- a/generative-ai/snippets/safetySettings.js +++ b/generative-ai/snippets/safetySettings.js @@ -40,13 +40,11 @@ async function setSafetySettings() { category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, }, + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + }, ], - generation_config: { - max_output_tokens: 256, - temperature: 0.4, - top_p: 1, - top_k: 16, - }, }); const request = {