-
Notifications
You must be signed in to change notification settings - Fork 234
Open
Description
I am trying to change to Gemma using the workers-ai-provider.
When I use @cf/google/gemma-3-12b-it there is no replies from the agent.
When I use @cf/google/gemma-2b-it-lora the bot responds but disregarding the System prompt and I am unable to use tools.
I know that Gemma does not use the "System" prompt. I have been making changes to the code but nothing seems to work.
My latest attempt was this:
const systemPrompt = { role: "system", content:You are a pirate. Always respond like a pirate, matey!
${unstable_getSchedulePrompt({ date: new Date() })}
If the user asks to schedule a task, use the schedule tool to schedule the task.
`
};
const finalMessages = [
systemPrompt,
...processedMessages,
];
const result = streamText({
model,
messages: finalMessages,
tools: allTools,
onFinish: async (args) => {
onFinish(args as Parameters<StreamTextOnFinishCallback<ToolSet>>[0]);
},
onError: (error) => {
console.error("Error while streaming:", error);
},
maxSteps: 10,
});
// Merge the AI response stream with tool execution outputs
result.mergeIntoDataStream(dataStream);
},
});
`
Metadata
Metadata
Assignees
Labels
No labels