cloudflare / cloudflare/agents-starter

Gemma issues

Open
#103 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.3k
Forks
283
PR merge metrics
No merged PRs in 30d

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>[0]);
},
onError: (error) => {
console.error("Error while streaming:", error);
},
maxSteps: 10,
});

// Merge the AI response stream with tool execution outputs
result.mergeIntoDataStream(dataStream);
},
});
`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two model cases using the shown streamText call, model values, messages, tools, and maxSteps configuration. Trace how the workers-ai-provider handles Gemma system messages and tool calls; done means @cf/google/gemma-3-12b-it replies and @cf/google/gemma-2b-it-lora follows the system prompt and can use tools.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, backend-api-design, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.