# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
description: 'Function calling demonstration'

prompts: '{{query}}'

providers:
  # Using Gemini 3.1 Flash Live Preview
  - id: 'google:live:gemini-3.1-flash-live-preview'
    config:
      tools: file://tools.json
      generationConfig:
        response_modalities: ['audio']
        outputAudioTranscription: {}
      timeoutMs: 10000

tests:
  # Example of non-built-in tool that the user must execute
  - vars:
      query: What is the weather in {{location}}?
      location: San Francisco
    assert:
      - type: is-valid-function-call
      - type: equals
        value: get_weather
        transform: output.toolCall.functionCalls[0].name
      - type: similar
        value: '{{location}}'
        threshold: 0.9
        transform: output.toolCall.functionCalls[0].args.city
  # Example of built-in google search tool that is executed by live
  - vars:
      query: google search for why the sea is salty
    assert:
      - type: icontains
        value: salt
        transform: output.text
      - type: icontains-any
        value:
          - 'weathering'
          - 'rainwater'
          - 'erosion'
          - 'eroded'
          - 'rocks'
          - 'minerals'
          - 'rivers'
          - 'rain'
        transform: output.text
