Skip to content

Commit b32d883

Browse files
committed
feat: provide agui context to mastras runtime context
1 parent 88f24ef commit b32d883

File tree

1 file changed

+2
-1
lines changed
  • typescript-sdk/integrations/mastra/src

1 file changed

+2
-1
lines changed

typescript-sdk/integrations/mastra/src/mastra.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export class MastraAgent extends AbstractAgent {
227227
* @returns The stream of the mastra agent.
228228
*/
229229
private async streamMastraAgent(
230-
{ threadId, runId, messages, tools }: RunAgentInput,
230+
{ threadId, runId, messages, tools, context: inputContext }: RunAgentInput,
231231
{
232232
onTextPart,
233233
onFinishMessagePart,
@@ -250,6 +250,7 @@ export class MastraAgent extends AbstractAgent {
250250
);
251251
const resourceId = this.resourceId ?? threadId;
252252
const convertedMessages = convertAGUIMessagesToMastra(messages);
253+
this.runtimeContext?.set('ag-ui', inputContext);
253254
const runtimeContext = this.runtimeContext;
254255

255256
if (this.isLocalMastraAgent(this.agent)) {

0 commit comments

Comments
 (0)