egonSchiele / chisel

Open source writing app
https://chiseleditor.com
Other
38 stars 3 forks source link

Sweep: if users have entered a customKey, show the mic icon in the nav, and in the uploadAudio call, send the user's customKey as a parameter. Then use that key in the call to opener's whisper API #67

Open egonSchiele opened 1 year ago

sweep-ai[bot] commented 1 year ago

Here's the PR! https://github.com/egonSchiele/chisel/pull/68.

⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 3 GPT-4 tickets left. For more GPT-4 tickets, visit our payment portal.To get Sweep to recreate this ticket, leave a comment prefixed with "sweep:" or edit the issue.


Step 1: 🔍 Code Search

Working on it...


Step 2: 🧐 Snippet Analysis

From looking through the relevant snippets, I decided to make the following modifications:

File Path Proposed Changes
src/BookEditor.tsx In this file, add a condition to check if the user has a customKey in their settings. If they do, render the mic icon in the navigation bar. This can be done in the render method of the component where the navigation bar is defined.
server.js In this file, modify the uploadAudio API to accept a customKey parameter from the request body. Then, use this customKey in the call to OpenAI's Whisper API. This can be done in the function that handles the uploadAudio API endpoint.

Step 3: 📝 Planning

I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:

Add support for customKey in navigation bar and uploadAudio API sweep/feature/customKey-support

Description

This PR adds support for the customKey feature in the Chisel app. It includes changes in both the frontend and backend to display the mic icon in the navigation bar if the user has entered a customKey. Additionally, the uploadAudio API has been modified to accept the user's customKey as a parameter and use it in the call to OpenAI's Whisper API for audio transcription.

Summary of Changes

Frontend Changes

  • Modified src/BookEditor.tsx to conditionally render the mic icon in the navigation bar if the user has a customKey in their settings.

Backend Changes

  • Modified server.js to accept the customKey as a parameter in the uploadAudio API endpoint.
  • Updated the call to OpenAI's Whisper API in the uploadAudio endpoint to include the user's customKey.

These changes ensure that the user's customKey is used for audio transcription and that the mic icon is displayed in the navigation bar when a customKey is present.


Step 4: ⌨️ Coding

I have finished coding the issue. I am now reviewing it for completeness.


Step 5: 🔁 Code Review

Success! 🚀


To recreate the pull request, leave a comment prefixed with "sweep:" or edit the issue. Join Our Discord

egonSchiele commented 1 year ago

Guess I should've mentioned the mic is in Nav.tsx