Fix search.ts to use normalizeTickerOrNull for optional ticker
This commit is contained in:
@@ -17,7 +17,7 @@ import {
|
|||||||
listResearchJournalEntries,
|
listResearchJournalEntries,
|
||||||
listResearchJournalEntriesForUser
|
listResearchJournalEntriesForUser
|
||||||
} from '@/lib/server/repos/research-journal';
|
} from '@/lib/server/repos/research-journal';
|
||||||
import { normalizeTicker } from '@/lib/server/utils';
|
import { normalizeTickerOrNull } from '@/lib/server/utils';
|
||||||
|
|
||||||
type SearchDocumentScope = 'global' | 'user';
|
type SearchDocumentScope = 'global' | 'user';
|
||||||
type SearchDocumentSourceKind = 'filing_document' | 'filing_brief' | 'research_note';
|
type SearchDocumentSourceKind = 'filing_document' | 'filing_brief' | 'research_note';
|
||||||
@@ -1201,7 +1201,7 @@ export async function searchKnowledgeBase(input: SearchInput) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const limit = clampLimit(input.limit);
|
const limit = clampLimit(input.limit);
|
||||||
const normalizedTicker = normalizeTicker(input.ticker);
|
const normalizedTicker = normalizeTickerOrNull(input.ticker);
|
||||||
const includedSources = normalizeSearchSources(input.sources);
|
const includedSources = normalizeSearchSources(input.sources);
|
||||||
const client = getSqliteClient();
|
const client = getSqliteClient();
|
||||||
const [queryEmbedding] = await runAiEmbeddings([normalizedQuery]);
|
const [queryEmbedding] = await runAiEmbeddings([normalizedQuery]);
|
||||||
|
|||||||
Reference in New Issue
Block a user