mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-26 13:38:14 +00:00
feat(widgets): add LLM context to prevent context overflow
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user