Skip to content

Instantly share code, notes, and snippets.

@bramses
Created January 4, 2022 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bramses/4fca6013df87884bb8128ad17dcea3d4 to your computer and use it in GitHub Desktop.
Save bramses/4fca6013df87884bb8128ad17dcea3d4 to your computer and use it in GitHub Desktop.
save vector
export async function writeObsidianDocumentToPostgres(prismaClient: PrismaClient, obsidianDocument: {
filename: string;
chunks: string[][];
embeddingsResponse: {
embeddings: number[][];
text: string[];
};
}) {
return prismaClient.obsidian.create({
data: {
doc: obsidianDocument,
filename: obsidianDocument.filename,
}
}).then((result) => {
return result;
})
.catch((error) => {
console.log(error);
return error;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment