Skip to content

Conversation

@ryunsong-contentful
Copy link
Contributor

Purpose

  • AI Doc Parser produces an output that can be consumed by the cma to create entries based on the LLM's analysis
  • It will occasionally timeout since we are still limited to 30seconds

Follow ups

  • Improve UI flow so that Erin and Zach can use the app
  • Hook the CT parser into the Doc parser
  • Improve the AI parsers (CT and doc)
  • Increase function time outs

Results

Screenshot 2025-11-21 at 3 07 05 PM Screenshot 2025-11-21 at 3 06 56 PM
Response
{
  "sys": {
    "id": "6JJ6yrW19pKI1Dr0kgcnKD",
    "type": "AppActionCall",
    "createdAt": "2025-11-21T22:02:40.273Z",
    "updatedAt": "2025-11-21T22:02:54.719Z",
    "createdBy": {
      "sys": {
        "type": "Link",
        "linkType": "User",
        "id": "7FJf3IvgmQotV5As5zpGhc"
      }
    },
    "updatedBy": {
      "sys": {
        "type": "Link",
        "linkType": "User",
        "id": "7FJf3IvgmQotV5As5zpGhc"
      }
    },
    "space": {
      "sys": {
        "type": "Link",
        "linkType": "Space",
        "id": "9pm311s1i5qt"
      }
    },
    "environment": {
      "sys": {
        "type": "Link",
        "linkType": "Environment",
        "id": "master"
      }
    },
    "action": {
      "sys": {
        "type": "Link",
        "linkType": "AppAction",
        "id": "3nLAuoEuepbJMvdgp1qX6g"
      }
    },
    "appDefinition": {
      "sys": {
        "type": "Link",
        "linkType": "AppDefinition",
        "id": "653vTnuQw3j5onU1tUoH6t"
      }
    },
    "category": {
      "sys": {
        "type": "Link",
        "linkType": "AppActionCategory",
        "id": "Custom"
      }
    },
    "appActionCallResponse": {
      "sys": {
        "type": "Link",
        "linkType": "AppActionCallResponse",
        "id": "6JJ6yrW19pKI1Dr0kgcnKD"
      }
    },
    "status": "succeeded",
    "result": {
      "success": true,
      "response": {
        "summary": "Extracted 5 entries related to Universal Credit benefits, essential bills, and passported benefits.",
        "totalEntriesExtracted": 5,
        "createdEntries": [
          {
            "contentType": "xXnQzzfjZAxV8Duqb2nXl",
            "id": "6jRnS2xQE89KxUSOSX0ooz"
          },
          {
            "contentType": "xXnQzzfjZAxV8Duqb2nXl",
            "id": "7gEfUoivDclnJsNuGzCo5g"
          },
          {
            "contentType": "xXnQzzfjZAxV8Duqb2nXl",
            "id": "3eTHfdAd0jmvCEhVvnpOT3"
          },
          {
            "contentType": "xXnQzzfjZAxV8Duqb2nXl",
            "id": "5TYpwEPXXEuraMpBCT0m6F"
          },
          {
            "contentType": "xXnQzzfjZAxV8Duqb2nXl",
            "id": "7HFZqqSDVhCmFXQekkcrse"
          }
        ],
        "successRate": "5/5",
        "errors": []
      }
    }
  }

@ryunsong-contentful ryunsong-contentful requested a review from a team as a code owner November 21, 2025 22:10
@wiz-inc-38d59fb8d7
Copy link

wiz-inc-38d59fb8d7 bot commented Nov 21, 2025

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 Medium
Total 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

4. Create properly formatted entries that are ready to be created in Contentful via the CMA API
Important guidelines:
CRITICAL FIELD TYPE RULES - READ CAREFULLY:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"read" 🤖

Comment on lines +71 to +85
- Text: Long text (any length) - use for descriptions, content ✓
- Number: Integer or decimal values only ✓
- Boolean: true or false only ✓
- Date: ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.sssZ) ✓
- Location: { lat: number, lon: number } ✓
- Object: JSON object (use sparingly, check validations) ✓
- Array (of Symbol/Text/Number): Array of PRIMITIVE values ONLY ✓
Example: ["value1", "value2"] or [1, 2, 3]
- Array (of Link): ❌ NEVER USE - these reference other entries, skip entirely
Example: DO NOT create [{ title: "x", content: "y" }] - this will FAIL
- Link/Reference: ❌ NEVER USE - skip these fields (they reference other entries)
- RichText: ❌ NEVER USE - complex format not supported
FIELD FORMAT RULES:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's try one shot prompting

- NEVER create arrays of objects like [{ title: "x", content: "y" }] - this will FAIL
- If a field type is unclear or complex, SKIP it rather than guess
COMMON MISTAKES TO AVOID:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we need any locale comments in here? seems like a common gotcha

// INTEG-3261: Pass the ai document response to the observer for analysis
// createDocumentObservationsFromLLMResponse()

// INTEG-3264: Create the entries in Contentful using the entry service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably good to yank jira references as we complete these

Suggested change
// INTEG-3264: Create the entries in Contentful using the entry service

Comment on lines +50 to +54
// Optionally publish the entry immediately
// const publishedEntry = await cma.entry.publish(
// { spaceId, environmentId, entryId: createdEntry.sys.id },
// createdEntry
// );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Optionally publish the entry immediately
// const publishedEntry = await cma.entry.publish(
// { spaceId, environmentId, entryId: createdEntry.sys.id },
// createdEntry
// );

💨

@ryunsong-contentful ryunsong-contentful merged commit 37315ca into master Nov 21, 2025
14 checks passed
@ryunsong-contentful ryunsong-contentful deleted the INTEG-3264 branch November 21, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants