This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const decimalStringToCento = (decimalString: string): number => { | |
// Replace comma with dot to make it a valid float | |
const cleanedString = decimalString.replace(",", "."); | |
// Parse the string as a floating-point number | |
const floatValue = parseFloat(cleanedString); | |
// Multiply by 100 to get the cento number | |
const centoNumber = Math.round(floatValue * 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { ReactNode, useState } from "react"; | |
type Experiment = { | |
exposure: number; | |
render: ({ success }: { success: any }) => any; | |
name?: string; | |
}; | |
enum TestEvent { | |
"VIEW" = "View", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GoogleGenerativeAI, SchemaType } from "@google/generative-ai"; | |
const GEMINI_API_KEY = ""; // process.env.GEMINI_API_KEY | |
export const gemini = { | |
createEmbedding: async (content: string) => { | |
const genAI = new GoogleGenerativeAI(GEMINI_API_KEY); | |
const model = genAI.getGenerativeModel({ model: "text-embedding-004" }); | |
try { |
OlderNewer