# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json

# Learn more about building a configuration: https://promptfoo.dev/docs/configuration/guide

description: 'Function calling demonstration'

prompts:
  - What is the weather in {{location}}?

providers:
  # See https://www.promptfoo.dev/docs/providers/vertex/
  - id: 'vertex:gemini-2.5-flash-002'
    config:
      tools: file://tools.json

defaultTest:
  assert:
    - type: is-valid-function-call
    - type: equals
      value: get_current_weather
      # Transform is a cleaner way to pick out specific properties.
      # This transform returns only the 'name' property
      transform: output[0].functionCall.name
    - type: similar
      value: '{{location}}'
      threshold: 0.9
      # This transform returns only the parsed location argument.
      transform: output[0].functionCall.args.location

  options:
    # This overrides the default grading providers with Vertex AI models.
    providers:
      embedding: 'vertex:embedding:text-embedding-005'
      text: 'vertex:gemini-2.5-flash-002'

tests:
  - vars:
      location: San Francisco

  - vars:
      location: New York
