Skip to content

Mistral object generation fails with mode: tool #6330

Closed
@YousefED

Description

@YousefED

Description

To reproduce:

const model = createMistral({
    apiKey: "KEY",
  })("ministral-8b-latest");

  const ret = await streamObject({
    model,
    mode: "tool",
    // output: "object" as const,
    prompt: "return hello world",
    schema: jsonSchema({
      type: "object",
      required: ["text"],
      properties: {
        text: {
          type: "string",
        },
      },
    }),
    onError(error) {
      console.log(error);
    },
  });

results in

{"detail":[{"type":"extra_forbidden","loc":["body","tools","list[Tool]",0,"function","type"],"msg":"Extra inputs are not permitted","input":"function"},{"type":"string_type","loc":["body","tools","list[str]",0],"msg":"Input should be a valid string","input":{"type":"function","function":{"type":"function","name":"json","description":"Respond with a JSON object.","parameters":{"type":"object","required":["text"],"properties":{"text":{"type":"string"}}}}}}]}

AI SDK Version

"ai": "^4.3.15",
"@ai-sdk/mistral": "^1.2.8",

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions