f370fe60 by Jeff

29286_token_usage

1 parent 30cf46e8
...@@ -51,6 +51,14 @@ ...@@ -51,6 +51,14 @@
51 To begin the development, run `npm start` or `yarn start`. 51 To begin the development, run `npm start` or `yarn start`.
52 To create a production bundle, use `npm run build` or `yarn build`. 52 To create a production bundle, use `npm run build` or `yarn build`.
53 --> 53 -->
54 <div id="modal-container" style="display: none">
55 <div id="modal-content">
56 <div id="modal-subtitle"></div>
57 <h2 id="modal-title"></h2>
58 <p id="modal-desc"></p>
59 <a id="modal-cta" href="#" target="_parent"></a>
60 </div>
61 </div>
54 </body> 62 </body>
55 <script> 63 <script>
56 window.onload = function() { 64 window.onload = function() {
......
...@@ -71,6 +71,14 @@ function App() { ...@@ -71,6 +71,14 @@ function App() {
71 TPLogicRun(); 71 TPLogicRun();
72 } 72 }
73 73
74 // eslint-disable-next-line
75 btutil_getChatUsage();
76 // eslint-disable-next-line
77 let maxTokens = btutilCommon_getCookie("max-tokens");
78 if (maxTokens==='1'){
79 return;
80 }
81
74 const userInput = ['what', 'why', 'when', 'where' , 'which', 'did', 'do', 'how', 'can', 'are', 'who']; 82 const userInput = ['what', 'why', 'when', 'where' , 'which', 'did', 'do', 'how', 'can', 'are', 'who'];
75 const userInputRegex = new RegExp(`\\b(${userInput.join('|')})\\b`, 'gi'); 83 const userInputRegex = new RegExp(`\\b(${userInput.join('|')})\\b`, 'gi');
76 const inputMatches = chatInput.match(userInputRegex); 84 const inputMatches = chatInput.match(userInputRegex);
......
1 import React, { useState } from "react"; 1 import React from "react";
2 import SuggestedOptions from './suggestedOptions' 2 import SuggestedOptions from './suggestedOptions'
3 import ExportButton from "./ExportButton"; 3 import ExportButton from "./ExportButton";
4 const ChatBox = ({chatLog, setChatInput, handleSubmit, chatInput, startedInteraction, setStartedInteraction}) => { 4 const ChatBox = ({chatLog, setChatInput, handleSubmit, chatInput, startedInteraction, setStartedInteraction}) => {
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
4 "description": "", 4 "description": "",
5 "main": "index.js", 5 "main": "index.js",
6 "scripts": { 6 "scripts": {
7 "test": "echo \"Error: no test specified\" && exit 1" 7 "test": "echo \"Error: no test specified\" && exit 1",
8 "start": "node index.js"
8 }, 9 },
9 "author": "", 10 "author": "",
10 "license": "ISC", 11 "license": "ISC",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!