Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mearman committed Jul 9, 2024
2 parents dea960c + be5c466 commit 67fb9c7
Show file tree
Hide file tree
Showing 16 changed files with 99 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ aliases: []
tags:
- breadboard
created: 2024-07-03T14:00:10
modified: 2024-07-03T15:43:53
modified: 2024-07-03T16:00:07
---

We're all frogs in the AI pot and it's surprising how much the temperature of the water has increased recently. The commoditisation of LLMs-as-a-service and the proliferation of their capabilities has thrown people's understanding of how difficult some problems are into disarray. Sure, this isn't a new problem, as [XKCD](https://xkcd.com/1425/) famously remarked on, but recently I think the dial has moved again.
Expand Down
164 changes: 0 additions & 164 deletions content/boards/exam-coach.bgl.json

This file was deleted.

4 changes: 2 additions & 2 deletions content/projects/Breadboard/Phase 2/Board for Each.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ The "Board for Each" is a versatile tool designed to simplify data processing ta

This board is used with the [Object Manipulator Board](projects/Breadboard/Phase%202/Object%20Manipulator%20Board.md) in the [Simple Hacker News Search](projects/Breadboard/Phase%202/Hacker%20News/simplified/Simple%20Hacker%20News%20Search.md) board to remove unnecessary attributes from the results array.

- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/board-for-each.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/public/graphs/board-for-each.json)
- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/board-for-each.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/public/graphs/board-for-each.json)
- [Open in Breadboard Web](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/board-for-each.json)

## Breadboard Web
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ modified: 2024-06-12T11:04:49

A tool worker board for retrieving search results from Google Custom Search Engine.

- [github.com/breadboard-ai/breadboard/packages/breadboard-web/src/boards/google-custom-search-engingine.ts](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/google-custom-search-engingine.ts)
- [github.com/breadboard-ai/breadboard/packages/breadboard-web/public/graphs/google-custom-search-engingine.json](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/public/graphs/google-custom-search-engingine.json) [🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/google-custom-search-engingine.json)
- [github.com/breadboard-ai/breadboard/packages/visual-editor/src/boards/google-custom-search-engine.ts](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/google-custom-search-engine.ts)
- [github.com/breadboard-ai/breadboard/packages/visual-editor/public/graphs/google-custom-search-engine.json](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/public/graphs/google-custom-search-engine.json) [🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/google-custom-search-engingine.json)

## References

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ created: 2024-06-13T09:21:01
modified: 2024-06-13T09:49:19
---

- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/hacker-news-firebase-story-from-id.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/public/graphs/hacker-news-firebase-story-from-id.json)
- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/hacker-news-firebase-story-from-id.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/public/graphs/hacker-news-firebase-story-from-id.json)

[Open in Breadboard Web](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/hacker-news-algolia-story-from-id.json)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ created: 2024-06-13T09:19:11
modified: 2024-06-14T21:48:07
---

- [TypeScrtipt](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/hacker-news-algolia-search.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/public/graphs/hacker-news-algolia-search.json)
- [TypeScrtipt](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/hacker-news-algolia-search.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/public/graphs/hacker-news-algolia-search.json)

[Open in Breadboard Web](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/hacker-news-algolia-search.json)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ created: 2024-06-13T09:22:10
modified: 2024-06-13T09:36:56
---

- [Firebase Story](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/hacker-news-firebase-story-from-id.ts)
- [Firebase Story](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/hacker-news-firebase-story-from-id.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/hacker-news-firebase-story-from-id.json)
- [Firebase Top Stories](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/hacker-news-firebase-top-story-ids.ts)
- [Firebase Top Stories](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/hacker-news-firebase-top-story-ids.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/hacker-news-firebase-top-story-ids.json)
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ classDef slotted stroke:#a64d79

## Source

- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/public/graphs/hacker-news-simplified-algolia-search.json)
- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/hacker-news-simplified-algolia-search.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/public/graphs/hacker-news-simplified-algolia-search.json)
- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/hacker-news-simplified-algolia-search.ts)
- [Open in Breadboard Web](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/hacker-news-simplified-algolia-search.json)

## Preview Mode
Expand Down
12 changes: 6 additions & 6 deletions content/projects/Breadboard/Phase 2/Holidays.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ Holiday Tool

