Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursor/rules/ai-genobj-streamobj.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ description: Use this whenever you call with AI genObj, or AI genStreamObj.
globs:
alwaysApply: true
---
- Default to `openai:gpt-4o-mini`
- Default to `openai:gpt-5-mini`
- Schemas passed to genObj CANNOT have `.min` or `.max`, as these are forbidden
2 changes: 1 addition & 1 deletion apps/dev-docs/contents/docs/ai/RNAgent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const agentStream = await aib.RNAgentStream({
chatId: `classroom-${userId}-${skillId}`,
system: systemContent,
genArgs: {
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
mode: "json",
providerArgs: {
structuredOutputs: true,
Expand Down
2 changes: 1 addition & 1 deletion apps/next-main/app/HomeMainSkillCreator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export function HomeMainSkillCreator({
2. "i want to study digital marketing strategies"
3. "i want to study business administration"
4. "i want to study user experience design"`,
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
mode: "json",
providerArgs: {
temperature: 0.7, // Add some variety to suggestions
Expand Down
38 changes: 12 additions & 26 deletions apps/next-main/app/api/helpers/initializeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,47 +403,33 @@ export async function parseRequest<
openaiApiKey: process.env.OPENAI_API_KEY,
aiDriver: aiDriver as any,
defaultGenObjectModels: [
'openai:gpt-4o-mini',
'openai:gpt-5-mini',
// groq('llama3-groq-70b-8192-tool-use-preview'),
],
defaultGenTextModels: [
'openai:gpt-4o-mini',
'openai:gpt-5-mini',
// groq('llama3-groq-70b-8192-tool-use-preview'),
],
ctxInjectors: [
...RNCtxInjector.getNewImplementations()
],
modelProps: {
'openai:gpt-4o-mini': {
quality: 88,
speed: 103,
contextLength: 128_000,
modelProps: {
'openai:gpt-5-mini': {
quality: 92,
speed: 105,
contextLength: 1_000_000,
toolOptimized: true,
altTags: ['fastest']
},
'openai:gpt-4o': {
quality: 99,
speed: 82,
contextLength: 128_000,
toolOptimized: true,
altTags: []
},
'openai:gpt-4o-2024-08-06': {
'anthropic:claude-sonnet-4-6': {
quality: 100,
speed: 82,
contextLength: 128_000,
toolOptimized: true,
altTags: ['best']
},
'anthropic:claude-3-5-sonnet-20240620': {
quality: 99,
speed: 79,
contextLength: 200_000,
speed: 85,
contextLength: 1_000_000,
toolOptimized: true,
altTags: ['best']
},
'anthropic:claude-3-haiku-20240307': {
quality: 74,
'anthropic:claude-haiku-4-5-20251001': {
quality: 88,
speed: 128,
contextLength: 200_000,
toolOptimized: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const { POST } = makeServerApiHandlerV3({

// Use AI to generate dig deeper topics
const result = await ai.genObject({
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
schema: z.object({
digDeeperTopics: z.array(z.string()).describe(
'A list of 2-4 specific topics from the line that would be interesting to explore further. ' +
Expand Down
6 changes: 3 additions & 3 deletions apps/next-main/app/api/speech/podcast/transcript/route.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export const { POST } = makeServerApiHandlerV3({

The hosts and the title should remain constant; you just need to update the sections.
`),
model: "openai:gpt-4o",
model: "openai:gpt-5-mini",
});

outline = {
Expand Down Expand Up @@ -339,7 +339,7 @@ export const { POST } = makeServerApiHandlerV3({

Make sure the outline reflects the "${podcastType}" podcast style.
`),
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
});

outline = outlineResponse.object;
Expand Down Expand Up @@ -370,7 +370,7 @@ export const { POST } = makeServerApiHandlerV3({
// Step 2: Generate and stream podcast transcript
const transcriptStream = await ai.streamGenObject({
output: 'object',
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
mode: 'json',
schema: z.object({
transcript: z.array(
Expand Down
2 changes: 1 addition & 1 deletion apps/next-main/app/app/admin/testing/rnagent/page.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function RNAgentTestPage() {
try {
const aiResponse = await aib.RNAgentStream({
genArgs: {
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
},
chatId: 'test-chat-id',
messages: [
Expand Down
2 changes: 1 addition & 1 deletion apps/next-main/app/app/course-teaser/CourseTeaser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export function CourseTeaserPageInner({ initialTopic, onCreateAccountClick }: Co
`
}
],
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
mode: 'json',
providerArgs: {
structuredOutputs: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ export function LessonEditPageLoaded({ lesson, refreshLesson }: { lesson: Lesson
emoji: z.string(),
}),
prompt,
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
mode: 'json',
providerArgs: {
structuredOutputs: true,
Expand Down
2 changes: 1 addition & 1 deletion apps/next-main/app/app/lessons/new/page.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default function NewLessonPage(){
- Each learning objective should be a single sentence
</FORMAT>
`,
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
});

if (outlineResponse.object.lessonName && !lessonName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async function createSections(pages: RsnPage[]){
driverConfig: {
type: 'openai',
config: {
model: 'gpt-3.5-turbo-0613'
model: 'gpt-5-mini'
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion apps/next-main/clientOnly/hooks/useAILessonRefinement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useAILessonRefinement() {
- A list of learning objectives in plain text
</OUTPUT_FORMAT>
`,
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
});

if (response.object.refinedOutline) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export async function gradeChooseTheBlankActivity(data: ChooseTheBlankActivityCo
),
gradePerBlank: z.array(z.number()).describe("An array of scores between 0 and 100, one for each of the hidden words or phrases."),
}),
model: 'openai:gpt-4o-mini',
model: 'anthropic:claude-sonnet-4-6',
mode: 'json',
providerArgs: {
structuredOutputs: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function performRoleplay({messages, config}: PerformRoleplayArgs){
characterToSpeak: z.string().describe("The EXACT name of the character that would most likely speak next."),
messageContent: z.string().describe("The message that the character should speak, in their authentic voice."),
}),
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
mode: 'json',
providerArgs: {
structuredOutputs: true,
Expand Down
4 changes: 2 additions & 2 deletions apps/next-main/components/chat/hooks/useChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export async function asyncChat({

const finalResult = await aib.RNAgentStream({
genArgs: {
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
},
// system: ,
chatId,
Expand Down Expand Up @@ -670,7 +670,7 @@ export function useChat({ chatId }: { chatId: string | undefined }) {
// Call the streamSuggestedNextMessages method
return aib.streamSuggestedNextMessages({
genArgs: {
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
},
messages: chatHistory,
chatId: chatId,
Expand Down
2 changes: 1 addition & 1 deletion apps/next-main/components/classroom/ClassroomAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ export const streamGenObjectWithRetry = async ({
chatId: `classroom-${userId}-${skillId}-${courseId}`,
system: systemContent,
genArgs: {
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
mode: USE_JSON_MODE ? "json" : undefined,
providerArgs: {
structuredOutputs: true,
Expand Down
4 changes: 2 additions & 2 deletions apps/next-main/components/courses/LessonPlanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function generateLessonWithAI(skillData: any, skillTree: any) {
- Make the name concise but descriptive
</FORMAT>
`,
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
});

if (response.object.lessons.length === 0) {
Expand Down Expand Up @@ -339,7 +339,7 @@ export function LessonPlanner({ rootSkill, selectedSkills, onLessonsGenerated, e
- 1-2 lessons per major skill branch
</FORMAT>
`,
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
});

const newLessons = response.object.lessons.map((lesson, idx) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function TakeawayFlashcards({
hasGeneratedRef.current = true;

aib.genObject({
model: 'openai:gpt-4o-mini-2024-07-18',
model: 'openai:gpt-5-mini',
functionName: "generate_takeway_flashcards",
functionDescription: "Generate personalized takeaway flashcards based on lesson content and student performance",
schema: z.object({
Expand Down
3 changes: 2 additions & 1 deletion apps/next-main/vendor/openai-zod/openaiModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const OpenAIChatModelsEnumSchema = z.union([
z.literal("gpt-4-0125-preview"),
z.literal("gpt-4-turbo-2024-04-09"),
z.literal("gpt-4-turbo"),
z.literal('gpt-4o')
z.literal('gpt-4o'),
z.literal('gpt-5-mini'),
]);
export type OpenAIChatModelsEnum = z.infer<typeof OpenAIChatModelsEnumSchema>;
2 changes: 1 addition & 1 deletion libs/ai-generators/src/__tests__/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('genObject complex schema tests', () => {
providerArgs: {
structuredOutputs: true,
},
model: 'openai:gpt-4o-mini-2024-07-18',
model: 'openai:gpt-5-mini',
system: INSTRUCTIONS,
schema: complexSchema,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async function runTest(subject: string, interest: string) {

${criticalSection}
`,
model: 'openai:gpt-4o-mini'
model: 'openai:gpt-5-mini'
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('streamGenActivitiesV1 -- dependencies simple', () => {

${criticalSection}
`,
model: 'openai:gpt-4o-mini'
model: 'openai:gpt-5-mini'
})

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function expectValidDependencies({subject, activities, ai}: {subjec

${criticalSection}
`,
model: 'openai:gpt-4o-mini'
model: 'openai:gpt-5-mini'
})

return {
Expand Down Expand Up @@ -150,7 +150,7 @@ export async function expectInterestsMentioned({interests, activities, ai}: {int
Remember -- it's enough if AT LEAST ONE interest is mentioned, or if it's implicitly mentioned by reference.

`,
model: 'openai:gpt-4o-mini'
model: 'openai:gpt-5-mini'
})

console.log(ret?.object);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export async function* streamGenActivitiesV1({


const streamResult = (await ai.streamGenObject({
model: 'openai:gpt-4o-mini',
model: 'openai:gpt-5-mini',
mode: 'json',
schema: StreamActivityOutputSchema,
messages: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function getLessonOverview(args: GetLessonOverviewArgs) {
Object.fromEntries(args.fieldsToGet.map((f) => [f, true]))
).describe('The lesson plan'),
}),
model: args?.genObjectArgs?.model ?? 'openai:gpt-4o-2024-08-06',
model: args?.genObjectArgs?.model ?? 'openai:gpt-5-mini',
mode: args?.genObjectArgs?.mode ?? 'json',
providerArgs: {
structuredOutputs: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function* getLessonOverviewStream(args: GetLessonOverviewStreamArgs
Object.fromEntries(args.fieldsToGet.map((f) => [f, true]))
).describe('The lesson plan'),
}),
model: args?.streamGenObjectArgs?.model ?? 'openai:gpt-4o-2024-08-06',
model: args?.streamGenObjectArgs?.model ?? 'openai:gpt-5-mini',
mode: args?.streamGenObjectArgs?.mode ?? 'json',
providerArgs: {
structuredOutputs: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function* streamGenSubtopics({
const streamResult = await ai.streamGenObject({
schema: SubTopicsResponseSchema,
prompt: basePrompt,
model: "openai:gpt-4o-mini",
model: "openai:gpt-5-mini",
mode: "json",
providerArgs: {
temperature: 0.7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class DivideAndConquerTreeMaker {
private outputDir: string = '';
private useQuestions: boolean = false;
private useTopicNames: boolean = false;
private model: string = 'openai:gpt-4o-mini';
private model: string = 'openai:gpt-5-mini';

private WRITE_OUTPUT_TO_FILE: boolean = false;

Expand All @@ -88,7 +88,7 @@ export class DivideAndConquerTreeMaker {
this.useQuestions = args.useQuestions || false;
this.useTopicNames = args.useTopicNames || false;
this.WRITE_OUTPUT_TO_FILE = args.WRITE_OUTPUT_TO_FILE || false;
this.model = args.model || 'openai:gpt-4o-mini';
this.model = args.model || 'openai:gpt-5-mini';
}

addNode(node: SkillGraphNode): void {
Expand Down
Loading
Loading