Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fd18077
Add persona report
edulelis Jul 24, 2025
fc2622f
Remove unused endpoints
edulelis Jul 24, 2025
6f720a6
Simplify to a single API route. Move page to debug
edulelis Jul 25, 2025
7eed5dd
Improve typing
edulelis Jul 25, 2025
578ebfb
Remove unused layout
edulelis Jul 25, 2025
a33bc1e
Cleanup error messages
edulelis Jul 25, 2025
2c14ec0
Merge branch 'main' of github.com:elie222/inbox-zero into persona-report
edulelis Jul 28, 2025
d980e62
Merge branch 'main' of github.com:elie222/inbox-zero into persona-report
edulelis Jul 30, 2025
3c3340a
Merge branch 'main' into persona-report
elie222 Jul 30, 2025
a5ac182
clean up generate report
elie222 Jul 30, 2025
5321970
logs
elie222 Jul 30, 2025
0bd0291
catch errors
elie222 Jul 30, 2025
4dba4d1
catch errors better
elie222 Jul 30, 2025
ee672e1
cut down logs
elie222 Jul 30, 2025
a9d1da5
remove logs
elie222 Jul 30, 2025
361422d
clean up type
elie222 Jul 30, 2025
e250fca
use email for llm converter
elie222 Jul 30, 2025
831b94a
split up ai report calls into many files
elie222 Jul 30, 2025
05a8082
reorder
elie222 Jul 30, 2025
d40f069
adjust schema to avoid errors. send less info for summary
elie222 Jul 30, 2025
f3822b3
Merge branch 'main' into persona-report
elie222 Jul 30, 2025
19e4d87
trace logs
elie222 Jul 30, 2025
d127dd3
Merge branch 'main' of github.com:elie222/inbox-zero into persona-report
edulelis Aug 13, 2025
930e874
Merge branch 'persona-report' of github.com:edulelis/inbox-zero into …
edulelis Aug 13, 2025
edccb73
docs
elie222 Aug 14, 2025
7047ad1
Merge branch 'main' into persona-report
elie222 Aug 14, 2025
01e0a02
fix up ai calls
elie222 Aug 14, 2025
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
32 changes: 24 additions & 8 deletions .cursor/rules/llm.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ Follow this standard structure for LLM-related functions:
import { z } from "zod";
import { createScopedLogger } from "@/utils/logger";
import { chatCompletionObject } from "@/utils/llms";
import type { UserEmailWithAI } from "@/utils/llms/types";
import type { EmailAccountWithAI } from "@/utils/llms/types";
import { createGenerateObject } from "@/utils/llms";

export async function featureFunction(options: {
inputData: InputType;
user: UserEmailWithAI;
emailAccount: EmailAccountWithAI;
}) {
const { inputData, user } = options;

Comment thread
elie222 marked this conversation as resolved.
Expand All @@ -48,10 +49,23 @@ export async function featureFunction(options: {
...
</data>

${user.about ? `<user_info>${user.about}</user_info>` : ""}`;
${emailAccount.about ? `<user_info>${emailAccount.about}</user_info>` : ""}`;
Comment thread
elie222 marked this conversation as resolved.

const result = await chatCompletionObject({
userAi: user,
// 7. Log inputs
logger.trace("Input", { system, prompt });

Comment thread
elie222 marked this conversation as resolved.
// 8. Set up and call LLM
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
label: "Feature Name",
modelOptions,
});


const result = await generateObject({
...modelOptions,
system,
prompt,
schema: z.object({
Expand All @@ -62,11 +76,13 @@ ${user.about ? `<user_info>${user.about}</user_info>` : ""}`;
}),
array_field: z.array(z.string()),
}),
userEmail: user.email,
usageLabel: "Feature Name",
});

return result.object;
// 9. Log outputs
logger.trace("Output", result.object);

// 10. Return validated result
return result.object;
}
Comment thread
elie222 marked this conversation as resolved.
```

Expand Down
3 changes: 3 additions & 0 deletions apps/web/app/(app)/[emailAccountId]/debug/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export default async function DebugPage(props: {
Rule History
</Link>
</Button>
<Button variant="outline" asChild>
<Link href={prefixPath(emailAccountId, "/debug/report")}>Report</Link>
</Button>
</div>
</div>
);
Expand Down
Loading
Loading