Skip to content

Commit 6a78bec

Browse files
author
Jicheng Lu
committed
minor change
1 parent 0d61272 commit 6a78bec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ await hook.OnResponseGenerated(new InstructResponseModel
238238
Text = result?.Result?.ToString()
239239
};
240240

241+
if (context?.Arguments != null)
242+
{
243+
context.Arguments.ForEach(x => state.SetState(x.Key, x.Value, source: StateSource.External));
244+
}
245+
241246
// After code execution
242247
foreach (var hook in hooks)
243248
{
@@ -249,7 +254,7 @@ await hook.OnResponseGenerated(new InstructResponseModel
249254
Model = string.Empty,
250255
TemplateName = scriptName,
251256
UserMessage = message.Content,
252-
SystemInstruction = string.Empty,
257+
SystemInstruction = context?.CodeScript,
253258
CompletionText = response.Text
254259
});
255260
}

0 commit comments

Comments
 (0)