Spaces:
Runtime error
Runtime error
Download src/lib/code-runner/code-runner.interface.ts from shyota/better-chatbot: direct link, hf CLI and curl.
- Browser
- Download file 767 Bytes
-
https://huggingface.co/spaces/shyota/better-chatbot/resolve/main/src/lib/code-runner/code-runner.interface.ts
- Command line
-
hf download hf://spaces/shyota/better-chatbot/src/lib/code-runner/code-runner.interface.ts
-
curl -L -o code-runner.interface.ts https://huggingface.co/spaces/shyota/better-chatbot/resolve/main/src/lib/code-runner/code-runner.interface.ts
767 Bytes
| export type LogEntry = { | |
| type: "log" | "error" | (string & {}); | |
| args: ({ type: "data"; value: any } | { type: "image"; value: string })[]; | |
| }; | |
| export type CodeRunnerResult = { | |
| success: boolean; | |
| logs: LogEntry[]; | |
| error?: string; | |
| executionTimeMs?: number; | |
| result?: any; | |
| }; | |
| export type CodeRunnerOptions = { | |
| code: string; | |
| timeout?: number; | |
| onLog?: (entry: LogEntry) => void; | |
| }; | |
| export type CodeWorkerRequest = { | |
| code: string; | |
| type: "javascript" | "python"; | |
| timeout?: number; | |
| id: string; | |
| }; | |
| export type CodeWorkerEvent = { | |
| id: string; | |
| type: "log"; | |
| entry: LogEntry; | |
| }; | |
| export type CodeWorkerResult = { | |
| id: string; | |
| type: "result"; | |
| result: CodeRunnerResult; | |
| }; | |
| export type CodeWorkerResponse = CodeWorkerEvent | CodeWorkerResult; | |