Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on generating in-context ai responses in the assistant #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

1 participant