datasaur-dev commited on
Commit
a6fdb22
·
verified ·
1 Parent(s): 749c207

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -2,10 +2,12 @@ import gradio as gr
2
  import requests
3
  import json
4
 
 
 
5
  # WARNING: It is not recommended to hardcode sensitive data like API tokens in code.
6
  # Consider using environment variables or other secure methods for production applications.
7
  API_URL = "https://deployment.datasaur.ai/api/deployment/8/2717/chat/completions"
8
- API_TOKEN = "ds-bb8f69148d3e4ae3aed327af3da5eb4a"
9
 
10
  def magic_function(input_text):
11
  """
@@ -38,8 +40,11 @@ def magic_function(input_text):
38
 
39
 
40
  with gr.Blocks() as demo:
41
- text_area = gr.Textbox(label="Your Text", lines=20)
42
- magic_button = gr.Button("Magic Button")
 
 
 
43
 
44
  magic_button.click(
45
  fn=magic_function,
 
2
  import requests
3
  import json
4
 
5
+ import os
6
+
7
  # WARNING: It is not recommended to hardcode sensitive data like API tokens in code.
8
  # Consider using environment variables or other secure methods for production applications.
9
  API_URL = "https://deployment.datasaur.ai/api/deployment/8/2717/chat/completions"
10
+ API_TOKEN = os.environ["DATASAUR_API_KEY"]
11
 
12
  def magic_function(input_text):
13
  """
 
40
 
41
 
42
  with gr.Blocks() as demo:
43
+ gr.Markdown("# Memo Improvement Workflow")
44
+ with gr.Row():
45
+ text_area = gr.Textbox(label="Your Text", lines=20, scale=4)
46
+ with gr.Column(scale=1):
47
+ magic_button = gr.Button("Magic Button")
48
 
49
  magic_button.click(
50
  fn=magic_function,