Skip to content

Instantly share code, notes, and snippets.

import os
from typing import Any, Literal, TypedDict, override
import httpx
from langchain.chat_models import init_chat_model
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.messages import HumanMessage, SystemMessage
from langchain_core.runnables import RunnableConfig
from langchain_core.tools import ArgsSchema, BaseTool, InjectedToolCallId
from langgraph.graph import StateGraph
import { useMemo } from "react";
import { useAgentContext } from "../../agent.context";
import { Message } from "../../interfaces/messages";
import { EventType } from "@ag-ui/core";
import { AgentMessage } from "./AgentMessage";
import { useToolMessageRenderer } from "../../hooks/use-agent-action";
import { ToolStatus } from "../../interfaces/hook-interfaces";
import { useAgentCustomEventRenderer } from "../../hooks/use-agent-custom-event";
import axios from "axios";
import puppeteer, { Browser } from "puppeteer-core";
import { waitFor } from "../helpers/common";
const accounts = [
];
(async () => {
https://docs.google.com/document/d/18OVpAEuJ9pc8yvwYeSgR9-Z5CEnDJtzk/edit#
FB.api(
'/5886893214725401/events',
'POST',
{"data":"[\n {\n \"event_name\": \"Purchase\",\n \"event_time\": 1672910732,\n \"action_source\": \"website\",\n \"data_processing_options_country\": 1,\n \"event_id\": null,\n \"opt_out\": true,\n \"event_source_url\": null,\n \"data_processing_options\": null,\n \"data_processing_options_state\": 1000,\n \"user_data\": {\n \"em\": [\n \"7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068\"\n ],\n \"ph\": [\n null\n ],\n \"ct\": [\n null\n ]\n },\n \"custom_data\": {\n \"currency\": \"VND\",\n \"value\": 142.52\n }\n }\n]"},
function(response) {
// Insert your code here
}
);
@phamnghia
phamnghia / code.gs
Created October 30, 2022 14:03
Email Sender
const dsStatusColumn = 'D'; // Cột lưu trạng thái gửi email
const dsEmailColumn = 'G'; // Cột lưu email của ứng viên
const dsId = '1ag9lenOK5uzuZKFac-U3m_VA8jAuXXRKr3pq69RC_vk'; // ID của file lưu thông tin data
const dsSheetName = '2022'; // Tên của sheet lưu thông tin data
const tplId = '1t2hCBmSU7rsY-cy8YwdPsepHwuwVh3wQvYglCMFT-o8'; // ID của file template
const tplSheetName = 'Template'; // Tên của sheet lưu thông tin các template
function run() {
import axios from '@/libs/axios';
const state = () => ({
token: null,
user: null,
permissions: [],
headerConfigs: null,
})
const getters = {
(function(){function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r||t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}return t})()({1:[function(t,e,r){
// Require our cheerio dependency.
const cheerio = t("cheerio");
// Add the fetch listener.
addEventListener('fetch', event => {
event.respondWith(fetchAndModify(event.request))
})
const { AppConfig, Application, AppLang } = require("@pints/cores");
const mongoose = require("mongoose");
const morgan = require("morgan");
const bodyParser = require("body-parser");
const EmailProcessor = require("./worker");
module.exports = class Bootstrap extends Application{
config(){
return {
port : AppConfig("APP_PORT"),
@phamnghia
phamnghia / cluster.js
Last active December 11, 2017 13:30
Cluster
const cluster = require('cluster');
const http = require('http');
const numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
console.log(`Master ${process.pid} is running`);
// Fork workers.
for (let i = 0; i < numCPUs; i++) {
cluster.fork();