Skip to content

Conversation

@Mark-H
Copy link
Member

@Mark-H Mark-H commented Mar 1, 2025

Not quite working yet.

The basic idea is, a (hidden) prompt tells the LLM what to do and forces it to return it as JSON. The assistant then renders that a certain way and adds a button that calls the callback so it can be inserted.

Example:

MODx.AIKit.openWithContext(
     "Generate a pagetitle, introtext, and keywords for <insert relevant page content here>.",
     function(callback) {
        console.log(callback);
     }
);

The thing I'm struggling with right now is getting the LLM to return only the JSON and not, like, JSON wrapped in a code block. Might need to look into structured outputs or find another way to distinguish from usual text and a callback.

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.

2 participants