add code script to context

This commit is contained in:
Jicheng Lu 2025-10-06 10:57:18 -05:00
parent babb8795b3
commit 6a0153db28
2 changed files with 3 additions and 1 deletions

View file

@ -2,5 +2,6 @@ namespace BotSharp.Abstraction.Instructs.Models;
public class CodeInstructContext public class CodeInstructContext
{ {
public string CodeScript { get; set; }
public List<KeyValue> Arguments { get; set; } = []; public List<KeyValue> Arguments { get; set; } = [];
} }

View file

@ -205,6 +205,7 @@ public partial class InstructService
var context = new CodeInstructContext var context = new CodeInstructContext
{ {
CodeScript = codeScript,
Arguments = arguments Arguments = arguments
}; };
@ -225,7 +226,7 @@ public partial class InstructService
} }
// Run code script // Run code script
var result = await codeInterpreter.RunCode(codeScript, options: new() var result = await codeInterpreter.RunCode(context.CodeScript, options: new()
{ {
Arguments = context.Arguments Arguments = context.Arguments
}); });