Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Michael 360d7b519d
docs(examples): add uniform init commands to all example READMEs (#4068)
3 months ago
..
360d7b519d
docs(examples): add uniform init commands to all example READMEs (#4068)
3 months ago
bdca86b2e1
fix: google vertex ais output format (#3660)
4 months ago
95eb3e3c11
chore(providers): add support for for tools in Vertex provider (#3077)
6 months ago

README.md

You have to be logged in to leave a comment. Sign In

google-vertex-tools (Google Vertex Tools)

You can run this example with:

npx promptfoo@latest init --example google-vertex-tools

This example demonstrates how to use Vertex AI models with function calling and tools.

Quick Start

Initialize this example in a new directory:

promptfoo init --example google-vertex-tools

This creates three files:

  • promptfooconfig.yaml - Your prompt testing configuration
  • tools.json - Function definitions for tool calling
  • README.md - This guide

Prerequisites

  1. Install the Google Auth Library:

    npm install google-auth-library
    
  2. Enable the Vertex AI API in your Google Cloud project

  3. Configure your Google Cloud project:

    gcloud config set project PROJECT_ID
    
  4. Set up authentication using one of these methods:

    • Authenticate with your Google account:

      gcloud auth application-default login
      
    • Use a machine with an authorized service account

    • Use service account credentials file:

      1. Download your service account JSON

      2. Set the credentials path:

        export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
        

Running the Example

  1. Review and customize the configuration in promptfooconfig.yaml

  2. Run the eval:

    promptfoo eval
    
  3. Examine the results:

    promptfoo view
    

Learn More

Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...