Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f370fe60
authored
2024-02-01 11:52:04 +0800
by
Jeff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
29286_token_usage
1 parent
30cf46e8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
client/public/index.html
client/src/App.js
client/src/ChatBox.js
package.json
client/public/index.html
View file @
f370fe6
...
...
@@ -51,6 +51,14 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<div
id=
"modal-container"
style=
"display: none"
>
<div
id=
"modal-content"
>
<div
id=
"modal-subtitle"
></div>
<h2
id=
"modal-title"
></h2>
<p
id=
"modal-desc"
></p>
<a
id=
"modal-cta"
href=
"#"
target=
"_parent"
></a>
</div>
</div>
</body>
<script>
window
.
onload
=
function
()
{
...
...
client/src/App.js
View file @
f370fe6
...
...
@@ -71,6 +71,14 @@ function App() {
TPLogicRun
();
}
// eslint-disable-next-line
btutil_getChatUsage
();
// eslint-disable-next-line
let
maxTokens
=
btutilCommon_getCookie
(
"max-tokens"
);
if
(
maxTokens
===
'1'
){
return
;
}
const
userInput
=
[
'what'
,
'why'
,
'when'
,
'where'
,
'which'
,
'did'
,
'do'
,
'how'
,
'can'
,
'are'
,
'who'
];
const
userInputRegex
=
new
RegExp
(
`\\b(
${
userInput
.
join
(
'|'
)}
)\\b`
,
'gi'
);
const
inputMatches
=
chatInput
.
match
(
userInputRegex
);
...
...
client/src/ChatBox.js
View file @
f370fe6
import
React
,
{
useState
}
from
"react"
;
import
React
from
"react"
;
import
SuggestedOptions
from
'./suggestedOptions'
import
ExportButton
from
"./ExportButton"
;
const
ChatBox
=
({
chatLog
,
setChatInput
,
handleSubmit
,
chatInput
,
startedInteraction
,
setStartedInteraction
})
=>
{
...
...
package.json
View file @
f370fe6
...
...
@@ -4,7 +4,8 @@
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"start"
:
"node index.js"
},
"author"
:
""
,
"license"
:
"ISC"
,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment