PawanOsman / ChatGPT-Official

ChatGPT Client using official OpenAI API
MIT License
100 stars 23 forks source link

The response has no identifier for code content? #6

Closed lslzl3000 closed 1 year ago

lslzl3000 commented 1 year ago

The api return plain text for all content, which is fine for most of cases. But for code, is there any identifier to mark code content?

like markdown style start with ``` e.g. current res:

You: give me a js sort example ChatGPT:

Here is an example of a JavaScript sort function:

function sortArray(arr) { arr.sort(function(a, b) { return a - b; }); }

It should be mark with ```:

ChatGPT: Here is an example of a JavaScript sort function:

Here is an example of a JavaScript sort function: 

function sortArray(arr) { 
  arr.sort(function(a, b) { 
    return a - b; 
  }); 
}

Does OpenAI not provide any relevant identifier or filtered on the node module side?

PawanOsman commented 1 year ago

the response is markdown and its returned by OpenAI, nothing changed by this Package