adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
48 lines (47 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BuiltInPlanner = void 0;
const BasePlanner_1 = require("./BasePlanner");
/**
* The built-in planner that uses model's built-in thinking features.
*/
class BuiltInPlanner extends BasePlanner_1.BasePlanner {
/**
* Initializes the built-in planner.
*
* @param thinkingConfig Config for model built-in thinking features. An error
* will be returned if this field is set for models that don't support thinking.
*/
constructor(thinkingConfig) {
super();
this.thinkingConfig = thinkingConfig;
}
/**
* Applies the thinking config to the LLM request.
*
* @param llmRequest The LLM request to apply the thinking config to.
*/
applyThinkingConfig(llmRequest) {
if (this.thinkingConfig) {
// Initialize config if it doesn't exist
if (!llmRequest.config) {
// Only include required properties (tools array) and use type assertion
llmRequest.config = { tools: [] };
}
llmRequest.config.thinkingConfig = this.thinkingConfig;
}
}
/**
* @inheritdoc
*/
buildPlanningInstruction(readonlyContext, llmRequest) {
return undefined;
}
/**
* @inheritdoc
*/
processPlanningResponse(callbackContext, responseParts) {
return undefined;
}
}
exports.BuiltInPlanner = BuiltInPlanner;