feat: redact file contents from chat and put latest files into system prompt (#904)
This commit is contained in:
@@ -118,7 +118,7 @@ export const ChatImpl = memo(
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const files = useStore(workbenchStore.files);
|
||||
const actionAlert = useStore(workbenchStore.alert);
|
||||
const { activeProviders, promptId } = useSettings();
|
||||
const { activeProviders, promptId, contextOptimizationEnabled } = useSettings();
|
||||
|
||||
const [model, setModel] = useState(() => {
|
||||
const savedModel = Cookies.get('selectedModel');
|
||||
@@ -141,6 +141,7 @@ export const ChatImpl = memo(
|
||||
apiKeys,
|
||||
files,
|
||||
promptId,
|
||||
contextOptimization: contextOptimizationEnabled,
|
||||
},
|
||||
sendExtraMessageFields: true,
|
||||
onError: (error) => {
|
||||
|
||||
@@ -14,6 +14,8 @@ export default function FeaturesTab() {
|
||||
enableLatestBranch,
|
||||
promptId,
|
||||
setPromptId,
|
||||
enableContextOptimization,
|
||||
contextOptimizationEnabled,
|
||||
} = useSettings();
|
||||
|
||||
const handleToggle = (enabled: boolean) => {
|
||||
@@ -39,6 +41,19 @@ export default function FeaturesTab() {
|
||||
</div>
|
||||
<Switch className="ml-auto" checked={isLatestBranch} onCheckedChange={enableLatestBranch} />
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<span className="text-bolt-elements-textPrimary">Use Context Optimization</span>
|
||||
<p className="text-sm text-bolt-elements-textSecondary">
|
||||
redact file contents form chat and puts the latest file contents on the system prompt
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
className="ml-auto"
|
||||
checked={contextOptimizationEnabled}
|
||||
onCheckedChange={enableContextOptimization}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user