From fefa7613f4f155869531ef4edf1e789649f5bb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javis=20V=2E=20P=C3=A9rez?= Date: Tue, 3 Dec 2024 12:52:38 -0400 Subject: [PATCH] Address PR reviews --- .github/workflows/build-devmode.yaml | 13 +++++++------ frontend/dev-mode/src/components/ChatPrompt.vue | 12 ++++++++---- .../dev-mode/src/components/InputCodeSnippets.vue | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-devmode.yaml b/.github/workflows/build-devmode.yaml index 88464497..99f430e0 100644 --- a/.github/workflows/build-devmode.yaml +++ b/.github/workflows/build-devmode.yaml @@ -18,18 +18,19 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + ## install build dependencies for frontend generation - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: - node-version: 20 + node-version-file: './frontend/dev-mode/.nvmrc' - - uses: pnpm/action-setup@v2 - name: Install pnpm + - name: Install pnpm + uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 with: - package_json_file: frontend/dev-mode/package.json version: 8 + package_json_file: frontend/dev-mode/package.json run_install: false - name: Get pnpm store directory diff --git a/frontend/dev-mode/src/components/ChatPrompt.vue b/frontend/dev-mode/src/components/ChatPrompt.vue index 150627b3..3860caed 100644 --- a/frontend/dev-mode/src/components/ChatPrompt.vue +++ b/frontend/dev-mode/src/components/ChatPrompt.vue @@ -31,10 +31,14 @@ const stats = inject('stats', {} as Stats) const isGenerating = inject('isGenerating', false) const isPending = inject('isPending', false) const isChatStarted = inject('isChatStarted', false) -const runChat = inject('runChat', (message: string) => message) -const runCompletion = inject('runCompletion', () => {}) -const stop = inject('stop', (e: Event) => e) -const uploadImage = inject('uploadImage', () => {}) +const runChat = inject('runChat') +const runCompletion = inject('runCompletion') +const stop = inject('stop') +const uploadImage = inject('uploadImage') + +if (!runChat || !runCompletion || !stop || !uploadImage) { + throw new Error('required function not provided') +} const send = (customMessage: string = '') => { if (!message.value && !customMessage) { diff --git a/frontend/dev-mode/src/components/InputCodeSnippets.vue b/frontend/dev-mode/src/components/InputCodeSnippets.vue index 680e6f57..5165d523 100644 --- a/frontend/dev-mode/src/components/InputCodeSnippets.vue +++ b/frontend/dev-mode/src/components/InputCodeSnippets.vue @@ -111,7 +111,7 @@ data=$'{ "stream": true, ${ Object.entries(parameters.value).map(([key, value]) => { - return `"${key}"": ${value}` + return `"${key}": ${value}` }).join(',\n ') } }'