mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
misc improvements
This commit is contained in:
parent
b6e3a57dc6
commit
1c9e684350
6 changed files with 34 additions and 44 deletions
|
|
@ -726,7 +726,6 @@ class ChatThreadService extends Disposable implements IChatThreadService {
|
|||
const llmRes = await messageIsDonePromise // wait for message to complete
|
||||
if (this.streamState[threadId]?.isRunning !== 'LLM') {
|
||||
console.log('Unexpected chat agent state when', this.streamState[threadId]?.isRunning)
|
||||
this._setStreamState(threadId, undefined)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -325,13 +325,13 @@ export const ApplyButtonsHTML = ({ codeStr, applyBoxId, uri }: { codeStr: string
|
|||
|
||||
export const BlockCodeApplyWrapper = ({
|
||||
children,
|
||||
initValue,
|
||||
codeStr,
|
||||
applyBoxId,
|
||||
language,
|
||||
canApply,
|
||||
uri,
|
||||
}: {
|
||||
initValue: string;
|
||||
codeStr: string;
|
||||
children: React.ReactNode;
|
||||
applyBoxId: string;
|
||||
canApply: boolean;
|
||||
|
|
@ -364,8 +364,8 @@ export const BlockCodeApplyWrapper = ({
|
|||
</div>
|
||||
<div className={`${canApply ? '' : 'hidden'} flex items-center gap-1`}>
|
||||
<JumpToFileButton uri={uri} />
|
||||
{currStreamState === 'idle-no-changes' && <CopyButton codeStr={initValue} toolTipName='Copy' />}
|
||||
<ApplyButtonsHTML uri={uri} applyBoxId={applyBoxId} codeStr={initValue} />
|
||||
{currStreamState === 'idle-no-changes' && <CopyButton codeStr={codeStr} toolTipName='Copy' />}
|
||||
<ApplyButtonsHTML uri={uri} applyBoxId={applyBoxId} codeStr={codeStr} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -319,12 +319,12 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, ..
|
|||
return <BlockCodeApplyWrapper
|
||||
canApply={isCodeblockClosed}
|
||||
applyBoxId={applyBoxId}
|
||||
initValue={contents}
|
||||
codeStr={contents}
|
||||
language={language}
|
||||
uri={uri || 'current'}
|
||||
>
|
||||
<BlockCode
|
||||
initValue={contents}
|
||||
initValue={contents.trimEnd()} // \n\n adds a permanent newline which creates a flash
|
||||
language={language}
|
||||
/>
|
||||
</BlockCodeApplyWrapper>
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ const ReasoningOptionSlider = ({ featureName }: { featureName: FeatureName }) =>
|
|||
return <div className='flex items-center gap-x-2'>
|
||||
<span className='text-void-fg-3 text-xs pointer-events-none inline-block w-10 pr-1'>Thinking</span>
|
||||
<VoidSwitch
|
||||
size='xs'
|
||||
size='xxs'
|
||||
value={isReasoningEnabled}
|
||||
onChange={(newVal) => {
|
||||
const isOff = canTurnOffReasoning && !newVal
|
||||
|
|
|
|||
|
|
@ -315,49 +315,32 @@ const SimpleModelSettingsDialog = ({
|
|||
{type === 'default' ? `${modelName} comes packaged with Void, so you shouldn't need to change these settings.`
|
||||
: isUnrecognizedModel
|
||||
? `Model not recognized by Void.`
|
||||
: `Void knows about this model ("${recognizedModelName}")!`}
|
||||
: `Void recognizes ${modelName} ("${recognizedModelName}").`}
|
||||
</div>
|
||||
|
||||
|
||||
{/* override toggle */}
|
||||
<div className="flex items-center gap-2 mb-4">
|
||||
<VoidSwitch size='sm' value={overrideEnabled} onChange={setOverrideEnabled} />
|
||||
<span className="text-void-fg-2">Override Model Defaults</span>
|
||||
<VoidSwitch size='xs' value={overrideEnabled} onChange={setOverrideEnabled} />
|
||||
<span className="text-void-fg-3 text-sm">Override model defaults</span>
|
||||
</div>
|
||||
|
||||
{/* Informational link */}
|
||||
{overrideEnabled && <div className="text-sm text-void-fg-3 mb-4">
|
||||
<ChatMarkdownRender string={"See the [sourcecode](https://github.com/voideditor/void/blob/cf0728f4c605bff49c34c923e15ae649f053d3e7/src/vs/workbench/contrib/void/common/modelCapabilities.ts#L142C1-L171C4) for a reference on how to set this JSON (advanced)."} chatMessageLocation={undefined} />
|
||||
</div>}
|
||||
|
||||
|
||||
{overrideEnabled ? (
|
||||
<VoidInputBox2
|
||||
multiline
|
||||
className="w-full min-h-[200px] p-2 rounded-sm border border-void-border-2"
|
||||
initValue={jsonText}
|
||||
placeholder={placeholder}
|
||||
onChangeText={setJsonText}
|
||||
/>
|
||||
) : (
|
||||
<textarea
|
||||
readOnly
|
||||
className="w-full min-h-[200px] p-2 rounded-sm border border-void-border-2 bg-void-bg-2 text-void-fg-3 resize-none font-mono text-sm"
|
||||
value={placeholder}
|
||||
style={readOnlyHeight ? { height: readOnlyHeight } : undefined}
|
||||
onLoad={(e) => {
|
||||
// autosize height once
|
||||
if (!readOnlyHeight) {
|
||||
const h = (e.target as HTMLTextAreaElement).scrollHeight;
|
||||
setReadOnlyHeight(h);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<textarea
|
||||
className={`w-full min-h-[200px] p-2 rounded-sm border border-void-border-2 bg-void-bg-2 resize-none font-mono text-sm ${!overrideEnabled ? 'text-void-fg-3' : ''}`}
|
||||
value={overrideEnabled ? jsonText : placeholder}
|
||||
placeholder={placeholder}
|
||||
onChange={overrideEnabled ? (e) => setJsonText(e.target.value) : undefined}
|
||||
readOnly={!overrideEnabled}
|
||||
/>
|
||||
{errorMsg && (
|
||||
<div className="text-red-500 mt-2 text-sm">{errorMsg}</div>
|
||||
)}
|
||||
|
||||
{/* Informational link */}
|
||||
<div className="text-sm text-void-fg-3 mt-4">
|
||||
<ChatMarkdownRender string={"For more information on what you can customize, see [this page](https://github.com/voideditor/void/blob/cf0728f4c605bff49c34c923e15ae649f053d3e7/src/vs/workbench/contrib/void/common/modelCapabilities.ts#L142C1-L171C4)."} chatMessageLocation={undefined} />
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end gap-2 mt-4">
|
||||
<VoidButtonBgDarken onClick={onClose} className="px-3 py-1">
|
||||
|
|
|
|||
|
|
@ -487,7 +487,9 @@ const anthropicSettings: VoidStaticProviderInfo = {
|
|||
providerReasoningIOSettings: {
|
||||
input: {
|
||||
includeInPayload: (reasoningInfo) => {
|
||||
if (reasoningInfo?.type === 'budget_slider_value') {
|
||||
if (!reasoningInfo?.isReasoningEnabled) return null
|
||||
|
||||
if (reasoningInfo.type === 'budget_slider_value') {
|
||||
return { thinking: { type: 'enabled', budget_tokens: reasoningInfo.reasoningBudget } }
|
||||
}
|
||||
return null
|
||||
|
|
@ -626,7 +628,9 @@ const openAISettings: VoidStaticProviderInfo = {
|
|||
input: {
|
||||
// https://platform.openai.com/docs/guides/reasoning?api-mode=chat
|
||||
includeInPayload: (reasoningInfo) => {
|
||||
if (reasoningInfo?.type === 'effort_slider_value') {
|
||||
if (!reasoningInfo?.isReasoningEnabled) return null
|
||||
|
||||
if (reasoningInfo.type === 'effort_slider_value') {
|
||||
return { reasoning_effort: reasoningInfo.reasoningEffort }
|
||||
}
|
||||
return null
|
||||
|
|
@ -902,7 +906,9 @@ const groqSettings: VoidStaticProviderInfo = {
|
|||
providerReasoningIOSettings: {
|
||||
input: {
|
||||
includeInPayload: (reasoningInfo) => {
|
||||
if (reasoningInfo?.type === 'budget_slider_value') {
|
||||
if (!reasoningInfo?.isReasoningEnabled) return null
|
||||
|
||||
if (reasoningInfo.type === 'budget_slider_value') {
|
||||
return { reasoning_format: 'parsed' }
|
||||
}
|
||||
return null
|
||||
|
|
@ -1153,14 +1159,16 @@ const openRouterSettings: VoidStaticProviderInfo = {
|
|||
input: {
|
||||
// https://openrouter.ai/docs/use-cases/reasoning-tokens
|
||||
includeInPayload: (reasoningInfo) => {
|
||||
if (reasoningInfo?.type === 'budget_slider_value') {
|
||||
if (!reasoningInfo?.isReasoningEnabled) return null
|
||||
|
||||
if (reasoningInfo.type === 'budget_slider_value') {
|
||||
return {
|
||||
reasoning: {
|
||||
max_tokens: reasoningInfo.reasoningBudget
|
||||
}
|
||||
}
|
||||
}
|
||||
if (reasoningInfo?.type === 'effort_slider_value')
|
||||
if (reasoningInfo.type === 'effort_slider_value')
|
||||
return {
|
||||
reasoning: {
|
||||
effort: reasoningInfo.reasoningEffort
|
||||
|
|
|
|||
Loading…
Reference in a new issue