Tool-worker boards using the free public [Nager.Date](https://date.nager.at/Api) API for holiday information. Useful for boards that are used for planning and/or scheduling.

- [Available Countries](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/nager.date/available-countries.ts)
- [Available Countries](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/nager.date/available-countries.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/nager.date/available-countries.json)
- [Country Info](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/nager.date/country-info.ts)
- [Country Info](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/nager.date/country-info.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/nager.date/country-info.json)
- [Is Today A Holiday](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/nager.date/is-today-public-holiday.ts)
- [Is Today A Holiday](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/nager.date/is-today-public-holiday.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/nager.date/is-today-public-holiday.json)
- [Long Weekend](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/nager.date/long-weekend.ts)
- [Long Weekend](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/nager.date/long-weekend.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/nager.date/long-weekend.json)
- [Next Worldwide Holiday](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/nager.date/next-holiday-worldwide.ts)
- [Next Worldwide Holiday](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/nager.date/next-holiday-worldwide.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/nager.date/next-holiday-worldwide.json)
- [Public Holidays](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/nager.date/public-holidays.ts)
- [Public Holidays](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/nager.date/public-holidays.ts)
[🔗](https://breadboard-ai.web.app/?board=https://raw.github.com/breadboard-ai/breadboard/main/packages/breadboard-web/public/graphs/nager.date/public-holidays.json)

<div>
Expand Down
14 changes: 7 additions & 7 deletions content/projects/Breadboard/Phase 2/Object Manipulator Board.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ The Object Manipulator board was developed to work initially with the [For Each

## How It Works

1. **Input Configuration**:
1. **Input Configuration**:
- Define the keys you are interested in.
- Choose between pick and omit modes based on your requirements.
1. **Sample Object Handling**:
1. **Sample Object Handling**:
- Apply the configuration to a sample object to observe the effects.
2. **Strict Mode Activation**:
2. **Strict Mode Activation**:
- Enable strict mode to ensure keys' presence according to the chosen operation mode.

## Usage Example

### Pick Mode

- **Configuration**: Picking `name` and `surname` from the input object.
- **Output**:
- **Output**:

```json
{
Expand All @@ -46,7 +46,7 @@ The Object Manipulator board was developed to work initially with the [For Each
### Omit Mode

- **Configuration**: Omitting `surname` from the input object.
- **Output**:
- **Output**:

```json
{
Expand All @@ -73,8 +73,8 @@ This board is used in the [Simple Hacker News Search](projects/Breadboard/Phase%

## Source

- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/src/boards/object-manipulator.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard-web/public/graphs/object-manipulator.json)
- [TypeScript](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/src/boards/object-manipulator.ts)
- [JSON](https://github.com/breadboard-ai/breadboard/blob/main/packages/visual-editor/public/graphs/object-manipulator.json)

## Breadboard Web

Expand Down
6 changes: 4 additions & 2 deletions content/projects/Breadboard/Phase 2/Review Reply Board.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ aliases:
- Automated Business Review Responses
- Review Reply Board
tags:
- board
- breadboard/phase/2
- business
- marketing
- board
created: 2024-06-12T09:26:13
modified: 2024-06-14T21:28:06
modified: 2024-07-03T17:18:47
---

A prototype has been developed for automating responses to business reviews using Google’s Gemini model. This prototype is particularly useful for businesses managing their reviews via the Google Business Profile API.
Expand Down Expand Up @@ -54,6 +54,8 @@ This demo board is a wrapper board to pass a sample review to the `business-revi

<iframe src="https://breadboard-ai.web.app/?board=https://raw.github.com/ExaDev/breadboard/business-review-reply/packages/breadboard-web/public/graphs/business-review-replier-demo.json" style="width: 100%; height: 500px; border: 0;"></iframe>

<iframe src="http://localhost:5173/?board=https://raw.github.com/ExaDev/breadboard/business-review-reply/packages/breadboard-web/public/graphs/business-review-replier-demo.json&embed" style="width: 100%; height: 500px; border: 0;"></iframe>

## Source Code

- [business-review-replier.ts](https://github.com/ExaDev/breadboard/blob/business-review-reply/packages/breadboard-web/src/boards/business-review-replier.ts)
Expand Down
20 changes: 12 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"rfdc": "^1.3.1",
"rimraf": "^5.0.7",
"serve-handler": "^6.1.5",
"shiki": "^1.10.0",
"shiki": "^1.10.3",
"source-map-support": "^0.5.21",
"to-vfile": "^8.0.0",
"toml": "^3.0.0",
Expand Down
6 changes: 3 additions & 3 deletions quartz/components/scripts/popover.inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { normalizeRelativeURLs } from "../../util/path"

const p = new DOMParser()
async function mouseEnterHandler(
this: HTMLLinkElement,
this: HTMLAnchorElement,
{ clientX, clientY }: { clientX: number; clientY: number },
) {
const link = this
Expand Down Expand Up @@ -33,7 +33,7 @@ async function mouseEnterHandler(
thisUrl.hash = ""
thisUrl.search = ""
const targetUrl = new URL(link.href)
const hash = targetUrl.hash
const hash = decodeURIComponent(targetUrl.hash)
targetUrl.hash = ""
targetUrl.search = ""

Expand Down Expand Up @@ -100,7 +100,7 @@ async function mouseEnterHandler(
}

document.addEventListener("nav", () => {
const links = [...document.getElementsByClassName("internal")] as HTMLLinkElement[]
const links = [...document.getElementsByClassName("internal")] as HTMLAnchorElement[]
for (const link of links) {
link.addEventListener("mouseenter", mouseEnterHandler)
window.addCleanup(() => link.removeEventListener("mouseenter", mouseEnterHandler))
Expand Down
14 changes: 13 additions & 1 deletion quartz/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,22 @@ ul,
.math {
color: var(--darkgray);
fill: var(--darkgray);
overflow-wrap: anywhere;
hyphens: auto;
}

p,
ul,
text,
a,
li,
ol,
ul,
.katex,
.math {
overflow-wrap: anywhere;
/* tr and td removed from list of selectors for overflow-wrap, allowing them to use default 'normal' property value */
}

.math {
&.math-display {
text-align: center;
Expand Down
57 changes: 40 additions & 17 deletions url-check.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S npx -y tsx --no-cache
import * as crypto from "crypto"
import * as fs from "fs"
import * as path from "path"
import * as crypto from "crypto";
import * as fs from "fs";
import * as path from "path";

const CACHE_DIR = "./.url-cache"
const CACHE_DURATION = 24 * 60 * 60 * 1000 // 24 hours in milliseconds
Expand Down Expand Up @@ -94,12 +94,19 @@ async function checkUrlStatus(url: string) {
}

function getCachedUrlStatus(url: string): UrlCheckType | null {
const cacheFilePath = path.join(CACHE_DIR, hashUrl(url))
const fileHash = hashUrl(url)
const cacheFilePath = path.join(CACHE_DIR, fileHash)
if (fs.existsSync(cacheFilePath)) {
const cacheContent = JSON.parse(fs.readFileSync(cacheFilePath, "utf8"))
const age = Date.now() - cacheContent.timestamp
if (age < CACHE_DURATION) {
return cacheContent.result
const cacheData = fs.readFileSync(cacheFilePath, "utf8")
try {
const cacheContent = JSON.parse(cacheData)
const age = Date.now() - cacheContent.timestamp
if (age < CACHE_DURATION) {
return cacheContent.result
}
} catch (error) {
console.error(`Error reading cache file for URL: ${url} from ${cacheFilePath}\n${cacheData}`)
throw error
}
}
return null
Expand All @@ -114,7 +121,7 @@ function cacheUrlStatus(url: string, result: UrlCheckType) {
timestamp: Date.now(),
result,
}
fs.writeFileSync(cacheFilePath, JSON.stringify(cacheContent, null, "'t"), "utf8")
fs.writeFileSync(cacheFilePath, JSON.stringify(cacheContent, null, "\t"), "utf8")
}

type UrlCheckType = {
Expand Down Expand Up @@ -241,10 +248,17 @@ function logWithStyles(message: string, styles: string[], log = console.log): vo

const directoryPath = "./content"
const fileExtensions = ["md"]
const ignoreUrls: string[] = ["https://distill.pub/2017/aia/"]
const ignoreUrls: string[] = [
"https://distill.pub/2017/aia/",
"https://www.healthline.com/health/fitness-exercise/benefits-of-exercise",
"https://huggingface.co/settings/tokens",
"https://www.mayoclinic.org/healthy-lifestyle/fitness/in-depth/exercise/art-20048389",
"https://www.cdc.gov/physicalactivity/basics/pa-health/index.htm",
]

await checkUrlsInDirectory(directoryPath, fileExtensions, ignoreUrls)
.then((results: Set<UrlCheckType>): void => {
const errors: any[] = []
await checkUrlsInDirectory(directoryPath, fileExtensions, ignoreUrls).then(
(results: Set<UrlCheckType>): void => {
console.log("URL check completed.\n")
const resultsArray = Array.from(results)
const failedUrls = resultsArray.filter(
Expand All @@ -267,7 +281,7 @@ await checkUrlsInDirectory(directoryPath, fileExtensions, ignoreUrls)
)
.join("\n\n"),
)
process.exit(1)
errors.push(...failedUrls)
} else {
console.debug(
applyStyles(["=".repeat(80), `SUCCESS`].join("\n"), [
Expand All @@ -276,7 +290,16 @@ await checkUrlsInDirectory(directoryPath, fileExtensions, ignoreUrls)
]),
)
}
})
.catch((error) => {
console.error("Error occurred:", error)
})
},
)

console.log("URL check completed.\n")

if (errors.length) {
console.error("Errors occurred:")
// errors.forEach((error) => console.error(error))
// console.error(errors)
process.exit(1)
} else {
console.log("No errors occurred.")
}

0 comments on commit 67fb9c7

Please sign in to comment.