Skip to content

[JS] Input array of objects not unwrapped in Dotprompt request #207

@traxes9k

Description

@traxes9k

Describe the bug
Input array not unwrapped in Dotprompt request.

To Reproduce
[dotprompt]

model: vertexai/gemini-1.5-pro-preview
config:
  temperature: 0.4
  topK: 32
  topP: 0.95
input:
  schema:
    user_input: string
    ai_backstory: string
    previous_choices(array): 
      choice_description: string
      consequence: string
{{role "user"}}
{
  "user_input": "{{user_input}}",
  "ai_backstory": "{{ai_backstory}}",
  "previous_choices":{{previous_choices}}
}

[INPUT]

{
  "user_input": "bla",
  "ai_backstory": "bla",
  "previous_choices": [
    {
      "choice_description": "bla",
      "consequence": "bla"
    },
    {
      "choice_description": "bla",
      "consequence": "bla"
    },
    {
      "choice_description": "bla",
      "consequence": "bla"
    }
  ]
}

[REQUEST TRACE]

"role": "user",
"content": [
  {
    "text": "\n{\n  \"user_input\": \"bla\",\n  \"ai_backstory\": \"bla\",\n  \"previous_choices\":\[object Object],[object Object],[object Object]\\n}\n"
  }
]

Expected behavior
Would expect the previous_choices array to be unpacked and sent with the request. This feature works for unwrapping outputs.

Screenshots
Screenshot 2024-05-21 at 20 46 46

Runtime (please complete the following information):

  • OS: MacOS

** Node version
v21.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions