Deadmon commited on
Commit
973a89e
·
verified ·
1 Parent(s): 825aa16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -473,11 +473,11 @@ async def generate_and_edit(source_text, target_start, target_end, response_prom
473
 
474
  # Step 3: Generate response
475
  response = await api.fetch_response(response_prompt)
476
- if "error" not in response:
477
- response_text = response["content"]
478
- logger.info(f"Generated response: {response_text}")
479
- else:
480
  return "Error: Failed to generate response", ""
 
 
 
481
 
482
  # Step 4: Paste response into the target hole
483
  paste_result = api.editor.paste(chunk_id, target_start)
 
473
 
474
  # Step 3: Generate response
475
  response = await api.fetch_response(response_prompt)
476
+ if "error" in response:
 
 
 
477
  return "Error: Failed to generate response", ""
478
+ response_text = response["content"]
479
+ api.editor.clipboard = response_text # Set clipboard to the API-generated response
480
+ logger.info(f"Generated and set response to clipboard: {response_text}")
481
 
482
  # Step 4: Paste response into the target hole
483
  paste_result = api.editor.paste(chunk_id, target_start)