fix: builds

This commit is contained in:
Vinit Shah 2024-08-07 18:18:56 -07:00
parent bfb0e86d76
commit 30e944a4f1
9 changed files with 14 additions and 16 deletions

View file

@ -9,7 +9,7 @@ import { z } from "zod";
import { seededRandom } from "./utils/seededRandom";
import { bulkInsertKv } from "./utils/kvBulkInsert";
export async function initQuery(env: Env, model: string = "gpt-4o") {
export async function initQuery(env: Env, model: string = "gemini-1.5-pro") {
const embeddings = new OpenAIEmbeddings({
apiKey: env.OPENAI_API_KEY,
modelName: "text-embedding-3-small",
@ -35,12 +35,13 @@ export async function initQuery(env: Env, model: string = "gpt-4o") {
console.log("Selected model: ", selectedModel);
break;
case "gemini-1.5-pro":
console.log("YES GOOGLE");
const googleai = createGoogleGenerativeAI({
apiKey: env.GOOGLE_AI_API_KEY,
baseURL:
"https://gateway.ai.cloudflare.com/v1/47c2b4d598af9d423c06fc9f936226d5/supermemory/google-vertex-ai",
});
selectedModel = googleai.chat("models/gemini-1.5-pro-latest");
selectedModel = googleai.chat("models/gemini-pro");
console.log("Selected model: ", selectedModel);
break;
case "gpt-4o":
@ -49,7 +50,6 @@ export async function initQuery(env: Env, model: string = "gpt-4o") {
apiKey: env.OPENAI_API_KEY,
baseURL:
"https://gateway.ai.cloudflare.com/v1/47c2b4d598af9d423c06fc9f936226d5/supermemory/openai",
compatibility: "strict",
});
selectedModel = openai.chat("gpt-4o-mini");
break;

View file

@ -304,7 +304,7 @@ export async function queue(
throw insertResponse.error;
}
console.log(JSON.stringify(insertResponse));
contentId = insertResponse[0]?.id;
contentId = insertResponse[0]?.id || new Date().getTime();
console.log("this is the content Id", contentId);
if (storeToSpaces.length > 0) {
// Adding the many-to-many relationship between content and spaces

View file

@ -1,7 +1,7 @@
{
"manifest_version": 3,
"$schema": "https://json.schemastore.org/chrome-manifest",
"version": "2.63.1",
"version": "2.63.2",
"name": "supermemory",
"description": "An extension for https://supermemory.ai - an AI hub for all your bookmarks.",
"background": {

View file

@ -1,5 +1,6 @@
{
"devDependencies": {
"@extension-create/develop": "^1.8.0",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.5",
"@webpack-cli/generators": "^3.0.7",

View file

@ -86,7 +86,7 @@ export default function RootLayout({
>
{children}
<Toaster />
<PostHogPageView />
{/* <PostHogPageView /> */}
</body>
</PHProvider>
</html>

View file

@ -4,12 +4,6 @@ import posthog from "posthog-js";
import { PostHogProvider } from "posthog-js/react";
if (typeof window !== "undefined") {
if (
!process.env.NEXT_PUBLIC_POSTHOG_KEY ||
!process.env.NEXT_PUBLIC_POSTHOG_HOST
) {
console.error("PostHog key or host not found");
}
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
person_profiles: "identified_only",

View file

@ -26,8 +26,8 @@ bucket_name = "dev-r2-anycontext"
[[d1_databases]]
binding = "DATABASE"
database_name = "dev-d1-anycontext"
database_id = "fc562605-157a-4f60-b439-2a24ffed5b4c"
database_name = "prod-d1-supermemory"
database_id = "f527a727-c472-41d4-8eaf-3d7ba0f2f395"
[[env.production.d1_databases]]
binding = "DATABASE"

View file

@ -113,8 +113,8 @@ export const storedContent = createTable(
description: text("description", { length: 255 }),
url: text("url").notNull(),
savedAt: int("savedAt", { mode: "timestamp" }).notNull(),
baseUrl: text("baseUrl", { length: 255 }).unique(),
ogImage: text("ogImage", { length: 255 }),
baseUrl: text("baseUrl"),
ogImage: text("ogImage"),
type: text("type").default("page"),
image: text("image", { length: 255 }),
userId: text("user").references(() => users.id, {

3
pnpm-lock.yaml generated
View file

@ -338,6 +338,9 @@ importers:
specifier: ^1.0.7
version: 1.0.7(tailwindcss@3.4.7)
devDependencies:
'@extension-create/develop':
specifier: ^1.8.0
version: 1.8.0(browserslist@4.23.2)(esbuild@0.19.12)(typescript@5.3.3)(vue@3.4.34)(webpack-cli@5.1.4)
'@types/react':
specifier: ^18.0.9
version: 18.3.3