Skip to content

Commit

Permalink
Merge pull request #324 from uiuc-ischool-accessible-computing-lab/no…
Browse files Browse the repository at this point in the history
…-slash-to-trigger-llm

No slash to trigger llm, fix for #323
  • Loading branch information
ellvix authored Dec 30, 2023
2 parents 12fd9f7 + f937d18 commit dfd585d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- LLM popup now only triggered by ?, not /

### Changed

### Chores
Expand All @@ -22,7 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Commented out the instructions on GitHub templates so that users can keep it while adding new content (#308).
- Added lineplot, stacked bar, dodged bar, and normalized dodge bar info to the README (#310).


## [1.0.4] - 2023-11-30

### Added
Expand Down
9 changes: 5 additions & 4 deletions src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Constants {

// LLM settings
hasChatLLM = true;
LLMDebugMode = false; // true = use fake data, false = use real data
LLMDebugMode = true; // true = use fake data, false = use real data
authKey = null; // OpenAI authentication key, set in menu
LLMmaxResponseTokens = 200; // max tokens to send to LLM, 20 for testing, 200 ish for real
LLMDetail = 'high'; // low (default for testing, like 100 tokens) / high (default for real, like 1000 tokens)
Expand Down Expand Up @@ -717,7 +717,7 @@ class ChatLLM {
document,
'keyup',
function (e) {
if (e.key == '?' || e.key == '/') {
if (e.key == '?') {
chatLLM.Toggle(true);
}
},
Expand Down Expand Up @@ -793,6 +793,7 @@ class ChatLLM {
* @returns {void}
*/
ProcessLLMResponse(data) {
console.log('LLM response: ' + data);
let text = data.choices[0].message.content;
chatLLM.DisplayChatMessage('LLM', text);
}
Expand Down Expand Up @@ -867,8 +868,8 @@ class ChatLLM {
if (!this.requestJson) {
this.requestJson = {};
this.requestJson.model = 'gpt-4-vision-preview';
this.max_tokens = constants.LLMmaxResponseTokens;
this.detail = constants.LLMDetail;
//this.requestJson.max_tokens = constants.LLMmaxResponseTokens;
//this.requestJson.detail = constants.LLMDetail;
this.requestJson.messages = [];
this.requestJson.messages[0] = {};
this.requestJson.messages[0].role = 'system';
Expand Down

0 comments on commit dfd585d

Please sign in to comment.