chore: add more agent upcoming features

This commit is contained in:
Rotimi Best
2026-05-27 11:55:40 +01:00
parent f0ef45fd67
commit 9082cbebf4
8 changed files with 155 additions and 24 deletions
+7 -1
View File
@@ -187,7 +187,13 @@ async function executeAgentTool<TArgs, TResult>(
}
}
export function buildAgentTools(orgId: string, userId: string, courseId: string, priorMessages: unknown[]) {
export function buildAgentTools(
orgId: string,
userId: string,
courseId: string,
priorMessages: unknown[],
_options?: { isOrgOnPaidPlan?: boolean }
) {
return {
get_course_structure: tool({
description:
+7 -1
View File
@@ -29,6 +29,7 @@ export interface CreateAgentRunStateInput {
executionCursor?: Record<string, unknown>;
sourceIds?: string[];
modelSummary?: string;
modelId?: string;
}
export interface AgentRunDetail {
@@ -107,6 +108,11 @@ export async function createAgentRunState(input: CreateAgentRunStateInput): Prom
await assertCourseRunAccess(input.courseId, input.userId, input.orgId);
await assertConversationBelongsToCourse(input.conversationId, input.courseId, input.userId);
const executionCursor = {
...(input.executionCursor ?? {}),
...(input.modelId ? { modelId: input.modelId } : {})
};
const run = await createAgentRun({
orgId: input.orgId,
courseId: input.courseId,
@@ -114,7 +120,7 @@ export async function createAgentRunState(input: CreateAgentRunStateInput): Prom
userId: input.userId,
phase: input.phase,
approvedPlan: input.approvedPlan ?? null,
executionCursor: input.executionCursor,
executionCursor,
sourceIds: input.sourceIds,
modelSummary: input.modelSummary
});