JSON Extraction Issues from Claygent Output in Assistant
I get an output from Claygent like this: --- [{"ContactFullName":"","ContactTitle":"","Email":"info@360cpacorp.com","FirmPhone":"310-997-0995","FirmAddress":"23133 Hawthorne Blvd Ste 203","City":"Torrance","State":"CA","PostalCode":"90505","ProfileURL":"https://www.360cpacorp.com/Contact-Us","Source":"https://www.360cpacorp.com/Contact-Us","EmailDomainReferenced":"360cpacorp.com"}] --- Then, the following Assistant can't interpret that JSON with the following prompt: --- { "messages": [ { "role": "system", "content": "You are a specialized extraction agent that converts an unstructured narrative about firm leadership and contact details into a normalized JSON object. You will be given the following variable: - Response 2.0 : a free-text description OR a JSON object that may include decision-maker names and titles, phone, address, emails, and profile URLs. --- ### Core Task: Extract the information from **Response 2.0** and return **only** a single JSON object that matches the exact schema below. --- ### Output Schema (exact keys): { \"decision_makers\": [ { \"name\": string, \"title\": string } ], \"firm_phone\": string|null, \"firm_address\": string|null, \"emails\": [string], \"profile_urls\": [string], \"counts\": { \"decision_makers\": number } } --- ### Normalization Rules: - Parse decision-maker entries appearing as \"Name (Title)\"; store \"name\" as the plain person name and \"title\" as the on-page title (e.g., \"Partner\"). - If multiple decision makers are present, include all (up to 10); otherwise return an empty array if none are present. - \"firm_phone\": use the firm-level phone if shown; otherwise null. - \"firm_address\": use the most complete single-line mailing address if shown; otherwise null. - \"emails\": collect all visible email addresses as plain strings (no markdown); return [] if none. - \"profile_urls\": collect visible profile or leadership URLs as raw strings (no markdown); return [] if none. - \"counts.decision_makers\": set to the length of \"decision_makers\". - Do **not** invent or infer data (e.g., do not synthesize email formats). Extract only what is present. - Strip markdown; preserve URLs as raw strings. - If a field is missing, use null for single-value fields and [] for arrays. --- ### Output Constraints: - Return **valid JSON only**. No prose, no markdown, no keys beyond the schema, no trailing commas. - Minify the JSON (no newlines/indentation). - The output must be deterministic and based strictly on the provided text or JSON Object." }, { "role": "user", "content": "Response: Response 2.0" } ], "temperature": 1, "max_completion_tokens": 1000 } --- It can handle free-text just fine but breaks at the JSON level. Any assistance?
