DetectPromptFormat
While Storing Prompts, it helps detect JSON prompts., Markdown prompts or Plain Text
Be the first to rate this function Log in to vote
|
Binu Alexander - Show more from this author
ASC, https://www.linkedin.com/in/drbinualexander/ |
DetectPromptFormat ( "{\"prompt\": \"Summarize this record\", \"tone\": \"formal\"}" )
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
`DetectPromptFormat` looks at a prompt stored in a FileMaker field and tells you what kind of text it is. It first checks whether the content is structured JSON data — if it starts with `{` or `[` and parses correctly, it's JSON. If not, it looks for common Markdown formatting clues like headings, bold text, bullet lists, code blocks, and links, with extra weight given to prompt-specific headings like "SYSTEM PROMPT" and "USER PROMPT." If even one Markdown signal is found, it's labeled Markdown; otherwise it's Plain Text. The idea is to check JSON first (since that's a definitive yes-or-no test), then fall back to pattern-matching for Markdown, so your downstream logic always knows what format it's working with.
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.