message.html 1.4 KB
Newer Older
chenyuanjie committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>ChatGPT</title>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha2/css/bootstrap.min.css">
  <link rel="stylesheet" href="static/style.css">
</head>

<body>
  <header>
    <h1>ChatGPT API测试</h1>
  </header>
  <main>

  <div class="content">
    <form method="post" onsubmit="submit.disabled=true">
      <br>
      <center><textarea name="question" placeholder="请输入你的问题" rows="4"></textarea></center>
      <br>
      <input type="submit" value="提交问题" id="submit">
    </form>
    <div id="loading"><b>Waiting for response...</b></div>
  </div>
  

  <div class="dia">                
    {% if question %}
      <div class="result">
        <div class="question"><b>用户:</b>
          <pre>{{ question }}</pre>
        </div>
        <hr>
        <div class="response"><b>ChatGPT:</b>
          <pre>{{ res }}</pre>
        </div>
      </div>
    {% endif %}
  </div>

  </main>
  <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha2/js/bootstrap.min.js"></script>
  <script src="static/script.js"></script>
</body>

</html>