@tstdl/base 0.92.4 → 0.92.6

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 CHANGED
@@ -176,8 +176,9 @@ let AiService = class AiService {
176
176
  this.#logger.verbose('Extracting data...');
177
177
  const result = await this.getModel(options?.model ?? this.defaultModel).generateContent({
178
178
  generationConfig: {
179
- maxOutputTokens: 4096,
180
- temperature: 0.5,
179
+ maxOutputTokens: 8192,
180
+ temperature: 0.75,
181
+ ...options,
181
182
  responseMimeType: 'application/json',
182
183
  responseSchema
183
184
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.4",
3
+ "version": "0.92.6",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,5 +1,5 @@
1
1
  import { NotSupportedError } from '../../errors/not-supported.error.js';
2
- import { fromEntries, objectEntries } from '../../utils/object/object.js';
2
+ import { fromEntries, hasOwnProperty, objectEntries } from '../../utils/object/object.js';
3
3
  import { isDefined, isNotNull, isNumber, isString } from '../../utils/type-guards.js';
4
4
  import { ArraySchema } from '../schemas/array.js';
5
5
  import { BooleanSchema } from '../schemas/boolean.js';
@@ -15,8 +15,10 @@ import { UnionSchema } from '../schemas/union.js';
15
15
  import { schemaTestableToSchema } from '../testable.js';
16
16
  export function convertToOpenApiSchema(testable) {
17
17
  const schema = schemaTestableToSchema(testable);
18
+ const openApiSchema = convertToOpenApiSchemaBase(schema);
18
19
  return {
19
- ...convertToOpenApiSchemaBase(schema),
20
+ ...openApiSchema,
21
+ ...(hasOwnProperty(openApiSchema, 'nullable') ? undefined : { nullable: false }),
20
22
  ...(isNotNull(schema.description) ? { description: schema.description } : undefined),
21
23
  ...(isDefined(schema.example) ? { example: schema.example } : undefined)
22
24
  };