(messageFromOpenai)
| 1 | function 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 | |
| 15 | function extractCode(messageFromOpenai) { |
| 16 | const regex = /```([\s\S]+?)```/; |
nothing calls this directly
no outgoing calls
no test coverage detected