add code script to context
This commit is contained in:
parent
babb8795b3
commit
6a0153db28
|
|
@ -2,5 +2,6 @@ namespace BotSharp.Abstraction.Instructs.Models;
|
|||
|
||||
public class CodeInstructContext
|
||||
{
|
||||
public string CodeScript { get; set; }
|
||||
public List<KeyValue> Arguments { get; set; } = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ public partial class InstructService
|
|||
|
||||
var context = new CodeInstructContext
|
||||
{
|
||||
CodeScript = codeScript,
|
||||
Arguments = arguments
|
||||
};
|
||||
|
||||
|
|
@ -225,7 +226,7 @@ public partial class InstructService
|
|||
}
|
||||
|
||||
// Run code script
|
||||
var result = await codeInterpreter.RunCode(codeScript, options: new()
|
||||
var result = await codeInterpreter.RunCode(context.CodeScript, options: new()
|
||||
{
|
||||
Arguments = context.Arguments
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue