WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

[@ai-sdk/huggingface] Error with hugging face and tools #10766

@0-Sandy

Description

@0-Sandy

Description

I get the error AI SDK Warning (huggingface.responses / deepseek-ai/DeepSeek-V3-0324): The feature "tool messages" is not supported. when I try to use a tool, but the documentaton of @ai-sdk/huggingface says that DeepSeek-V3-0324 supports tools and also the hugging face documentation says that DeepSeek-V3-0324 supports tools, at least with this providers: novita, sambanova, together and fireworks-ai, this is my code:

import { huggingface } from "@ai-sdk/huggingface";
import { stepCountIs, streamText, tool } from "ai";
import z from "zod";

export async function POST() {
  const { textStream } = await streamText({
    model: huggingface("deepseek-ai/DeepSeek-V3-0324"),
    prompt: "What is the weather in Montevideo, Uruguay?",
    stopWhen: stepCountIs(5),
    tools: {
      weather: tool({
        description: "Get the weather in a location",
        inputSchema: z.object({
          location: z.string().describe("The location to get the weather for"),
        }),
        execute: async ({ location }) => ({
          location,
          temperature: 72 + Math.floor(Math.random() * 21) - 10,
        }),
      }),
    },
    onError({ error }) {
      console.error(error);
    },
  });

  for await (const textPart of textStream) {
    console.log(textPart);
  }
  return new Response("Test");
}

I tried using the model with the provider novita, like this deepseek-ai/DeepSeek-V3-0324:novita, but it gave me the same error

AI SDK Version

  • ai: 6.0.0-beta.127
  • @ai-sdk/huggingface: 1.0.0-beta.37

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions