genkit icon indicating copy to clipboard operation
genkit copied to clipboard

How to control safety setting with VertexAi and Dotprompt?

Open Jacquesjh opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. How can I control the safety settings of a vertex ai model in a dotprompt file? I was trying gemini-1.5-flash for audio transcription when it blocked it's generation because of settings. This was the safety context:

{
  "safetyRatings": [
    {
      "category": "HARM_CATEGORY_HATE_SPEECH",
      "probability": "NEGLIGIBLE",
      "probabilityScore": 0.29027623,
      "severity": "HARM_SEVERITY_NEGLIGIBLE",
      "severityScore": 0.09138211
    },
    {
      "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
      "probability": "NEGLIGIBLE",
      "probabilityScore": 0.16913125,
      "severity": "HARM_SEVERITY_NEGLIGIBLE",
      "severityScore": 0.076683804
    },
    {
      "category": "HARM_CATEGORY_HARASSMENT",
      "probability": "LOW",
      "probabilityScore": 0.5026188,
      "severity": "HARM_SEVERITY_LOW",
      "severityScore": 0.31710896
    },
    {
      "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
      "probability": "NEGLIGIBLE",
      "probabilityScore": 0.37090874,
      "severity": "HARM_SEVERITY_LOW",
      "severityScore": 0.24762337
    }
  ],
  "citationMetadata": {
    "citations": [
      {
        "startIndex": 1620,
        "endIndex": 13215,
        "uri": "https://github.com/h5py/h5py/issues/556"
      }
    ]
  }
}

This is the dotprompt file?

---
model: vertexai/gemini-1.5-flash-preview
config:
  temperature: 0.1
input:
  schema:
    audioURL: string
---

Provide a transcription of this conversation. Please use a format of timestamp, speaker, caption.

{{media url=audioURL}}

The audio I was using was from a podcast conversation about business. I can provide it if it would be useful.

Jacquesjh avatar May 27 '24 19:05 Jacquesjh