-
Notifications
You must be signed in to change notification settings - Fork 13
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
Added the advanced section, for selecting the tab completion #144
Closed
SachinS10-lab
wants to merge
8
commits into
redhat-developer:main
from
SachinS10-lab:advanced-section-forChatModel
Closed
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d701c10
Added the advanced section, for selecting the tab completion
SachinS10-lab 0dec0cc
The tab completion combobox is added in the advanced section
SachinS10-lab 004706e
Added tooltip to the modelList for chat and tab completion.
SachinS10-lab 1907dff
build failed for previous commit fixes
SachinS10-lab df12fa9
Replace unmaintained, vulnerable npm-run-all with concurrently
fbricon bbbee99
moved advanced section to bottom and text overlaped issue fixes
SachinS10-lab b9356ae
fixing build error issue
SachinS10-lab 7a2f085
initial value of tabModelId in App.test.tsx is null and changed to de…
SachinS10-lab 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ function App() { | |
const [installationModes, setInstallationModes] = useState<{ id: string, label: string, supportsRefresh: true }[]>([]); | ||
|
||
const [enabled, setEnabled] = useState<boolean>(true); | ||
const [uiMode, setUiMode] = useState<'simple' | 'advanced'>('simple'); | ||
|
||
const [isKeepExistingConfigSelected, setIsKeepExistingConfigSelected] = useState(false); | ||
|
||
|
@@ -75,11 +76,12 @@ function App() { | |
} | ||
|
||
function handleSetupGraniteClick() { | ||
console.log("UiMode:",uiMode, "Test" , uiMode === "advanced" ? chatModel : null); | ||
vscode.postMessage({ | ||
command: "setupGranite", | ||
data: { | ||
tabModelId: tabModel, | ||
chatModelId: chatModel, | ||
tabModelId: uiMode === "advanced" ? chatModel : null, | ||
embeddingsModelId: embeddingsModel | ||
} | ||
}); | ||
|
@@ -235,30 +237,62 @@ function App() { | |
</div> | ||
</div> | ||
|
||
<ModelList | ||
className="model-list" | ||
label="Granite model" | ||
value={chatModel} | ||
onChange={(e) => setChatModel(e?.value ?? null)} | ||
status={getModelStatus(chatModel)} | ||
options={modelOptions} | ||
progress={chatModel ? modelPullProgress[chatModel] : undefined} | ||
disabled={!enabled} | ||
tooltip="This model will be used for Chat and Tab Completion" | ||
/> | ||
<div className="switch-toggle-wrapper"> | ||
<label>Model Settings:</label> | ||
<div className="switch-toggle"> | ||
<input | ||
className="switch-toggle-checkbox" | ||
type="checkbox" | ||
id="uiModeSwitch" | ||
checked={uiMode === 'advanced'} | ||
onChange={() => setUiMode(uiMode === 'simple' ? 'advanced' : 'simple')} | ||
/> | ||
<label className="switch-toggle-label" htmlFor="uiModeSwitch"> | ||
<span>Simple</span> | ||
<span>Advanced</span> | ||
</label> | ||
</div> | ||
</div> | ||
|
||
{/* | ||
<ModelList | ||
className="model-list" | ||
label="Tab completion model" | ||
value={tabModel} | ||
onChange={(e) => setTabModel(e?.value ?? null)} | ||
status={getModelStatus(tabModel)} | ||
options={tabOptions} | ||
progress={tabModel ? modelPullProgress[tabModel] : undefined} | ||
disabled={!enabled} | ||
/> | ||
*/} | ||
{uiMode === 'simple' ? ( | ||
<ModelList | ||
className="model-list" | ||
label="Granite model" | ||
value={chatModel} | ||
onChange={(e) => setChatModel(e?.value ?? null)} | ||
status={getModelStatus(chatModel)} | ||
options={modelOptions} | ||
progress={chatModel ? modelPullProgress[chatModel] : undefined} | ||
disabled={!enabled} | ||
tooltip="This model will be used for Chat and Tab Completion" | ||
/> | ||
|
||
) : ( | ||
<> | ||
<ModelList | ||
className="model-list" | ||
label="Chat model" | ||
value={chatModel} | ||
onChange={(e) => setChatModel(e?.value ?? null)} | ||
status={getModelStatus(chatModel)} | ||
options={modelOptions} | ||
progress={chatModel ? modelPullProgress[chatModel] : undefined} | ||
disabled={!enabled} | ||
tooltip="This model will be used for Chat and Tab Completion" | ||
/> | ||
|
||
<ModelList | ||
className="model-list" | ||
label="Tab completion model" | ||
value={tabModel} | ||
onChange={(e) => setTabModel(e?.value ?? null)} | ||
status={getModelStatus(tabModel)} | ||
options={tabOptions} | ||
progress={tabModel ? modelPullProgress[tabModel] : undefined} | ||
disabled={!enabled} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tooltip="This model will be used for Tab Completion" |
||
/> | ||
</> | ||
)} | ||
|
||
<ModelList | ||
className="model-list" | ||
|
@@ -280,12 +314,14 @@ function App() { | |
|
||
<div className="info-message"> | ||
<p> | ||
To reopen this wizard, open the command palette and run: | ||
<p style={{ margin: 2, paddingLeft: 10 }}><strong>Paver: Setup Granite as code assistant</strong></p>. | ||
** To reopen this wizard, open the command palette and run:<strong>Paver: Setup Granite as code assistant</strong>. | ||
</p> | ||
<p> | ||
** To configure both Chat and Tab Completion, choose <strong><i>Advanced</i></strong>. Otherwise, only configure Chat Model | ||
</p> | ||
</div> | ||
</main> | ||
); | ||
} | ||
|
||
export default App; | ||
export default App; |
Oops, something went wrong.
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.
This model will be used for Chat