ugcinc 3.70.0 → 3.71.0

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.
@@ -682,7 +682,14 @@ function llmTypeToSchemaType(type) {
682
682
  function llmObjectSchemaToPropertySchema(fields) {
683
683
  const result = {};
684
684
  for (const field of fields) {
685
- if (field.type === 'array' && field.items === 'object' && field.objectSchema) {
685
+ if (field.type === 'object' && field.objectSchema) {
686
+ // Top-level object with nested schema
687
+ result[field.name] = {
688
+ type: 'object',
689
+ itemSchema: llmObjectSchemaToPropertySchema(field.objectSchema),
690
+ };
691
+ }
692
+ else if (field.type === 'array' && field.items === 'object' && field.objectSchema) {
686
693
  // Nested array of objects
687
694
  result[field.name] = {
688
695
  type: 'object',
@@ -733,6 +740,11 @@ function getOutputSchema(nodeType, nodeConfig, outputPortId) {
733
740
  const outputFields = llmConfig?.outputFields;
734
741
  if (outputFields) {
735
742
  const field = outputFields.find(f => f.name === outputPortId);
743
+ // Handle top-level object type
744
+ if (field?.type === 'object' && field.objectSchema) {
745
+ return llmObjectSchemaToPropertySchema(field.objectSchema);
746
+ }
747
+ // Handle array of objects
736
748
  if (field?.type === 'array' && field.items === 'object' && field.objectSchema) {
737
749
  return llmObjectSchemaToPropertySchema(field.objectSchema);
738
750
  }
package/dist/types.d.ts CHANGED
@@ -860,11 +860,11 @@ export interface LLMOutputField {
860
860
  name: string;
861
861
  /** Optional - guides LLM on expected content */
862
862
  description?: string;
863
- /** Output type */
864
- type: 'string' | 'number' | 'boolean' | 'array';
863
+ /** Output type (includes 'object' for top-level objects) */
864
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
865
865
  /** For array types - the item type (including 'object' for arrays of objects) */
866
866
  items?: 'string' | 'number' | 'boolean' | 'object';
867
- /** For array of objects - nested field definitions (max 3 levels of nesting) */
867
+ /** For array of objects or top-level objects - nested field definitions (max 3 levels of nesting) */
868
868
  objectSchema?: LLMOutputField[];
869
869
  /** Exact array length constraint */
870
870
  length?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "3.70.0",
3
+ "version": "3.71.0",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",