Versions

  • v13

    8/16/2024
    Open: Version
    Changes from v12 to v13
    +2
    -1
    import { sqlite } from "https://esm.town/v/std/sqlite";
    import { parseFeed } from "jsr:@mikaelporttila/rss@*";
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";
    import { sql } from "npm:drizzle-orm";
    import { desc, drizzle } from "npm:drizzle-orm/libsql";
    import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";

    ⦚ 78 unchanged lines ⦚
    import { sqlite } from "https://esm.town/v/std/sqlite";
    import { parseFeed } from "jsr:@mikaelporttila/rss@*";
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";
    import { sql } from "npm:drizzle-orm";
    import { desc } from "npm:drizzle-orm";
    import { drizzle } from "npm:drizzle-orm/libsql";
    import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";

    ⦚ 78 unchanged lines ⦚
  • v12

    8/16/2024
    Open: Version
    Changes from v11 to v12
    +2
    -2
    import { sqlite } from "https://esm.town/v/std/sqlite";
    import { parseFeed } from "jsr:@mikaelporttila/rss@*";
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";
    import { sql } from "npm:drizzle-orm";
    import { drizzle } from "npm:drizzle-orm/libsql";
    import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";

    ⦚ 7 unchanged lines ⦚
    const result = await db.select({
    tweet: tweets.value,
    }).from(tweets).limit(10);

    const resultJson = JSON.stringify(result);
    ⦚ 66 unchanged lines ⦚
    import { sqlite } from "https://esm.town/v/std/sqlite";
    import { parseFeed } from "jsr:@mikaelporttila/rss@*";
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";
    import { sql } from "npm:drizzle-orm";
    import { desc, drizzle } from "npm:drizzle-orm/libsql";
    import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";

    ⦚ 7 unchanged lines ⦚
    const result = await db.select({
    tweet: tweets.value,
    }).from(tweets).orderBy(desc(tweets.key)).limit(10);

    const resultJson = JSON.stringify(result);
    ⦚ 66 unchanged lines ⦚
  • v11

    8/8/2024
    Open: Version
    Changes from v10 to v11
    +1
    -2
    ⦚ 67 unchanged lines ⦚
    please analyze rss feed and write a html which is a summary website in Japanese foucsing following points:
    - short summary of the tweet
    - link to the tweet
    - time tweeted
    only return html, with no code enclosure \`\`\`,no yapping.`);
    ⦚ 4 unchanged lines ⦚
    const res = await run();

    // return res as html Response
    // return res as html Response
    return new Response(res, {
    ⦚ 5 unchanged lines ⦚
    ⦚ 67 unchanged lines ⦚
    please analyze rss feed and write a html which is a summary website in Japanese foucsing following points:
    - short summary of the tweet
    - link to the tweet (you need to replace domain in the link from http://nitter.net/... to https//x.com/...)
    - time tweeted
    only return html, with no code enclosure \`\`\`,no yapping.`);
    ⦚ 4 unchanged lines ⦚
    const res = await run();

    // return res as html Response
    return new Response(res, {
    ⦚ 5 unchanged lines ⦚
  • v10

    8/8/2024
    Open: Version
    Changes from v9 to v10
    +5
    -9
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";
    import { sqlite } from "https://esm.town/v/std/sqlite";
    import { parseFeed } from "jsr:@mikaelporttila/rss@*";
    import { sql } from "npm:drizzle-orm";
    import { drizzle } from "npm:drizzle-orm/libsql";
    import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";

    //await sqlite.execute("CREATE TABLE IF NOT EXISTS tweets (published TEXT PRIMARY KEY, entry TEXT NOT NULL)");
    const db = drizzle(sqlite as any);
    const tweets = sqliteTable("tweets", {
    ⦚ 3 unchanged lines ⦚

    const result = await db.select({
    tweet: tweets.value}).from(tweets).limit(10);

    const resultJson = JSON.stringify(result);
    ⦚ 20 unchanged lines ⦚

    async function run() {
    // extract from
    const tweets =
    const chatSession = model.startChat({
    generationConfig,
    // safetySettings: Adjust safety settings
    ⦚ 4 unchanged lines ⦚
    parts: [
    {
    text:
    `I give you rss feed, then ask something. here is rss feed:
    ${resultJson}`,
    },
    ⦚ 19 unchanged lines ⦚
    import { sqlite } from "https://esm.town/v/std/sqlite";
    import { parseFeed } from "jsr:@mikaelporttila/rss@*";
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";
    import { sql } from "npm:drizzle-orm";
    import { drizzle } from "npm:drizzle-orm/libsql";
    import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";

    // await sqlite.execute("CREATE TABLE IF NOT EXISTS tweets (published TEXT PRIMARY KEY, entry TEXT NOT NULL)");
    const db = drizzle(sqlite as any);
    const tweets = sqliteTable("tweets", {
    ⦚ 3 unchanged lines ⦚

    const result = await db.select({
    tweet: tweets.value,
    }).from(tweets).limit(10);

    const resultJson = JSON.stringify(result);
    ⦚ 20 unchanged lines ⦚

    async function run() {
    const chatSession = model.startChat({
    generationConfig,
    // safetySettings: Adjust safety settings
    ⦚ 4 unchanged lines ⦚
    parts: [
    {
    text: `I give you rss feed, then ask something. here is rss feed:
    ${resultJson}`,
    },
    ⦚ 19 unchanged lines ⦚
    return result.response.text();
    }

  • v9

    8/8/2024
    Open: Version
    Changes from v8 to v9
    +22
    -2
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";

    const apiKey = Deno.env.get("GEMINI_API_KEY");
    ⦚ 18 unchanged lines ⦚

    async function run() {
    const chatSession = model.startChat({
    generationConfig,
    ⦚ 6 unchanged lines ⦚
    {
    text:
    "I give you rss feed, please ask my favor: \n\nRSS:\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" version=\"2.0\">\n <channel>\n <atom:link href=\"http://nitter.net/jeremyphoward/rss\" rel=\"self\" type=\"application/rss+xml\" />\n <title>Jeremy Howard / @jeremyphoward</title>\n <link>http://nitter.net/jeremyphoward</link>\n <description>Twitter feed for: @jeremyphoward. Generated by nitter.net\n</description>\n <language>en-us</language>\n <ttl>40</ttl>\n <image>\n <title>Jeremy Howard / @jeremyphoward</title>\n <link>http://nitter.net/jeremyphoward</link>\n <url>http://nitter.net/pic/pbs.twimg.com%2Fprofile_images%2F1279600070145437696%2FeocLhSLu_400x400.jpg</url>\n <width>128</width>\n <height>128</height>\n </image>\n <item>\n <title>RT by @jeremyphoward: &quot;We estimate that the decline in Nuclear power Plants caused by Chernobyl led to the loss of approximately 141 million expected life years in the U.S., 33 in the U.K. and 318 million globally&quot;. https://www.nber.org/conferences/si-2024-political-economy</title>\n <dc:creator>@hparedes_c</dc:creator>\n <description><![CDATA[<p>\"We estimate that the decline in Nuclear power Plants caused by Chernobyl led to the loss of approximately 141 million expected life years in the U.S., 33 in the U.K. and 318 million globally\". <a href=\"https://www.nber.org/conferences/si-2024-political-economy\">nber.org/conferences/si-2024…</a></p>\n<img src=\"http://nitter.net/pic/media%2FGTPrUz_WwAEkja9.png\" style=\"max-width:250px;\" />\n<img src=\"http://nitter.net/pic/media%2FGTPrpwoWsAENZHP.png\" style=\"max-width:250px;\" />]]></description>\n <pubDate>Wed, 24 Jul 2024 10:26:14 GMT</pubDate>\n <guid>http://nitter.net/hparedes_c/status/1816057296088154561#m</guid>\n <link>http://nitter.net/hparedes_c/status/1816057296088154561#m</link>\n </item>\n <item>\n <title>RT by @jeremyphoward: We received tons of great submissions to the Build with Claude June 2024 contest from @AnthropicA
    },
    ],
    ⦚ 19 unchanged lines ⦚
    }

    // run();

    export default async function(req: Request): Promise<Response> {
    ⦚ 10 unchanged lines ⦚
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";
    import { sqlite } from "https://esm.town/v/std/sqlite";
    import { parseFeed } from "jsr:@mikaelporttila/rss@*";
    import { sql } from "npm:drizzle-orm";
    import { drizzle } from "npm:drizzle-orm/libsql";
    import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";

    //await sqlite.execute("CREATE TABLE IF NOT EXISTS tweets (published TEXT PRIMARY KEY, entry TEXT NOT NULL)");
    const db = drizzle(sqlite as any);
    const tweets = sqliteTable("tweets", {
    key: text("published"),
    value: text("entry").notNull(),
    });

    const result = await db.select({
    tweet: tweets.value}).from(tweets).limit(10);

    const resultJson = JSON.stringify(result);

    const apiKey = Deno.env.get("GEMINI_API_KEY");
    ⦚ 18 unchanged lines ⦚

    async function run() {
    // extract from
    const tweets =
    const chatSession = model.startChat({
    generationConfig,
    ⦚ 6 unchanged lines ⦚
    {
    text:
    `I give you rss feed, then ask something. here is rss feed:
    ${resultJson}`,
    },
  • v8

    8/8/2024
    Open: Version
    Changes from v7 to v8
    +6
    -1
    ⦚ 46 unchanged lines ⦚
    });

    const result = await chatSession.sendMessage("please write a html which is a summary website in Japanese. only return html, with no code enclosure ```, no yapping.");
    return result.response.text();
    }
    ⦚ 14 unchanged lines ⦚
    ⦚ 46 unchanged lines ⦚
    });

    const result = await chatSession.sendMessage(`
    please analyze rss feed and write a html which is a summary website in Japanese foucsing following points:
    - short summary of the tweet
    - link to the tweet
    - time tweeted
    only return html, with no code enclosure \`\`\`,no yapping.`);
    return result.response.text();
    }
    ⦚ 14 unchanged lines ⦚
  • v7

    8/8/2024
    Open: Version
    Changes from v6 to v7
    +1
    -1
    ⦚ 46 unchanged lines ⦚
    });

    const result = await chatSession.sendMessage("please make summary website in html. only return html, no yapping.");
    return result.response.text();
    }
    ⦚ 14 unchanged lines ⦚
    ⦚ 46 unchanged lines ⦚
    });

    const result = await chatSession.sendMessage("please write a html which is a summary website in Japanese. only return html, with no code enclosure ```, no yapping.");
    return result.response.text();
    }
    ⦚ 14 unchanged lines ⦚
  • v6

    8/6/2024
    Open: Version
    Changes from v5 to v6
    +14
    -5
    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";


    const apiKey = Deno.env.get("GEMINI_API_KEY");
    if (!apiKey) {
    ⦚ 35 unchanged lines ⦚
    parts: [
    {
    text:
    "Thank you. what should I do for you?",
    },
    ],
    ⦚ 3 unchanged lines ⦚

    const result = await chatSession.sendMessage("please make summary website in html. only return html, no yapping.");
    console.log(result.response.text());
    }

    run();


    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";

    const apiKey = Deno.env.get("GEMINI_API_KEY");
    if (!apiKey) {
    ⦚ 35 unchanged lines ⦚
    parts: [
    {
    text: "Thank you. what should I do for you?",
    },
    ],
    ⦚ 3 unchanged lines ⦚

    const result = await chatSession.sendMessage("please make summary website in html. only return html, no yapping.");
    return result.response.text();
    }

    // run();

    export default async function(req: Request): Promise<Response> {
    const res = await run();

    // return res as html Response
    // return res as html Response
    return new Response(res, {
    headers: {
    "content-type": "text/html; charset=UTF-8",
    },
    });
    }
  • v5

    8/6/2024
    Open: Version
    +56
    -0

    import { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } from "npm:@google/generative-ai";


    const apiKey = Deno.env.get("GEMINI_API_KEY");
    if (!apiKey) {
    throw new Error("GEMINI_API_KEY environment variable is not set");
    }

    const genAI = new GoogleGenerativeAI(apiKey);

    const model = genAI.getGenerativeModel({
    model: "gemini-1.5-flash",
    systemInstruction: "あなたは優秀な日本語のアシスタントです。ツイートに関するRSSフィードを解析してください。",
    });

    const generationConfig = {
    temperature: 1,
    topP: 0.95,
    topK: 64,
    maxOutputTokens: 8192,
    responseMimeType: "text/plain",
    };

    async function run() {
    const chatSession = model.startChat({
    generationConfig,
    // safetySettings: Adjust safety settings
    // See https://ai.google.dev/gemini-api/docs/safety-settings
    history: [
    {
    role: "user",
    parts: [
    {
    text:
    "I give you rss feed, please ask my favor: \n\nRSS:\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" version=\"2.0\">\n <channel>\n <atom:link href=\"http://nitter.net/jeremyphoward/rss\" rel=\"self\" type=\"application/rss+xml\" />\n <title>Jeremy Howard / @jeremyphoward</title>\n <link>http://nitter.net/jeremyphoward</link>\n <description>Twitter feed for: @jeremyphoward. Generated by nitter.net\n</description>\n <language>en-us</language>\n <ttl>40</ttl>\n <image>\n <title>Jeremy Howard / @jeremyphoward</title>\n <link>http://nitter.net/jeremyphoward</link>\n <url>http://nitter.net/pic/pbs.twimg.com%2Fprofile_images%2F1279600070145437696%2FeocLhSLu_400x400.jpg</url>\n <width>128</width>\n <height>128</height>\n </image>\n <item>\n <title>RT by @jeremyphoward: &quot;We estimate that the decline in Nuclear power Plants caused by Chernobyl led to the loss of approximately 141 million expected life years in the U.S., 33 in the U.K. and 318 million globally&quot;. https://www.nber.org/conferences/si-2024-political-economy</title>\n <dc:creator>@hparedes_c</dc:creator>\n <description><![CDATA[<p>\"We estimate that the decline in Nuclear power Plants caused by Chernobyl led to the loss of approximately 141 million expected life years in the U.S., 33 in the U.K. and 318 million globally\". <a href=\"https://www.nber.org/conferences/si-2024-political-economy\">nber.org/conferences/si-2024…</a></p>\n<img src=\"http://nitter.net/pic/media%2FGTPrUz_WwAEkja9.png\" style=\"max-width:250px;\" />\n<img src=\"http://nitter.net/pic/media%2FGTPrpwoWsAENZHP.png\" style=\"max-width:250px;\" />]]></description>\n <pubDate>Wed, 24 Jul 2024 10:26:14 GMT</pubDate>\n <guid>http://nitter.net/hparedes_c/status/1816057296088154561#m</guid>\n <link>http://nitter.net/hparedes_c/status/1816057296088154561#m</link>\n </item>\n <item>\n <title>RT by @jeremyphoward: We received tons of great submissions to the Build with Claude June 2024 contest from @AnthropicA
    },
kj9-summary.web.val.run
Updated: August 16, 2024