(t: string, s: string)
| 77 | }; |
| 78 | |
| 79 | export async function embedForSector(t: string, s: string): Promise<number[]> { |
| 80 | if (!sector_configs[s]) throw new Error(`Unknown sector: ${s}`); |
| 81 | if (tier === "hybrid") return gen_syn_emb(t, s); |
| 82 | if (tier === "smart" && env.emb_kind !== "synthetic") { |
| 83 | const syn = gen_syn_emb(t, s), |
| 84 | sem = await get_sem_emb(t, s), |
| 85 | comp = compress_vec(sem, 128); |
| 86 | return fuse_vecs(syn, comp); |
| 87 | } |
| 88 | if (tier === "fast") return gen_syn_emb(t, s); |
| 89 | return await get_sem_emb(t, s); |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Batch embed query text for ALL sectors in one API call. |
no test coverage detected