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
const embeddings = new OpenAIEmbeddings(); | |
const loader = new PlaywrightWebBaseLoader(url, { | |
launchOptions: { headless: true }, | |
gotoOptions: { waitUntil: 'networkidle' }, | |
}); | |
const [html] = await loader.load(); | |
const splitter = new RecursiveCharacterTextSplitter({ | |
chunkSize: 2500, | |
chunkOverlap: 1, | |
}); |
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
import { markdownToBlocks } from '@tryfabric/martian'; | |
import { NotionToMarkdown } from 'notion-to-md'; | |
@Controller('/api/tools') | |
export class ToolsController { | |
@Post('/markdown-notion') | |
async convert(@Body() body) { | |
return markdownToBlocks(body.markdown); | |
} |
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
<?php | |
require_once('../gpt3turbo.php'); | |
$question = 'what Buddha said about happines?'; | |
// wyciągamy słowa kluczowe | |
$keywords = $gpt3->query('return up to 2 keywords (only nouns) separated by spaces for this sentence: '.$question); | |
// jeśli GPT użyje kropki lub przecinka jako spearatora, to zmieniamy go na spację | |
$keywords = preg_replace('/[,.]+/',' ',$keywords); |
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
print("hello") |
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
#If WinActive("ahk_exe msedge.exe") | |
^+y:: | |
Clipboard := "" | |
Send ^l | |
Sleep, 50 | |
Send ^c | |
ClipWait, 2 | |
if ErrorLevel | |
{ | |
MsgBox, Failed to copy URL. |
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
tell application "System Events" | |
set frontmostApplication to name of first application process whose frontmost is true | |
set browserName to "" | |
if frontmostApplication is "Arc" then | |
tell application "Arc" to return URL of active tab of window 1 | |
else if frontmostApplication is "Google Chrome" then | |
tell application "Google Chrome" to return URL of active tab of window 1 | |
else if frontmostApplication is "Brave Browser" then | |
tell application "Brave Browser" to return URL of active tab of window 1 |
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
tell application "System Events" | |
set frontmostApplication to name of first application process whose frontmost is true | |
set browserName to "" | |
if frontmostApplication is "Arc" then | |
tell application "Arc" to return title of active tab of window 1 | |
else if frontmostApplication is "Google Chrome" then | |
tell application "Google Chrome" to return title of active tab of window 1 | |
else if frontmostApplication is "Brave Browser" then | |
tell application "Brave Browser" to return title of active tab of window 1 |
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
curl -s <https://api.openai.com/v1/completions> \\ | |
-H "Content-Type: application/json" \\ | |
-H "Authorization: Bearer $OPENAI_API_KEY" \\ | |
-d '{ | |
"model": "text-davinci-003", | |
"prompt": "Hello", | |
"temperature": 0.7, | |
"max_tokens": 256, | |
"top_p": 1, | |
"frequency_penalty": 0, |
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
/opt/homebrew/bin/node -e "(async () => {const response = await fetch('$KMVAR_webhook', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify($KMVAR_json)});const json = await response.json();console.log(JSON.stringify(json));})()" |
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
const { encode } = require('@nem035/gpt-3-encoder') | |
exports.handler = async (event, context) => { | |
if (event.httpMethod === 'POST') { | |
try { | |
const payload = JSON.parse(event.body); | |
const text = payload.text; | |
return { |