Skip to content

Instantly share code, notes, and snippets.

View jsbeaudry's full-sized avatar

Beaudry Jean Sauvenel jsbeaudry

  • Parkour studio
  • Port-au-prince, Haiti
View GitHub Profile
import os
from dotenv import load_dotenv
from livekit import agents
from livekit.agents import AgentSession, Agent, RoomInputOptions
from livekit.plugins import noise_cancellation, silero, deepgram, openai, google
from livekit.plugins.turn_detector.multilingual import MultilingualModel
load_dotenv(".env.local")
import os
from dotenv import load_dotenv
from livekit import agents
from livekit.agents import AgentSession, Agent, RoomInputOptions
from livekit.plugins import noise_cancellation, silero, openai
from livekit.plugins.turn_detector.multilingual import MultilingualModel
load_dotenv(".env.local")
import json
import warnings
import librosa
import soundfile as sf
import numpy as np
from datasets import load_dataset
import mlx.core as mx
from nanocodec_mlx.models.audio_codec import AudioCodecModel
warnings.filterwarnings("ignore", category=UserWarning)
import librosa
import json
import warnings
import requests
import io
import numpy as np
import mlx.core as mx
import soundfile as sf
from nanocodec_mlx.models.audio_codec import AudioCodecModel
import { useEffect, useState } from "react";
import Haiex from "haiex-sdk";
const GELATO_KEY = "";
const MAGIC_KEY = "";
const INFURA_KEY = "";
let haiex;
@jsbeaudry
jsbeaudry / hawksoft_client_data.json
Last active February 19, 2024 19:12
hawksoft client model
{
"clientNumber":1,
"details":{
"officeId":1,
"clientType":"Customer",
"status":"Active",
"isPersonal":true,
"isCommercial":false,
"isLifeHealth":false,
"allowCrossSell":false,
{
"Form":{
"Id":"3",
"InternalName":"GayaPLInsuranceForm",
"Name":"Gaya PL Insurance Form"
},
"$version":8,
"$etag":"W/\"datetime'2024-03-12T16%3A33%3A07.8291841Z'\"",
"Date":"2024-03-01",
"HowDidYouFindUs":"Google",
@jsbeaudry
jsbeaudry / extractObjects.js
Created July 11, 2023 18:53
How to get validated objects of a streaming text from chatGPT API
const extractObjects = (arrayString) => {
const objectPattern = /{[^{}]*}/g;
const objects = arrayString.match(objectPattern);
if (objects) {
const parsedObjects = objects.map((objString) => {
try {
return JSON.parse(objString);
} catch (error) {
console.error("Error parsing object:", error);
@jsbeaudry
jsbeaudry / stripeSubscription.js
Last active July 8, 2023 17:31
A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout or Payment Links. We recommend creating a new Session each time your customer attempts to pay. Once payment is successful, the Checkout Session will contain a reference to the Customer, and either the successful PaymentInten…
const Stripe = require("stripe");
const { STRIPE_SECRET_KEY } = process.env;
const stripe = Stripe(STRIPE_SECRET_KEY);
const [planA, planB, planC] = [
"price_1Mj4hPI4ImfNjweeB0fXE9xA",
"price_1Mj4hPI4ImfNjweehhxUwzUh",
"price_1Mj4hQI4ImfNjweeP0q6iEuK",
@jsbeaudry
jsbeaudry / api.js
Created July 8, 2023 17:24
Digicel MonCash - MonCash is a mobile wallet that facilitates reliable, safe and convenient financial transactions to reduce the distance between people regardless of their location in Haiti. While providing its services to its customer base of over 1.5 million people, MonCash maintains its goal of expanding its range of available services.
const express = require('express');
const { createPayment, getCaptureById } = require('./moncash-api');
const app = express();
// API route to create payment
app.get('/payment/create', createPayment); // Parameters: amount, orderId
// API route to get capture by ID
app.get('/capture/getById', getCaptureById); // Parameters: orderId