@tstdl/base 0.92.14 → 0.92.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/ai.service.js +10 -3
- package/package.json +1 -1
package/ai/ai.service.js
CHANGED
|
@@ -164,9 +164,16 @@ Always output the content and tags in ${options?.targetLanguage ?? 'the same lan
|
|
|
164
164
|
async generate(request) {
|
|
165
165
|
const googleContent = this.convertContents(request.contents);
|
|
166
166
|
const googleFunctionDeclarations = isDefined(request.functions) ? this.convertFunctions(request.functions) : undefined;
|
|
167
|
-
const generationConfig =
|
|
168
|
-
|
|
169
|
-
: request.generationOptions
|
|
167
|
+
const generationConfig = {
|
|
168
|
+
maxOutputTokens: request.generationOptions?.maxOutputTokens,
|
|
169
|
+
temperature: request.generationOptions?.temperature,
|
|
170
|
+
topP: request.generationOptions?.topP,
|
|
171
|
+
topK: request.generationOptions?.topK,
|
|
172
|
+
responseMimeType: isDefined(request.generationSchema) ? 'application/json' : undefined,
|
|
173
|
+
responseSchema: isDefined(request.generationSchema) ? convertToOpenApiSchema(request.generationSchema) : undefined,
|
|
174
|
+
presencePenalty: request.generationOptions?.presencePenalty,
|
|
175
|
+
frequencyPenalty: request.generationOptions?.frequencyPenalty
|
|
176
|
+
};
|
|
170
177
|
const generation = await this.getModel(request.model ?? this.defaultModel).generateContent({
|
|
171
178
|
generationConfig,
|
|
172
179
|
systemInstruction: request.systemInstruction,
|