Checkpoint frontend UI/UX overhaul and ingestion embed benchmark work
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export interface SuggestResponse {
|
||||
suggestions: string[];
|
||||
}
|
||||
|
||||
export async function getDrugSuggestions(prefix: string): Promise<string[]> {
|
||||
const trimmed = prefix.trim();
|
||||
if (!trimmed) return [];
|
||||
|
||||
try {
|
||||
const response = await fetch(`/api/suggest?q=${encodeURIComponent(trimmed)}`);
|
||||
if (!response.ok) return [];
|
||||
const data: SuggestResponse = await response.json();
|
||||
return data.suggestions || [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
export * from "./sendChatMessage";
|
||||
export * from "./getDrugSuggestions";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user