https://www.boundaryml.com logo
🟡 New Problem Query
# questions
k
hello is this the right channel to ask about a problem i encountered
The llm response correctly indicated the "companies" field in its response, but after parsing it completely got dropped the mdoel :
Copy code
enum ProductType {
  Consumable @description("A consumable product")
  Service @description("A service")
}

class Company {
  name string
  registry string
  email string
  phone string
  street string
  city string
  zip string
  vat string
  website string
}

class Contact {
  name string
  email string
  phone string
  job string
}

class Product {
  name string
  detailed_type ProductType
  unit_price float
  quantity int
}

class DocumentData {
  companies Company[]
  contacts Contact[]
  products Product[]
}
Copy code
---LLM REPLY---
     {
    "companies": [
    {
    "name": "Hall-Boyd",
    "registry": null,
    "email": null,
    "phone": null,
    "street": "8719 Reed Street Apt, 120",
    "city": "Brittany Dale",
    "zip": "93895",
    "vat": "977-76-9492",
    "website": null
    },
    {
    "name": "Haas and Sons",
    "registry": null,
    "email": null,
    "phone": "Walterschester, LA 26239",
    "street": null,
    "city": null,
    "zip": "26239",
    "vat": "981-73-4585",
    "website": null
    }
    ],
    "contacts": [
    ],
    "products": [
    {
    "name": "3D Printed Mat Vortex Illusion",
    "detailed_type": "Consumable",
    "unit_price": 11.63,
    "quantity": 3,
    },
    {
    "name": "Living room Rug Carpet Floors Doors Round Mat",
    "detailed_type": "Consumable",
    "unit_price": 232.65,
    "quantity": 1,
    },
    {
    "name": "New Golden Brown Oriental Rug",
    "detailed_type": "Consumable",
    "unit_price": 232.65,
    "quantity": 1,
    },
    {
    "name": "4X6 Oushak Chobi Floral Hand-Knotted Foyer Carpet",
    "detailed_type": "Consumable",
    "unit_price": 10560,
    "quantity": 1,
    },
    {
    "name": "YILONG5.5'x8'Handknotted",
    "detailed_type": "Consumable",
    "unit_price": 10560,
    "quantity": 11,
    },
    {
    "name": "Classic Blue Carpet 0790",
    "detailed_type": "Consumable",
    "unit_price": null,
    "quantity": null,
    },
    {
    "name": "Pretty Woman Small Large Long",
    "detailed_type": "Consumable",
    "unit_price": 36.3,
    "quantity": 1,
    }
    ],
    }
Copy code
---Parsed Response (class DocumentData)---
    {
      "companies": [],
      "contacts": [],
      "products": [
        {
          "name": "3D Printed Mat Vortex Illusion",
          "detailed_type": "Consumable",
          "unit_price": 11.63,
          "quantity": 3
        },
        {
          "name": "Living room Rug Carpet Floors Doors Round Mat",
          "detailed_type": "Consumable",
          "unit_price": 232.65,
          "quantity": 1
        },
        {
          "name": "New Golden Brown Oriental Rug",
          "detailed_type": "Consumable",
          "unit_price": 232.65,
          "quantity": 1
        },
        {
          "name": "4X6 Oushak Chobi Floral Hand-Knotted Foyer Carpet",
          "detailed_type": "Consumable",
          "unit_price": 10560.0,
          "quantity": 1
        },
        {
          "name": "YILONG5.5'x8'Handknotted",
          "detailed_type": "Consumable",
          "unit_price": 10560.0,
          "quantity": 11
        },
        {
          "name": "Pretty Woman Small Large Long",
          "detailed_type": "Consumable",
          "unit_price": 36.3,
          "quantity": 1
        }
      ]
    }
Okey it turns out that i should've specified optional for certain fields and remove the instruction that tells the llm to manually input null
v
Glad you were able to resolve that
2 Views