I'm running Ollama server with llama3.2 (Listening on 127.0.0.1:11434), but when I send a message from the CopilotKit chat the request doesn't hit the server. Here is my attempt:
import {
CopilotRuntime,
copilotRuntimeNextJSAppRouterEndpoint,
ExperimentalOllamaAdapter,
} from '@copilotkit/runtime';
import {NextRequest} from 'next/server';
const serviceAdapter = new ExperimentalOllamaAdapter({
model: "llama3.2",
});
const runtime = new CopilotRuntime()
export const POST = async (req: NextRequest) => {
console.log("📨 POST /api/copilotkit called");
const {handleRequest} = copilotRuntimeNextJSAppRouterEndpoint({
runtime,
serviceAdapter,
endpoint: '/api/copilotkit',
});
return handleRequest(req);
}
Can you please help me to configure it?