[INCUBATOR-37] magnolia-openai-automations: Request to "Generate SEO Metadata" Returns 401 Created: 07/Jul/23 Updated: 18/Jul/23 Resolved: 18/Jul/23 |
|
| Status: | Closed |
| Project: | Incubator |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Brian Schweigler | Assignee: | Sebastian Geschke |
| Resolution: | Resolved | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Magnolia 6.2.35 (Java 11) |
||
| Attachments: |
|
| Template: | |
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[X]*
Steps to reproduce, expected, and actual results filled
[X]*
Affected version filled
|
| Date of First Response: | |
| Work Started: |
| Description |
Steps to reproduce
Expected resultsUpon clicking the button, the request should fill in the specified fields. Actual results401 Response and no content returned (or call outgoing)
Is there a step that we missed in the setup of this incubator module? We assumed that since have the dependency in the pom (following the documentation), a valid api key and the field in the dialog, that it should work.
Thanks for your help in this manner!
|
| Comments |
| Comment by Sebastian Geschke [ 17/Jul/23 ] |
|
Hi bschweigler could you please update to the latest version 1.0.2 of magnolia-openai-automations. The base config.yaml was missing in prior versions so the decoration was not used. Also note that the key must reside on the config node and not on the node of the module in config workspace (in case the configuration was done in JCR) - The correct path in this case would be `/modules/openai-automations/config@apiKey`. |
| Comment by Brian Schweigler [ 17/Jul/23 ] |
|
Hey @sgeschke, thanks for your response. The api key is now set correctly as you specified, we are also using the latest version 1.0.2.
I have a dialog as follows for page properties: form: implementationClass: info.magnolia.ui.javascript.form.FormViewWithChangeListener properties: title: $type: textField i18n: true navigationTitle: $type: textField i18n: true windowTitle: $type: textField i18n: true keywords: $type: textField i18n: true rows: 3 aiSeoMetadata: $type: aiSeoMetadataGenerator label: AI SEO Metadata parameters: titleField: title metaDescriptionField: description ogDescriptionField: ogDescription metaKeywordsField: keywords description: $type: textField i18n: true rows: 5 layout: $type: tabbedLayout tabs: tabMain: fields: - name: title - name: navigationTitle - name: windowTitle tabMeta: fields: - name: keywords - name: description - name: aiSeoMetadata I then tried to generate something for the titleField, but it seems to always transmit `undefined`. Here's a video to better show what I mean:
Is there another step we are missing?
Thanks for your help so far und e schöne Tag!
|
| Comment by Sebastian Geschke [ 18/Jul/23 ] |
|
Good Morning bschweigler Your configuration should look like that: aiSeoMetadata: $type: aiSeoMetadataGenerator label: AI SEO Metadata parameters: titleField: title metaDescriptionField: description metaKeywordsField: keywords metaDataFields: title: Title metaDescription: Description metaKeywords: Meta keywords You could also try and test the OpenAI rest client in the rest client app.
|
| Comment by Brian Schweigler [ 18/Jul/23 ] |
|
Had another look at the logs and can see that the tokens did arrive at OpenAi (they charged for it), so it is safe to assume that the API key and module itself is set up correctly.
Since it returned undefined though, there must be a problem in how I passed the data for the `titleField` or the dialog configuration itself.
Edit: Saw that your response came at the same time I was writing mine, will have a look! |
| Comment by Brian Schweigler [ 18/Jul/23 ] |
|
Okay, can confirm that it works now. Likely because the updated settings were missed.
Thanks for your time Sebastian and have a lovely day. |
| Comment by Sebastian Geschke [ 18/Jul/23 ] |
|
Resolution:
|