This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Optional, TypedDict | |
import modal | |
from modal import gpu, build, enter, exit, method | |
class Document(TypedDict): | |
content: str | |
metadata: dict | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAncestorStack(element) { | |
let ancestorStack = []; | |
while (element && element !== document.body) { | |
let elementDetails = { | |
tagName: element.tagName, | |
classes: Array.from(element.classList), | |
dataAttributes: Object.assign({}, element.dataset) | |
}; | |
ancestorStack.push(elementDetails); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copied from here, converted to TS, created a `field` completion mode which is more granular: https://www.npmjs.com/package/partial-json-parser?activeTab=code | |
type TokenType = | |
| 'brace' | |
| 'paren' | |
| 'separator' | |
| 'delimiter' | |
| 'string' | |
| 'number' | |
| 'name'; |