-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add together.xyz, promote Phind to default, minor dark mode tweaks #69
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d615c18
add together.xyz
swyxio 4c1e3d4
Update providers/together.js
swyxio c8fe8c1
Merge branch 'main' into addTogether
swyxio d3b5562
Apply prettier changes
swyxio 57825a1
add together
swyxio 0897ac2
add together, promote phind
swyxio 5d106c2
Merge branch 'main' into addTogether
swyxio 0b1ddbd
Apply prettier changes
swyxio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ class Claude extends Provider { | |
margin: 0 !important; | ||
} | ||
`); | ||
}, 1000); | ||
}, 100); | ||
}); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
const Store = require('electron-store'); | ||
const store = new Store(); | ||
|
||
const Provider = require('./provider'); | ||
|
||
class Together extends Provider { | ||
static webviewId = 'webviewTOGETHER'; | ||
static fullName = 'Together (RedPajama, StarCoder, Falcon, etc)'; | ||
|
||
static url = 'https://api.together.xyz/playground/chat'; | ||
|
||
static handleInput(input) { | ||
this.getWebview().executeJavaScript(` | ||
var inputElement = document.querySelector('form textarea[placeholder*="Enter text here"]'); | ||
var nativeTextAreaValueSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, "value").set; | ||
nativeTextAreaValueSetter.call(inputElement, "${input}"); | ||
var event = new Event('input', { bubbles: true}); | ||
inputElement.dispatchEvent(event); | ||
`); | ||
} | ||
|
||
// inputElement.focus(); | ||
// inputElement.value = "${input}"; | ||
// // try to send keyboard event to trigger the re-enable of the disabled button | ||
// // thanks chatgpt! | ||
// var event = new Event('input', { bubbles: true }); | ||
// event.simulated = true; | ||
// var tracker = inputElement._valueTracker; | ||
// if (tracker) { | ||
// tracker.setValue("${input}"); | ||
// } | ||
// // Dispatch the event after a short delay to fix the button state | ||
// setTimeout(function() { | ||
// inputElement.dispatchEvent(event); | ||
// }, 100); | ||
|
||
static handleSubmit() { | ||
this.getWebview().executeJavaScript(` | ||
var btn = document.querySelector('form button:has(svg)'); // YES we are using the has selector!!!! | ||
btn.focus(); | ||
btn.disabled = false; | ||
btn.click()`); | ||
} | ||
|
||
static handleCss() { | ||
this.getWebview().addEventListener('dom-ready', () => { | ||
// hide message below text input, sidebar, suggestions on new chat | ||
setTimeout(() => { | ||
this.getWebview().insertCSS(` | ||
header, header + div { | ||
background-color: white; | ||
/* single line dark mode ftw */ | ||
filter: invert(100%) hue-rotate(180deg); | ||
} | ||
header { | ||
height: 10px; | ||
margin-top: -5px; | ||
padding-top: 0px; | ||
padding-bottom: 0px; | ||
} | ||
/* the "chat" header is pretty big */ | ||
.mui-style-qe6v0i { | ||
padding-top: 0px; | ||
} | ||
div + h1, h1, h1 + div { | ||
display: none; | ||
} | ||
`); | ||
}, 100); | ||
}); | ||
} | ||
|
||
static isEnabled() { | ||
return store.get(`${this.webviewId}Enabled`, false); | ||
} | ||
} | ||
|
||
module.exports = Together; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial implementation was broken without this