You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/root-cms/shared/ai/prompts.ts
+4-32Lines changed: 4 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,12 @@ export type ChatPrompt = Part | Part[];
9
9
* - chat: Used in the "Chat with Root AI" sidebar tool.
10
10
* - edit: Used in the "Edit with AI" modal dialog for editing JSON files.
11
11
*/
12
-
exporttypeChatMode='chat'|'edit';
12
+
exporttypeChatMode='chat'|'edit'|'altText';
13
13
14
-
/** The parsed response from the AI */
15
-
exportinterfaceParsedChatResponse{
16
-
/** The textual response from the AI. For chat requests, this is the full response. For other types of requests, this contains just the AI's "message" response, whereas any other data will be included in the `data` property. */
Copy file name to clipboardExpand all lines: packages/root-cms/shared/ai/prompts/edit.txt
+2-8Lines changed: 2 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Input Requirements & Handling:
10
10
11
11
- The input you receive will be broken into three parts. (1) `root-cms-d.ts` (the TypeScript interface), (2) the existing JSON file you are editing (or an empty JSON file when generating new content), and (3) the user input (screenshots, chat messages, instructions, etc.). You must ensure that the resulting JSON file is compatible with the structure defined by the TypeScript interface and contains all of the marketing content provided by the user input.
12
12
13
-
- When you provide your response, if the user instructs you to only edit one part of the original JSON, make sure to leave the rest of the JSON file untouched. Your response, however, should always contain the _entire_ JSON file combining the original contents with your new edits (think of it like you're applying a PATCH operation and the response is the entire file).
13
+
- When you provide your response, if the user instructs you to only edit one part of the original JSON, make sure to leave the rest of the JSON file untouched. You must return the entire JSON document after applying changes. Never omit, rename, reorder or invent top-level keys. Copy all unmodified fields exactly as they appear in the input.
14
14
15
15
Root CMS JSON File Structure:
16
16
@@ -111,16 +111,10 @@ When adding new items to arrays that use `oneOf` fields, try your best to figure
111
111
112
112
Additionally, when adding new items to existing JSON data, you must carefully check the structure of those items as defined by `root-cms.d.ts`. Avoid inventing new fields for content types, use only those defined by the `root-cms.d.ts`. For example, if you are adding a button to a module, carefully check the button structure defined in `root-cms.d.ts` and only populate fields that are defined there.
113
113
114
-
5. Here is the `root-cms.d.ts` file for this project:
115
-
116
-
```
117
-
{{ROOT_CMS_DEFS}}
118
-
```
119
-
120
114
Finally, when you provide your response, it MUST be structured in the following way for handling by the chat client.
121
115
122
116
{
123
-
"data": <The JSON generated by you via the instructions above>,
117
+
"data": <The JSON data generated by you via the instructions above>,
124
118
"message": <A brief message that describes what you did.>
0 commit comments