6});
7
8export async function getDatabase(databaseId: string) {
9 // get database
10 try {
6});
7
8export async function setCobrowse(pageId: string, cobrowse: boolean) {
9 try {
10 const page = await notion.pages.update({
1export async function blobKeyForHealthCheck() {
2 // get the url of this file
3 // we'll use this to get values for the blob key
1export async function blobKeyForDemoCobrowseStatus(id: string) {
2 // get the url of this file
3 // we'll use this to get values for the blob key
6});
7
8export async function enrichAgent(pageId: string, data: any) {
9 // console.log(data);
10 const properties =
6});
7
8export async function getDemoInteractions(pageId: string) {
9 const databaseId = Deno.env.get("GLANCE_INTERACTIONS_DB_ID");
10
39}
40
41export async function getAllInteractionsPages() {
42 const databaseId = Deno.env.get("GLANCE_INTERACTIONS_DB_ID");
43
69}
70
71export async function getAllInteractionsPagesWithPagination() {
72 const databaseId = Deno.env.get("GLANCE_INTERACTIONS_DB_ID");
73
6});
7
8export async function setAction(data: any) {
9 try {
10 const page = await notion.pages.create({
14}
15// Simple hook for mobile menu toggle
16function useMobileMenu() {
17 const [isOpen, setIsOpen] = useState(false);
18 const toggleMenu = () => setIsOpen(!isOpen);
22
23// Simple hook for tracking current hash for active nav styling
24function useCurrentHash() {
25 const [currentHash, setCurrentHash] = useState(() => window.location.hash.slice(1));
26
37}
38
39export function App({ initialData }: AppProps) {
40 // initialData
41 const { demoData, loading, error } = initialData;
1export async function pollEnabledStatus() {
2 // this shouldn't run forever just b/c someone forgot to close their browser tab with the demo in it
3 const interval = 1000; // 10000;
26}
27
28export default async function (req: Request): Promise<Response> {
29 // Only allow POST requests with form data
30 if (req.method !== "POST") {
161}
162
163// Helper function to extract sections from the response
164function extractSection(content: string, sectionName: string): string {
165 const regex = new RegExp(
166 `${sectionName}:?\\s*([\\s\\S]*?)(?=\\n\\d+\\.|\\n[A-Z_]+:|$)`,
171}
172
173// Helper function to extract sources
174function extractSources(content: string): string[] {
175 const sourcesSection = extractSection(content, "SOURCES");
176 if (sourcesSection === "No information found") {
Simple functional CSS library for Val Town
A helper function to build a file's email
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.