@activepieces/pieces-common
Advanced tools
Comparing version 0.2.19 to 0.2.20
{ | ||
"name": "@activepieces/pieces-common", | ||
"version": "0.2.19", | ||
"version": "0.2.20", | ||
"type": "commonjs", | ||
@@ -8,3 +8,3 @@ "dependencies": { | ||
"@sinclair/typebox": "0.32.35", | ||
"axios": "1.7.4", | ||
"axios": "1.7.7", | ||
"dayjs": "1.11.9", | ||
@@ -11,0 +11,0 @@ "deepmerge": "4.3.1", |
@@ -14,7 +14,7 @@ import { ServerContext } from '@activepieces/pieces-framework'; | ||
model: string; | ||
numImages: number; | ||
quality: string; | ||
size: string; | ||
}; | ||
export type AIImageCompletion = { | ||
url: string; | ||
image: string; | ||
}; | ||
@@ -64,3 +64,3 @@ export type AIChat = { | ||
name: string; | ||
type: "string" | "number" | "boolean"; | ||
type: 'string' | 'number' | 'boolean'; | ||
description?: string; | ||
@@ -67,0 +67,0 @@ isRequired: boolean; |
@@ -23,6 +23,8 @@ "use strict"; | ||
prompt: params.prompt, | ||
n: params.numImages, | ||
quality: params.quality, | ||
size: params.size, | ||
response_format: 'b64_json', | ||
}); | ||
const url = response.data[0].url; | ||
return url ? { url } : null; | ||
const imageBase64 = response.data[0].b64_json; | ||
return imageBase64 ? { image: imageBase64 } : null; | ||
}), | ||
@@ -90,4 +92,3 @@ }, | ||
return { | ||
choices: completion.choices | ||
.map((choice) => { | ||
choices: completion.choices.map((choice) => { | ||
var _a; | ||
@@ -99,9 +100,11 @@ return ({ | ||
}), | ||
call: toolCall ? { | ||
id: toolCall.id, | ||
function: { | ||
name: toolCall.function.name, | ||
arguments: JSON.parse(toolCall.function.arguments), | ||
}, | ||
} : null, | ||
call: toolCall | ||
? { | ||
id: toolCall.id, | ||
function: { | ||
name: toolCall.function.name, | ||
arguments: JSON.parse(toolCall.function.arguments), | ||
}, | ||
} | ||
: null, | ||
created: completion.created, | ||
@@ -108,0 +111,0 @@ id: completion.id, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
86367
1285
+ Addedaxios@1.7.7(transitive)
- Removedaxios@1.7.4(transitive)
Updatedaxios@1.7.7