GenkitG
Genkitโ€ข11mo agoโ€ข
2 replies
exclusive-coral

Hello, been struggling with the output

Hello, been struggling with the output schema from dotprompt file all day. I could use some help.

At the top of my prompt file I have:

---
input:
  schema:
    imagePath: string
output:
  schema:
    itemCount: number
    sceneDescription: string
    items(array):
      name: string
      type: string
      needsBrandResearch: boolean
---


However, that output schema is always just returned in the response in "text"

Result:
{
  "message": {
    "role": "model",
    "content": [
      {
        "text": "{\n  \"itemCount\": 12,\n  \"items\": [\n    {\n      \"name\": \"trophy\",\n      \"needsBrandResearch\": false,\n      \"type\": \"object\"\n    },\n    {\n      \"name\": \"dog\",\n      \"needsBrandResearch\": false,\n      \"type\": \"animal\"\n    },\n    {\n      \"name\": \"kite\",\n      \"needsBrandResearch\": false,\n  .....


I've been over the doc page on dotprompt so many times and can't figure out what I've done wrong.

genkit 1.0.5
gemini20Flash
js
Was this page helpful?