huggingfacePipelinemain.tsx17 matches
1const HUGGING_FACE_API_URL = "https://api-inference.huggingface.co/models";
2const HUGGING_FACE_API_KEY = Deno.env.get("HUGGING_FACE_API_KEY");
34const defaultModels = {
6061async featureExtraction(input, options) {
62return this.callHuggingFaceAPI(input, options);
63}
6465async textClassification(input, options) {
66return this.callHuggingFaceAPI(input, options);
67}
6869async tokenClassification(input, options) {
70return this.callHuggingFaceAPI(input, options);
71}
7273async questionAnswering(input, options) {
74return this.callHuggingFaceAPI(input, options);
75}
7677async summarization(input, options) {
78return this.callHuggingFaceAPI(input, options);
79}
8081async translation(input, options) {
82return this.callHuggingFaceAPI(input, options);
83}
8485async textGeneration(input, options) {
86return this.callHuggingFaceAPI(input, options);
87}
8889async sentenceSimilarity(input, options) {
90return this.callHuggingFaceAPI(input, options);
91}
9293async callHuggingFaceAPI(payload, options) {
94try {
95const response = await fetch(`${HUGGING_FACE_API_URL}/${this.model}`, {
96method: "POST",
97headers: {
98"Authorization": `Bearer ${HUGGING_FACE_API_KEY}`,
99"Content-Type": "application/json"
100},
104if (!response.ok) {
105const error = await response.json();
106console.error("Hugging Face API Error:", error);
107return { error: `API request failed: ${error.error}` };
108}
109111return data;
112} catch (error) {
113console.error("Error calling Hugging Face API:", error);
114return { error: "Error calling Hugging Face API" };
115}
116}
sqliteExplorerAppREADME.md1 match
13## Authentication
1415Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
1617## Todos / Plans
sqliteExplorerAppmain.tsx2 matches
27<head>
28<title>SQLite Explorer</title>
29<link rel="preconnect" href="https://fonts.googleapis.com" />
3031<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32<link
33href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34rel="stylesheet"
35/>
1# OpenAI - [Docs ↗](https://docs.val.town/std/openai)
23Use OpenAI's chat completion API with [`std/openai`](https://www.val.town/v/std/openai). This integration enables access to OpenAI's language models without needing to acquire API keys.
45For free Val Town users, [all calls are sent to `gpt-3.5-turbo`](https://www.val.town/v/std/openaiproxy?v=5#L69).
34If these limits are too low, let us know! You can also get around the limitation by using your own keys:
35361. Create your own API key on [OpenAI's website](https://platform.openai.com/api-keys)
372. Create an [environment variable](https://www.val.town/settings/environment-variables?adding=true) named `OPENAI_API_KEY`
383. Use the `OpenAI` client from `npm:openai`:
39
blob_adminREADME.md1 match
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1011It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
1213# TODO
readwiseHighlightsmain.tsx2 matches
11queryParams.append("pageCursor", nextPageCursor);
12}
13console.log("Making export api request with params " + queryParams.toString());
14const response = await fetch("https://readwise.io/api/v2/export/?" + queryParams.toString(), {
15method: "GET",
16headers: {
readwiseHighlightsREADME.md1 match
1https://readwise.io/api_deets
23Not sure how to convert from a reader ID (string) to a readwise ID (number)
readwiseReaderDocumentListmain.tsx2 matches
43queryParams.append("location", location);
44}
45console.log("Making export api request with params " + queryParams.toString());
46const response = await fetch("https://readwise.io/api/v3/list/?" + queryParams.toString(), {
47method: "GET",
48headers: {
1Reader docs here: https://readwise.io/reader_api
23Adapted from the example code. Fetches items from Readwise Reader given a token, and optional updatedAfter and location parameters.
readwiseReaderReadItemsRssREADME.md2 matches
1Creates an RSS feed of my read items from Readwise Reader.
23Reader docs here: https://readwise.io/reader_api
45In order to get read items from Readwise Reader -> Workflowy, this turns the read items (aka "archive") into an RSS feed, which Zapier picks up, and creates bullets in Workflowy.
67Ideally would store the generated RSS or the last fetch date, and only get new items, but for now `readwiseReaderDocumentList` re-fetches the full history each time.