aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/apis/gpt/GPT.ts4
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx18
2 files changed, 5 insertions, 17 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts
index 6806802f3..281cec94c 100644
--- a/src/client/apis/gpt/GPT.ts
+++ b/src/client/apis/gpt/GPT.ts
@@ -26,10 +26,10 @@ const openai = new OpenAIApi(configuration);
const gptTrailSlideCustomization = async (inputText: string) => {
let prompt =
- 'We are adding customization to a slide in a presentation. Given a natural language input, translate it into a json with the required fields: [title, presentation_transition, presentation_movement, presentation_effect, config_zoom, presentation_effectDirection].';
+ 'We are adding customization to a slide in a presentation. Given a natural language input, translate it into a json with the required fields: [title, presentation_transition, presentation_effect, config_zoom, presentation_effectDirection].';
prompt +=
- 'title is the title/name of the slide. presentation_transition is a number in milliseconds for how long it should take to transition to a slide. presentation_movement is how the slide is moved onscreen. Its only possible values are: [none, center, zoom, pan, jump]. If the input contains zoom, make sure to set presentation_movement to zoom. presentation_effect is an effect applied to the slide when we transition to it. Its only possible values are: [None, Fade in, Flip, Rotate, Bounce, Roll]. presentation_effectDirection is what direction the slide comes in from. Its only possible values are: [Enter from left, Enter from right, Enter from bottom, Enter from Top, Enter from center]. config_zoom is a number from 0 to 1.0 indicating the percentage we should be zooming into the slide.';
+ 'title is the title/name of the slide. presentation_transition is a number in milliseconds for how long it should take to transition/move to a slide. presentation_effect is an effect applied to the slide when we transition to it. Its only possible values are: [None, Fade in, Flip, Rotate, Bounce, Roll]. presentation_effectDirection is what direction the effect is applied. Its only possible values are: [Enter from left, Enter from right, Enter from bottom, Enter from Top, Enter from center]. config_zoom is a number from 0 to 1.0 indicating the percentage we should zoom into the slide.';
prompt += 'If the input does not contain info a specific key, please set their value to null. Please only return the json with these keys and their values.';
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 0d5edcd83..a88dd6035 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -322,6 +322,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
customizeWithGPT = async (input: string) => {
// const testInput = 'change title to Customized Slide, transition for 2.3s with fade in effect';
if (!this.slideToModify) return;
+ this.setIsRecording(false);
this.setIsLoading(true);
try {
const res = await gptTrailSlideCustomization(input);
@@ -858,6 +859,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
*/
navigateToActiveItem = (afterNav?: () => void) => {
const activeItem: Doc = this.activeItem;
+ // GPT update
+ this.slideToModify = activeItem;
const targetDoc: Doc = this.targetDoc;
const finished = () => {
afterNav?.();
@@ -2789,15 +2792,6 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
/>
)}
</div>
- {/* <div
- contentEditable={true}
- onInput={e => {
- const newContent = e.currentTarget.innerHTML;
- console.log('content', newContent);
- this.setChatInput(newContent);
- }}>
- {this.chatInput}
- </div> */}
<TextareaAutosize
ref={r => (this._inputref = r)}
minRows={3}
@@ -2808,13 +2802,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
onChange={e => {
this.setChatInput(e.target.value);
}}
- // onSelect={e => {
- // this.stopDictation(true);
- // }}
onKeyDown={e => {
- // if (e.key === 'Enter') {
- // this.customizeWithGPT(this.chatInput);
- // }
this.stopDictation(true);
e.stopPropagation();
}}