pres_security_benchmarking_llm/setup/code-runners.ts

19 lines
450 B
TypeScript
Raw Normal View History

2025-07-12 17:25:18 +02:00
import { defineCodeRunnersSetup } from '@slidev/types'
export default defineCodeRunnersSetup(() => {
return {
async python(code, ctx) {
// Somehow execute the code and return the result
const result = await executePythonCodeRemotely(code)
return {
text: result
}
},
html(code, ctx) {
return {
html: sanitizeHtml(code)
}
},
// or other languages, key is the language id
}
})