MCPcopy Create free account
hub / github.com/EpistasisLab/KRAGEN / checkIfCode

Function checkIfCode

KRAGEN_Dashboard/Frontend/src/components/codeUtils.js:1–13  ·  view source on GitHub ↗
(messageFromOpenai)

Source from the content-addressed store, hash-verified

1function checkIfCode(messageFromOpenai) {
2 // check if the messageFromOpenai contains python code. for example the messageFromOpenai looks like this:
3
4 let booleanCode = false;
5 messageFromOpenai.split("\n").forEach((line) => {
6 // console.log("checkIfCode-line", line);
7 if (line.includes("```python")) {
8 booleanCode = true;
9 }
10 });
11
12 return booleanCode;
13}
14
15function extractCode(messageFromOpenai) {
16 const regex = /```([\s\S]+?)```/;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected