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

CreatorCore prompt generation endpoint #1591

Conversation

clpetersonucf
Copy link
Member

@clpetersonucf clpetersonucf commented Jul 9, 2024

This PR is built on top of #1582, which should be merged first

Adds a CreatorCore pipeline that builds on top of the question generation feature, enabling widgets to submit prompts through Materia to a generative AI and process the response:

  • Adds the Materia.CreatorCore.submitPrompt(message) method to the CreatorCore.
  • Adds a onPromptResponse(status, message) callback for widget creators to implement to handle the response of a generative AI prompt.
  • Adds a widget_prompt_generate() API endpoint to facilitate generation.
  • Extends the new Widget_Question_Generator class with a new generate_from_prompt method to handle generic prompt requests.

Local Testing

Testing this feature end-to-end requires a widget that implements (and has access to) the new CreatorCore method and callback. This in turn requires ucfopen/Materia-Widget-Dev-Kit#123, which implements the new materia-widget-dependencies 0.4.0 package. To test end-to-end:

  1. Setup your local Materia installation with this branch and ensure your .env.local has the required values to enable question generation.
  2. Clone MWDK dev/3.0.3 locally and use yarn link to link the repo to a widget of your choosing.
  3. Implement Materia.CreatorCore.submitPrompt and onPromptResponse in your widget creator.
  4. Install your widget to your local copy of Materia for testing.

@clpetersonucf clpetersonucf changed the base branch from master to dev/10.3.0 July 16, 2024 19:18
@clpetersonucf clpetersonucf changed the base branch from dev/10.3.0 to question-generation September 13, 2024 14:42
@clpetersonucf clpetersonucf marked this pull request as ready for review September 17, 2024 19:03
clpetersonucf and others added 4 commits September 18, 2024 10:09
- A new 'uses_prompt_generation' property is now defined in the Widget class
- The property will be passed into the widget instance, accessible in initNewWidget and initExistingWidget
- Widgets can read this property to determine if the Materia instance supports generative AI features/prompt submission
- A migration was also created to create this field. We can squish this migration with the is_generable migration when the PR is 100% ready
@clpetersonucf clpetersonucf changed the base branch from question-generation to dev/10.3.0 October 2, 2024 18:56
…ion-endpoint

Add 'uses_prompt_generation' field to widgets
@clpetersonucf clpetersonucf merged commit e6c2c59 into ucfopen:dev/10.3.0 Oct 28, 2024
2 checks passed
@clpetersonucf clpetersonucf deleted the feature/creator-core-prompt-generation-endpoint branch October 28, 2024 16:05
@clpetersonucf clpetersonucf mentioned this pull request Oct 28, 2024
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