mirror of
https://gitea.com/PublicAffairs/openai-github-copilot.git
synced 2025-07-23 20:30:45 +02:00
Completions response now contains model and system_fingerprint props
This commit is contained in:
@@ -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
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user