Skip to content

Commit

Permalink
update namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Dec 14, 2024
1 parent 4902d8e commit 4500822
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}

const domain = getDocsDomainNode(req);
const namespace = `${embeddingModel.modelId}_${withoutStaging(domain)}`;
const namespace = `${withoutStaging(domain)}_${embeddingModel.modelId}`;
const messages = req.body.messages;

const orgMetadata = await getOrgMetadataForDomain(withoutStaging(domain));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const maxDuration = 900; // 15 minutes
export default async function handler(req: NextApiRequest, res: NextApiResponse): Promise<void> {
const domain = getDocsDomainNode(req);
const deleteExisting = req.query.deleteExisting === "true";
const namespace = `${embeddingModel.modelId}_${withoutStaging(domain)}`;
const namespace = `${withoutStaging(domain)}_${embeddingModel.modelId}`;

try {
const orgMetadata = await getOrgMetadataForDomain(withoutStaging(domain));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const model = openai.embedding("text-embedding-3-small");
export const runReindexTurbopuffer = async (domain: string): Promise<number> => {
return turbopufferUpsertTask({
apiKey: turbopufferApiKey(),
namespace: `${model.modelId}_${domain}`,
namespace: `${domain}_${model.modelId}`,
payload: {
environment: fdrEnvironment(),
fernToken: fernToken(),
Expand All @@ -38,7 +38,7 @@ export const runSemanticSearchTurbopuffer = async (
topK: number = 10,
): Promise<FernTurbopufferRecord[]> => {
return queryTurbopuffer(query, {
namespace: `${model.modelId}_${domain}`,
namespace: `${domain}_${model.modelId}`,
apiKey: turbopufferApiKey(),
topK,
vectorizer: async (text) => {
Expand Down

0 comments on commit 4500822

Please sign in to comment.