Search

Results include substring matches and semantically similar vals. Learn more
tmcw avatar
big_stories_ranks
@tmcw
// set by tmcw.big_story at 2023-07-21T13:27:35.553Z
Script
"ranks": [[1689676050115, 8], [1689679650435, 9], [1689683250422, 9], [1689686850141, 9], [1689690449649, 9], [1689694050
"https://www.nytimes.com/2023/07/18/technology/openai-chatgpt-facial-recognition.html": {
"title": "OpenAI Worries About What Its Chatbot Will Say About People’s Faces",
"url": "https://www.nytimes.com/2023/07/18/technology/openai-chatgpt-facial-recognition.html",
"section": "technology",
yawnxyz avatar
aiSimpleGroq
@yawnxyz
// set Deno.env.get("GROQ_API_KEY")
Script
import { ai } from "https://esm.town/v/yawnxyz/ai";
// set Deno.env.get("GROQ_API_KEY")
// console.log(await ai("tell me a joke in Spanish"))
console.log(await ai("tell me a reddit joke", {
provider: "anthropic",
model: "claude-3-haiku-20240307",
iamseeley avatar
pipeline
@iamseeley
Using Pipeline import Pipeline from "https://esm.town/v/iamseeley/pipeline"; const pipeline = new Pipeline("task", "model"); const result = await pipeline.run(inputs); exampleTranslation exampleTextClassification exampleFeatureExtraction exampleTextGeneration exampleSummarization exampleQuestionAnswering
Script
## Using Pipeline
```ts
const pipeline = new Pipeline("task", "model");
const result = await pipeline.run(inputs);
[exampleTranslation](https://www.val.town/v/iamseeley/exampleTranslation)
[exampleTextClassification](https://esm.town/v/iamseeley/exampleTextClassification)
const HUGGING_FACE_API_URL = "https://api-inference.huggingface.co/models";
const HUGGING_FACE_API_KEY = Deno.env.get("HUGGING_FACE_API_KEY");
const defaultModels = {
"feature-extraction": "sentence-transformers/all-MiniLM-L6-v2",
just_be avatar
oura
@just_be
An interactive, runnable TypeScript val by just_be
Script
import { Oura } from "https://deno.land/x/oura_api@0.3.1/mod.ts";
export const oura = (ouraPersonalAccessToken) => new Oura(ouraPersonalAccessToken);
yawnxyz avatar
aiBasicExample
@yawnxyz
// basic text generation
Script
import { ModelProvider, modelProvider } from "https://esm.town/v/yawnxyz/ai";
// basic text generation
let response = await modelProvider.gen({
prompt: 'hello, who am I speaking to?',
provider: 'google',
console.log('res:', response);
yawnxyz avatar
airtablesemanticsearch
@yawnxyz
Demo of adding an Embeddings column to Airtable (which calls the embeddings endpoint at yawnxyz/v/ai) and stores embeddings in an Airtable column, then performing search against it Usage: https://yawnxyz-airtablesemanticsearch.web.val.run/search?query=your+search+query&similarity_threshold=0.8&max_results=5&base_id=your_base_id&table_name=your_table_name&content_column=your_content_column&embedding_column=your_embedding_column https://yawnxyz-airtablesemanticsearch.web.val.run/search?query=cars
HTTP (deprecated)
Demo of adding an Embeddings column to Airtable (which calls the embeddings endpoint at yawnxyz/v/ai) and stores embeddings i
Usage:
- https://yawnxyz-airtablesemanticsearch.web.val.run/search?query=your+search+query&similarity_threshold=0.8&max_results=5&ba
- https://yawnxyz-airtablesemanticsearch.web.val.run/search?query=cars
const app = new Hono();
app.use('*', cors({
origin: '*',
allowMethods: ['GET', 'POST'],
allowHeaders: ['Content-Type'],
const airtableApiKey = Deno.env.get("AIRTABLE_API_KEY");
yawnxyz avatar
aiStreamingExample
@yawnxyz
An interactive, runnable TypeScript val by yawnxyz
HTTP (deprecated)
export default async (req) => {
const { readable, writable } = new TransformStream();
const writer = writable.getWriter();
const textEncoder = new TextEncoder();
// Get the prompt from the URL query
const url = new URL(req.url);
const prompt = url.searchParams.get("prompt") || "tell me a joke";
if (!prompt || prompt.trim() === "") {
return new Response("Please provide a prompt in the URL query.", {
headers: {
cotr avatar
launch_thrifty_idea_generator
@cotr
An interactive, runnable TypeScript val by cotr
HTTP (deprecated)
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response("ok");
const searchParams = new URL(req.url).searchParams;
console.log(searchParams);
const topic = searchParams.get("topic");
console.log(topic);
try {
const apiKey = Deno.env.get("GEMINI_API_KEY");
const url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent";
kingishb avatar
grayFinch
@kingishb
Quick AI web search via email (useful for apple watch)
Email
Quick AI web search via email (useful for apple watch)
// A dumb search engine I can use from my apple watch by emailing a question.
export default async function(e: Email) {
if (!e.from.endsWith("<brian@sarriaking.com>")) {
console.error("unauthorized!", e.from);
return;
const resp = await fetch("https://api.perplexity.ai/chat/completions", {
method: "POST",
headers: {
"accept": "application/json",
pomdtr avatar
ask_ai_web
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
import { Hono } from "npm:hono";
const app = new Hono();
kora avatar
aiBasicExample
@kora
Using Vercel AI SDK
Script
Using Vercel AI SDK
import { ModelProvider, modelProvider } from "https://esm.town/v/yawnxyz/ai";
// basic text generation
let response = await modelProvider.gen({
prompt: "hello, who am I speaking to?",
provider: "google",
} as any);
console.log("res:", response);
fal avatar
creative_upscaler
@fal
Creative Upscaler link to val - https://www.val.town/v/fal/creative_upscaler Usage const upscaledImage = @fal.creative_upscaler("an owl", "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png") Usage import fal from "npm:@fal-ai/serverless-client"; const result = await fal.subscribe("fal-ai/creative-upscaler", { input: { prompt: "an owl", image_url: "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png", }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); https://www.fal.ai/models/creative-upscaler
Script
## Creative Upscaler
link to val - https://www.val.town/v/fal/creative_upscaler
### Usage
```js
const upscaledImage = @fal.creative_upscaler("an owl", "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.
### Usage
export let creativeUpscaler = async (
prompt: string,
image_url: string,
creativity: number = 0.5,
vlad avatar
gptApiFramework
@vlad
Allows for automatic generation of Hono API comatible with GPTs. Endpoints' inputs and outputs need to be specified via types from which the Open API spec is generated automatically and available via /gpt/schema endpoint. Usage example: import { GptApi } from "https://esm.town/v/xkonti/gptApiFramework"; import { z } from "npm:zod"; /** * COMMON TYPES */ const ResponseCommandSchema = z.object({ feedback: z.string().describe("Feedback regarding submitted action"), command: z.string().describe("The command for the Mediator AI to follow strictly"), data: z.string().optional().describe("Additional data related to the given command"), }).describe("Contains feedback and further instructions to follow"); export type ResponseCommand = z.infer<typeof ResponseCommandSchema>; /** * INITIALIZE API */ const api = new GptApi({ url: "https://xkonti-planoverseerai.web.val.run", title: "Overseer AI API", description: "The API for interacting with the Overseer AI", version: "1.0.0", }); /** * REQUIREMENTS GATHERING ENDPOINTS */ api.nothingToJson<ResponseCommand>({ verb: "POST", path: "/newproblem", operationId: "new-problem", desc: "Endpoint for informing Overseer AI about a new problem presented by the User", requestSchema: null, requestDesc: null, responseSchema: ResponseCommandSchema, responseDesc: "Instruction on how to proceed with the new problem", }, async (ctx) => { return { feedback: "User input downloaded. Problem analysis is required.", command: await getPrompt("analyze-problem"), data: "", }; }); export default api.serve();
Script
Allows for automatic generation of Hono API comatible with GPTs. Endpoints' inputs and outputs need to be specified via types
Usage example:
```ts
* COMMON TYPES
const ResponseCommandSchema = z.object({
feedback: z.string().describe("Feedback regarding submitted action"),
export interface ApiInfo {
url: string;
title: string;
description: string;
fal avatar
sdxl
@fal
SDXL (fastest) https://www.fal.ai/models/stable-diffusion-xl link to val - https://www.val.town/v/fal/sdxl import * as fal from "npm:@fal-ai/serverless-client"; const result = await fal.subscribe("fal-ai/fast-sdxl", { input: { prompt: "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, });
Script
## SDXL (fastest)
https://www.fal.ai/models/stable-diffusion-xl
link to val - https://www.val.town/v/fal/sdxl
```js
const result = await fal.subscribe("fal-ai/fast-sdxl", {
input: {
export let sdxl = async (
prompt: string,
negative_prompt: string = "cartoon, illustration, animation. face. male, female",
image_size: string = "square_hd",
just_be avatar
indigoWhale
@just_be
An interactive, runnable TypeScript val by just_be
Script
import { Oura } from "https://deno.land/x/oura_api@0.3.1/mod.ts";
export const getReadinessScore = async (ouraToken) => {
const oura = new Oura(ouraToken);
const yesterday = (d => (d.setDate(d.getDate() - 1), d))(new Date()).toISOString().split("T")[0];
const today = new Date().toISOString().split("T")[0];
const docs = await oura.getDailyReadinessDocuments(yesterday, today);
return docs.data.reverse()[0].score;