(edited)
The stream response message doesn't work. If I remove the bindTools, It works perfectly
// File llama.tsimport { ChatOllama } from "@langchain/ollama";const llama = new ChatOllama({ model: "llama3.2:latest",});export default llama;// File route.tsimport llama from "@/models/llama";import { AIMessage, HumanMessage } from "@langchain/core/messages";import { tool } from "@langchain/core/tools";import { LangChainAdapter, type Message } from "ai";import { NextResponse } from "next/server";import { z } from "zod";export async function POST(req: Request) { const { messages } = await req.json(); try { const response = await llama .bindTools([ tool( async (input) => { console.log(input); return input.a * input.b; }, {