Completions response now contains model and system_fingerprint props

This commit is contained in:
johnd0e
2024-07-23 23:53:30 +02:00
parent 7e86db2f49
commit e4983bc63a
2 changed files with 2 additions and 5 deletions

View File

@@ -152,7 +152,6 @@ Copilot provides following endpoints:
- `/v1/chat/completions` - `/v1/chat/completions`
- `tools` and other related properties are ignored. - `tools` and other related properties are ignored.
- Output is post-processed in order to remove differences from OpenAI's. - Output is post-processed in order to remove differences from OpenAI's.
The `model` property always appears as "gpt-4".
- `/v1/embeddings` - `/v1/embeddings`
- [`input`](https://platform.openai.com/docs/api-reference/embeddings/create#embeddings-create-input): - [`input`](https://platform.openai.com/docs/api-reference/embeddings/create#embeddings-create-input):
supports array of strings only supports array of strings only

View File

@@ -189,8 +189,7 @@ const clean = (str) => {
console.error(e); console.error(e);
return str; return str;
} }
json.model = "gpt-4"; // stub //json.model = "gpt-4"; // stub
//json.system_fingerprint = null;
json.object = "chat.completion"; json.object = "chat.completion";
delete json.prompt_filter_results; delete json.prompt_filter_results;
for (const item of json.choices) { for (const item of json.choices) {
@@ -212,8 +211,7 @@ const cleanLine = (str) => {
return str; return str;
} }
if (json.choices.length === 0) { return; } // json.prompt_filter_results if (json.choices.length === 0) { return; } // json.prompt_filter_results
json.model = "gpt-4"; // stub //json.model = "gpt-4"; // stub
//json.system_fingerprint = null;
json.object = "chat.completion.chunk"; json.object = "chat.completion.chunk";
for (const item of json.choices) { for (const item of json.choices) {
delete item.content_filter_offsets; delete item.content_filter_offsets;