-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Description
To add a layer of intelligence to the app, we want to provide an AI-generated summary of each transcribed note. This issue involves creating a new service to communicate with the OpenAI API and integrating it into the note-creation flow.
Task
- Create a new file,
lib/openai.ts. - Inside this file, create a function
summarizeText(text: string)that sends the transcribed text to the OpenAI API (GPT-3.5 or GPT-4). The prompt should instruct the model to create a concise title and a one-paragraph summary. - Modify the
handleTranscriptionflow inadd.tsx. After receiving the transcript from AssemblyAI, it should be passed to the newsummarizeTextfunction. - The final saved note object in
AsyncStorageshould now includetitleandsummaryfields returned by the OpenAI API.
Acceptance Criteria
- The
summarizeTextfunction correctly calls the OpenAI API and handles the response. - The user's
OPENAI_API_KEYmust be loaded securely from the.envfile. - The final saved note object contains
titleandsummaryproperties generated by AI. - The function should have robust error handling in case the OpenAI API call fails.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers