forked from Blendman974/faceclaw
Fix reasoning_details accumulation; filter assistant settings to settings relevant to the selected model
This commit is contained in:
1 parent
571c4c84df
commit
41ff1d2733
8 files changed
+170
-37
No files matched your search
@@ -1048,7 +1048,7 @@ export const veniceWebSearchSetting = new ConfigSettingBoolean({
|
||||
label: "Venice web search",
|
||||
storageKey: "assistant.veniceWebSearch",
|
||||
defaultValue: false,
|
||||
description: "Allow supported Venice models to search the web for current information. Shown only for the official Venice API URL. Search queries are processed by Venice's search service and may incur additional charges.",
|
||||
description: "Allow supported Venice models to search the web for current information. Shown only when OpenAI-compatible is the assistant model and its URL is the official Venice API. Search queries are processed by Venice's search service and may incur additional charges.",
|
||||
});
|
||||
|
||||
export const elevenLabsApiKeySetting = new ConfigSettingString({
|
||||
@@ -1155,12 +1155,12 @@ export const assistantModelSetting = new ConfigSettingEnum<AssistantModel>({
|
||||
if (provider === "anthropic") return anthropicApiKeySetting.get().trim().length === 0;
|
||||
if (provider === "openai") return openAiApiKeySetting.get().trim().length === 0;
|
||||
if (provider === "local") return !isLocalModelReady();
|
||||
if (provider === "openai-compatible") return !assistantOpenAiCompatibleUrlSetting.get().trim() || !assistantOpenAiCompatibleModelSetting.get().trim();
|
||||
if (provider === "hermes") return assistantHermesUrlSetting.get().trim().length === 0;
|
||||
// Hermes and OpenAI-compatible stay selectable before they're configured:
|
||||
// their rows only appear in Settings once one is the selected model.
|
||||
return false;
|
||||
},
|
||||
description:
|
||||
global.isIOS ? "Model used by the assistant. Auto prefers Terra with an OpenAI key, then Sonnet with an Anthropic key, then Apple Intelligence's on-device model. OpenAI-compatible uses the URL, model ID, and optional key below; Auto never picks it." : "Model used by the assistant. Auto prefers Terra when an OpenAI key is set, then Sonnet when an Anthropic key is set, then the downloaded on-phone model. OpenAI-compatible uses the URL, model ID, and optional key below; Auto never picks it.",
|
||||
global.isIOS ? "Model used by the assistant. Auto prefers Terra with an OpenAI key, then Sonnet with an Anthropic key, then Apple Intelligence's on-device model; it never picks OpenAI-compatible or Hermes agent. Choosing either of those shows its settings below." : "Model used by the assistant. Auto prefers Terra when an OpenAI key is set, then Sonnet when an Anthropic key is set, then the downloaded on-phone model; it never picks OpenAI-compatible or Hermes agent. Choosing either of those shows its settings below.",
|
||||
});
|
||||
|
||||
export const mapboxApiKeySetting = new ConfigSettingString({
|
||||
|
||||
@@ -148,25 +148,31 @@ function settingsSections(): SettingsSection[] {
|
||||
},
|
||||
{
|
||||
label: "Assistant",
|
||||
// Re-read on every paint so the Venice-only row follows URL edits.
|
||||
// Re-read on every paint: provider-specific rows follow the selected
|
||||
// model (and, for Venice, the compatible URL).
|
||||
get items() {
|
||||
const selectedModel = assistantModelSetting.get();
|
||||
return [
|
||||
// iOS's on-phone model is Apple Intelligence; Android downloads one. Only Android has the bridge.
|
||||
enumSettingMenuItem(assistantBackendSetting),
|
||||
enumSettingMenuItem(assistantModelSetting),
|
||||
textSettingMenuItem(assistantHermesUrlSetting),
|
||||
textSettingMenuItem(assistantHermesKeySetting),
|
||||
textSettingMenuItem(assistantOpenAiCompatibleUrlSetting),
|
||||
textSettingMenuItem(assistantOpenAiCompatibleKeySetting),
|
||||
compatibleModelDiscoveryMenuItem({
|
||||
getBaseUrl: () => assistantOpenAiCompatibleUrlSetting.get(),
|
||||
getApiKey: () => assistantOpenAiCompatibleKeySetting.get(),
|
||||
getModel: () => assistantOpenAiCompatibleModelSetting.get(),
|
||||
setModel: (model) => assistantOpenAiCompatibleModelSetting.set(model),
|
||||
}, assistantOpenAiCompatibleModelSetting),
|
||||
textSettingMenuItem(assistantOpenAiCompatibleModelSetting),
|
||||
...(isVeniceApiBaseUrl(assistantOpenAiCompatibleUrlSetting.get())
|
||||
? [toggleSettingMenuItem(veniceWebSearchSetting)] : []),
|
||||
...(selectedModel === "hermes" ? [
|
||||
textSettingMenuItem(assistantHermesUrlSetting),
|
||||
textSettingMenuItem(assistantHermesKeySetting),
|
||||
] : []),
|
||||
...(selectedModel === "openai-compatible" ? [
|
||||
textSettingMenuItem(assistantOpenAiCompatibleUrlSetting),
|
||||
textSettingMenuItem(assistantOpenAiCompatibleKeySetting),
|
||||
compatibleModelDiscoveryMenuItem({
|
||||
getBaseUrl: () => assistantOpenAiCompatibleUrlSetting.get(),
|
||||
getApiKey: () => assistantOpenAiCompatibleKeySetting.get(),
|
||||
getModel: () => assistantOpenAiCompatibleModelSetting.get(),
|
||||
setModel: (model) => assistantOpenAiCompatibleModelSetting.set(model),
|
||||
}, assistantOpenAiCompatibleModelSetting),
|
||||
textSettingMenuItem(assistantOpenAiCompatibleModelSetting),
|
||||
...(isVeniceApiBaseUrl(assistantOpenAiCompatibleUrlSetting.get())
|
||||
? [toggleSettingMenuItem(veniceWebSearchSetting)] : []),
|
||||
] : []),
|
||||
global.isIOS ? systemModelMenuItem() : localModelMenuItem(),
|
||||
toggleSettingMenuItem(assistantSkipConfirmationSetting),
|
||||
// iOS has no agent bridge yet.
|
||||
|
||||
+10
-5
@@ -1670,6 +1670,15 @@ class Shell {
|
||||
return this.resolveAssistantConfiguration(current.model, current.reasoning) !== null;
|
||||
}
|
||||
|
||||
/** What to set up when isAssistantAvailable() is false. */
|
||||
assistantSetupHint(): string {
|
||||
if (assistantBackendSetting.get() === "external") return "Configure the agent bridge host and token in Settings.";
|
||||
const model = this.getAssistantConversations().current().model;
|
||||
if (model === "hermes") return "Set the Hermes URL in Settings > Assistant.";
|
||||
if (model === "openai-compatible") return "Set the compatible API URL and model ID in Settings > Assistant.";
|
||||
return global.isIOS ? "Configure an assistant model in Settings." : "Set an API key or download the on-phone model in Settings.";
|
||||
}
|
||||
|
||||
/** Observe assistant turns (see AssistantActivityEvent). */
|
||||
onAssistantActivity(listener: (event: AssistantActivityEvent) => void): () => void {
|
||||
this.assistantActivityListeners.add(listener);
|
||||
@@ -1754,11 +1763,7 @@ class Shell {
|
||||
if (!text) return;
|
||||
const session = this.ensureAssistantSession();
|
||||
if (!session) {
|
||||
this.showAlert(
|
||||
assistantBackendSetting.get() === "external"
|
||||
? "Configure the agent bridge host and token in Settings."
|
||||
: global.isIOS ? "Configure an assistant model in Settings." : "Set an API key or download the on-phone model in Settings.",
|
||||
);
|
||||
this.showAlert(this.assistantSetupHint());
|
||||
return;
|
||||
}
|
||||
if (session.isTurnActive()) {
|
||||
|
||||
Reference in new issue
Block a user