mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 01:04:36 +00:00
feat(ai): Add proper thinking support for Gemini 2.5 models
- Added thinkingConfig with includeThoughts and thinkingBudget support - Use part.thought boolean flag to detect thinking content per API docs - Capture and preserve thought signatures for multi-turn function calling - Added supportsThinking() check for Gemini 2.5 series models - Updated example to demonstrate thinking configuration - Handle SDK type limitations with proper type assertions
This commit is contained in:
parent
a8ba19f0b4
commit
3e1422d3d7
2 changed files with 56 additions and 13 deletions
|
|
@ -23,10 +23,15 @@ const tools: Tool[] = [
|
|||
const options: GeminiLLMOptions = {
|
||||
onText: (t, complete) => process.stdout.write(t + (complete ? "\n" : "")),
|
||||
onThinking: (t, complete) => process.stdout.write(chalk.dim(t + (complete ? "\n" : ""))),
|
||||
toolChoice: "auto"
|
||||
toolChoice: "auto",
|
||||
// Enable thinking for Gemini 2.5 models
|
||||
thinking: {
|
||||
enabled: true,
|
||||
budgetTokens: -1 // Dynamic thinking
|
||||
}
|
||||
};
|
||||
|
||||
const ai = new GeminiLLM("gemini-2.0-flash-exp", process.env.GEMINI_API_KEY || "fake-api-key-for-testing");
|
||||
const ai = new GeminiLLM("gemini-2.5-flash", process.env.GEMINI_API_KEY || "fake-api-key-for-testing");
|
||||
const context: Context = {
|
||||
systemPrompt: "You are a helpful assistant that can use tools to answer questions.",
|
||||
messages: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue