Skip to content
Open
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
6 changes: 3 additions & 3 deletions __tests__/classifyMemory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ describe('classifyAndSaveMemory', () => {
})
expect(openaiInstance.embeddings.create).toHaveBeenCalledWith({ model: 'text-embedding-3-small', input: 'hello' })
expect(saveMemoryMock).toHaveBeenCalledWith({
user_id: 'u1',
thread_id: 't1',
userId: 'u1',
threadId: 't1',
content: 'hello',
embedding: [0.2],
memory_type: 'note'
type: 'note'
})
})

Expand Down
4 changes: 2 additions & 2 deletions __tests__/memoryHelpers.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { saveMemory, searchMemories } from '@/lib/utils/supabase'

jest.mock('@supabase/ssr', () => ({
createBrowserClient: jest.fn()
createServerClient: jest.fn()
}))

jest.mock('uuid', () => ({ v4: jest.fn(() => 'uuid-123') }))
Expand All @@ -11,7 +11,7 @@ const insertMock = jest.fn(() => ({ select: () => ({ single: () => Promise.resol
const rpcMock = jest.fn(() => Promise.resolve({ data: [{ id: 'm1' }], error: null }))

beforeEach(() => {
require('@supabase/ssr').createBrowserClient.mockReturnValue({
require('@supabase/ssr').createServerClient.mockReturnValue({
from: jest.fn(() => ({ insert: insertMock })),
rpc: rpcMock
})
Expand Down
6 changes: 5 additions & 1 deletion app/api/chat/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,11 @@ You avoid filler, corporate jargon, or motivational fluff. You're not afraid to

Keep responses short unless deeper unpacking is required. Speak to one person. If someone asks how to do something, prioritize clarity and next steps. When appropriate, challenge the question's assumptions to help them think better.

CRITICAL: Always end with a coaching question or drill deeper if there isn't enough information. Remember that defining the question is half of the solution.`;
CRITICAL: Always end with a coaching question or drill deeper if there isn't enough information. Remember that defining the question is half of the solution.

You may receive relevant notes or document excerpts as system messages from the user's history or vector store. Summarize or cite these when answering. These snippets should inform your response but don't repeat them verbatim unless it truly helps.

Provide a complete answer first. Ask a follow-up coaching question only when it helps clarify goals or encourage next steps.`;

// Convert messages format for Responses API
// The first message is the system message, the rest are conversation messages
Expand Down
Loading