Install lodash-es in client-libs for omit function
This commit is contained in:
@@ -14,11 +14,13 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"form-data": "^4.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"node-fetch": "^3.3.2",
|
||||
"openai-beta": "npm:openai@4.0.0-beta.7",
|
||||
"openai-legacy": "npm:openai@3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash-es": "^4.17.8",
|
||||
"@types/node": "^20.4.8",
|
||||
"dotenv": "^16.3.1",
|
||||
"tsx": "^3.12.7",
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { ChatCompletion, ChatCompletionChunk } from "openai-beta/resources/chat";
|
||||
import { omit } from "lodash-es";
|
||||
|
||||
export default function mergeChunks(
|
||||
base: ChatCompletion | null,
|
||||
chunk: ChatCompletionChunk
|
||||
chunk: ChatCompletionChunk,
|
||||
): ChatCompletion {
|
||||
if (base === null) {
|
||||
return mergeChunks({ ...chunk, choices: [] }, chunk);
|
||||
|
||||
Reference in New Issue
Block a user