feat(widgets): add LLM context to prevent context overflow

This commit is contained in:
ItzCrazyKns
2025-11-24 15:35:00 +05:30
parent 956a768a86
commit 0a62c60da2
5 changed files with 99 additions and 84 deletions

View File

@@ -45,6 +45,7 @@ const calculationWidget: Widget<typeof schema> = {
return {
type: 'calculation_result',
llmContext: `The result of the expression "${params.expression}" is ${result}.`,
data: {
expression: params.expression,
result: result,
@@ -53,6 +54,7 @@ const calculationWidget: Widget<typeof schema> = {
} catch (error) {
return {
type: 'calculation_result',
llmContext: 'Failed to evaluate mathematical expression.',
data: {
expression: params.expression,
result: `Error evaluating expression: ${error}`,