Versions

  • v45

    7/10/2024
    Open: Version
    Changes from v44 to v45
    +1
    -1
    ⦚ 74 unchanged lines ⦚
    }}
    >
    [made with Substrate]
    </a>
    </p>
    ⦚ 16 unchanged lines ⦚
    ⦚ 74 unchanged lines ⦚
    }}
    >
    [made with substrate]
    </a>
    </p>
    ⦚ 16 unchanged lines ⦚
  • v44

    7/10/2024
    Open: Version
    Changes from v43 to v44
    +12
    -2
    ⦚ 52 unchanged lines ⦚
    maxWidth: `${pageWidth}px`,
    fontFamily,
    textTransform: "uppercase",
    }}
    >
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>
    <a
    ⦚ 25 unchanged lines ⦚
    ⦚ 52 unchanged lines ⦚
    maxWidth: `${pageWidth}px`,
    fontFamily,
    }}
    >
    <h1
    style={{
    fontSize: "36px",
    textAlign: "center",
    margin: 0,
    fontFamily,
    marginTop: "20px",
    textTransform: "uppercase",
    }}
    >
    Shotclip
    </h1>
    <p style={{ textAlign: "center", margin: 0 }}>
    <a
    ⦚ 25 unchanged lines ⦚
  • v43

    7/10/2024
    Open: Version
    Changes from v42 to v43
    +1
    -0
    ⦚ 61 unchanged lines ⦚
    style={{
    textDecoration: "none",
    }}
    >
    [made with Substrate]
    ⦚ 18 unchanged lines ⦚
    ⦚ 61 unchanged lines ⦚
    style={{
    textDecoration: "none",
    color: "white",
    }}
    >
    [made with Substrate]
    ⦚ 18 unchanged lines ⦚
  • v42

    7/10/2024
    Open: Version
    Changes from v41 to v42
    +10
    -1
    ⦚ 56 unchanged lines ⦚
    >
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>[made with Substrate]</p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    {res.map(s => (
    ⦚ 14 unchanged lines ⦚
    ⦚ 56 unchanged lines ⦚
    >
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>
    <a
    href="https://www.substrate.run/"
    style={{
    textDecoration: "none",
    }}
    >
    [made with Substrate]
    </a>
    </p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    {res.map(s => (
    ⦚ 14 unchanged lines ⦚
  • v41

    7/10/2024
    Open: Version
    Changes from v40 to v41
    +9
    -1
    ⦚ 46 unchanged lines ⦚
    <html>
    <link rel="stylesheet" href="https://unpkg.com/missing.css@1.1.1" />
    <main style={{ padding: "20px", minWidth: `${pageWidth}px`, maxWidth: `${pageWidth}px`, fontFamily }}>
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>[made with Substrate]</p>
    ⦚ 16 unchanged lines ⦚
    ⦚ 46 unchanged lines ⦚
    <html>
    <link rel="stylesheet" href="https://unpkg.com/missing.css@1.1.1" />
    <main
    style={{
    padding: "20px",
    minWidth: `${pageWidth}px`,
    maxWidth: `${pageWidth}px`,
    fontFamily,
    textTransform: "uppercase",
    }}
    >
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>[made with Substrate]</p>
    ⦚ 16 unchanged lines ⦚
  • v40

    7/10/2024
    Open: Version
    Changes from v39 to v40
    +1
    -1
    ⦚ 48 unchanged lines ⦚
    <main style={{ padding: "20px", minWidth: `${pageWidth}px`, maxWidth: `${pageWidth}px`, fontFamily }}>
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>Made with Substrate</p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    {res.map(s => (
    ⦚ 14 unchanged lines ⦚
    ⦚ 48 unchanged lines ⦚
    <main style={{ padding: "20px", minWidth: `${pageWidth}px`, maxWidth: `${pageWidth}px`, fontFamily }}>
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>[made with Substrate]</p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    {res.map(s => (
    ⦚ 14 unchanged lines ⦚
  • v39

    7/10/2024
    Open: Version
    Changes from v38 to v39
    +1
    -1
    ⦚ 47 unchanged lines ⦚
    <link rel="stylesheet" href="https://unpkg.com/missing.css@1.1.1" />
    <main style={{ padding: "20px", minWidth: `${pageWidth}px`, maxWidth: `${pageWidth}px`, fontFamily }}>
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>Made with Substrate</p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    ⦚ 15 unchanged lines ⦚
    ⦚ 47 unchanged lines ⦚
    <link rel="stylesheet" href="https://unpkg.com/missing.css@1.1.1" />
    <main style={{ padding: "20px", minWidth: `${pageWidth}px`, maxWidth: `${pageWidth}px`, fontFamily }}>
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily, marginTop: "20px" }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>Made with Substrate</p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    ⦚ 15 unchanged lines ⦚
  • v38

    7/10/2024
    Open: Version
    Changes from v37 to v38
    +1
    -1
    ⦚ 47 unchanged lines ⦚
    <link rel="stylesheet" href="https://unpkg.com/missing.css@1.1.1" />
    <main style={{ padding: "20px", minWidth: `${pageWidth}px`, maxWidth: `${pageWidth}px`, fontFamily }}>
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0 }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>Made with Substrate</p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    ⦚ 15 unchanged lines ⦚
    ⦚ 47 unchanged lines ⦚
    <link rel="stylesheet" href="https://unpkg.com/missing.css@1.1.1" />
    <main style={{ padding: "20px", minWidth: `${pageWidth}px`, maxWidth: `${pageWidth}px`, fontFamily }}>
    <h1 style={{ fontSize: "36px", textAlign: "center", margin: 0, fontFamily }}>Shotclip</h1>
    <p style={{ textAlign: "center", margin: 0 }}>Made with Substrate</p>
    <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "10px", paddingTop: "20px" }}>
    ⦚ 15 unchanged lines ⦚
  • v37

    7/10/2024
    Open: Version
    +67
    -0

    /** @jsxImportSource npm:react **/
    import process from "node:process";
    import { renderToString } from "npm:react-dom@18/server";
    import { QueryVectorStore, sb, Substrate } from "npm:substrate";

    type ShotResult = {
    id: string;
    distance: number;
    metadata: {
    doc: string; // base64 img data
    doc_id: string;
    };
    };

    async function getResults(q: string, n: number): Promise<ShotResult[]> {
    const substrate = new Substrate({
    apiKey: process.env.SUBSTRATE_API_KEY,
    });
    const collectionName = "shotclip";

    const query = new QueryVectorStore({
    collection_name: collectionName,
    model: "clip",
    query_strings: [q],
    include_metadata: true,
    top_k: n,
    });
    const res = await substrate.run(query);
    console.log(q, res.get(query).results[0]);
    return res.get(query).results[0] as ShotResult[];
    }

    export default async (req: Request) => {
    const searchParams = new URL(req.url).searchParams;
    const { prompt = "tarantino", n = 12 } = Object.fromEntries(searchParams);
    const res = await getResults(prompt, Number(n));
kousun12-shotclip.web.val.run
Updated: July 10, 2024