diff --git a/PRIVACY b/PRIVACY index e1c63418..f906afdf 100644 --- a/PRIVACY +++ b/PRIVACY @@ -135,6 +135,12 @@ server, the server's operator controls those policies. If you choose Discover models, Faceclaw also requests that server's model catalog using the same configured URL and optional API key. +If you enable **Venice web search** for the official Venice API URL, supported +models may generate web-search queries from your assistant conversation. Those +queries and their results are processed by Venice's search service and are +subject to Venice's privacy policy and any applicable charges. This setting is +off by default and is never sent to Open WebUI or other compatible providers. + AI conversation histories and memory files may be stored on your phone. Faceclaw does not transmit voice-assistant prompts or responses to any party other than a user-selected AI model provider. The voice assistant is given diff --git a/README.md b/README.md index bcbac92a..17f1b69e 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ import it into the new version. and responds to queries and commands using an onboard model (Qwen3 4B, slow) or with an Anthropic, OpenAI, or OpenAI-compatible Chat Completions model (including Venice and private Open WebUI servers; model ID and - usually an API key required), or using your own long-running OpenClaw - agent. + usually an API key required), with optional Venice web search for supported + models, or using your own long-running OpenClaw agent. * **Multitasking**, with an app-switcher sidebar and app launcher. * **Glanceboard**, a dashboard with widgets that you can quickly view with a * **Mostly-compatible with EvenHub.** Install and runapps from the Even app @@ -127,6 +127,12 @@ or `/api`. Discovery requests `{API root}/models` only when you choose it; there is no background discovery or automatic model selection. Manual model entry remains available for servers without a compatible model-list endpoint. +For the official Venice URL, **Settings > Assistant** also shows **Venice web +search**. It is off by default and visible only for that URL. When enabled, +supported Venice models may search the web for current information; the search +model must support the feature. Open WebUI and other compatible servers never +receive Venice-specific parameters, including after an endpoint switch. + The same provider can supply Calculator's rewrite fallback and Translate. Actual tool calling depends on the selected model and server. Use HTTPS where possible; mobile cleartext policies may block plain HTTP. For a private server, diff --git a/app/assistant/direct-backend.ts b/app/assistant/direct-backend.ts index 1f313a9f..286ebcfc 100644 --- a/app/assistant/direct-backend.ts +++ b/app/assistant/direct-backend.ts @@ -41,6 +41,8 @@ export type DirectTurnOptions = { effort?: "low" | "medium" | "high"; /** Hermes: the API root, and the server-side session this conversation maps to. */ baseUrl?: string; + /** Venice-only web search for this interactive turn. */ + webSearch?: boolean; sessionId?: string; system: string; /** Owned by the session; this loop appends assistant + tool_result messages. */ @@ -86,11 +88,12 @@ export class DirectAssistantBackend { return; } - const streamOptions: LlmStreamOptions = { + const streamOptions: LlmStreamOptions & { webSearch?: boolean } = { apiKey: options.apiKey, model: options.model, system: options.system, effort: options.effort, + webSearch: options.webSearch, messages: options.messages, // Hermes runs its own tools; Faceclaw's are not offered to it. tools: options.provider === "hermes" ? [] : options.buildTools(), diff --git a/app/assistant/models.ts b/app/assistant/models.ts index 63386c78..28829252 100644 --- a/app/assistant/models.ts +++ b/app/assistant/models.ts @@ -1,4 +1,5 @@ import { isLocalModelReady, LOCAL_MODEL } from "../native/llama"; +import { isVeniceApiBaseUrl } from "../native/openai-chat"; export const ASSISTANT_MODEL_VALUES = [ "auto", @@ -33,6 +34,8 @@ export type AssistantApiKeys = { openAiCompatibleUrl?: string; openAiCompatibleKey?: string; openAiCompatibleModel?: string; + /** Venice web search, applied only when the resolved root is Venice. */ + veniceWebSearch?: boolean; }; export type ResolvedAssistantModel = { @@ -43,6 +46,8 @@ export type ResolvedAssistantModel = { effort?: "low" | "medium" | "high"; /** API root for Hermes or an OpenAI-compatible provider. */ baseUrl?: string; + /** Whether Venice web search is enabled for this interactive assistant turn. */ + webSearch?: boolean; }; type ModelDefinition = { @@ -121,6 +126,7 @@ export function resolveAssistantModel( model, apiKey: keys.openAiCompatibleKey?.trim() ?? "", baseUrl, + webSearch: isVeniceApiBaseUrl(baseUrl) && keys.veniceWebSearch === true, }; } if (definition.provider === "local") { diff --git a/app/assistant/session.ts b/app/assistant/session.ts index 7d087c43..c64e5983 100644 --- a/app/assistant/session.ts +++ b/app/assistant/session.ts @@ -198,6 +198,7 @@ export class AssistantSession { model: llm.model, effort: llm.effort, baseUrl: llm.baseUrl, + webSearch: llm.webSearch, sessionId: this.hermesSessionId, system: llm.provider === "hermes" ? HERMES_SYSTEM_PROMPT : isLocal ? ASSISTANT_SYSTEM_PROMPT_BASE : buildAssistantSystemPrompt(ctx), diff --git a/app/native/openai-chat.ts b/app/native/openai-chat.ts index 82a4db30..08d061df 100644 --- a/app/native/openai-chat.ts +++ b/app/native/openai-chat.ts @@ -5,10 +5,17 @@ import type { } from "../assistant/llm-protocol"; import { openSseRequest, type SseListener } from "./sse"; +/** True only for Venice's official API root, never for lookalike hosts. */ +export function isVeniceApiBaseUrl(input: string): boolean { + return normalizeOpenAiCompatibleUrl(input) === "https://api.venice.ai/api/v1"; +} + /** Streaming client for OpenAI-compatible Chat Completions APIs. */ export type OpenAiCompatibleStreamOptions = LlmStreamOptions & { /** Explicit API root, for example https://api.venice.ai/api/v1 or https://host/api. */ baseUrl: string; + /** Venice-only web search; never sent to other compatible providers. */ + webSearch?: boolean; }; type PendingToolCall = { @@ -117,6 +124,11 @@ export function streamOpenAiCompatibleChat(options: OpenAiCompatibleStreamOption }, })); } + // Provider-specific parameters must never leak to another endpoint, even + // when a saved Venice preference is still enabled. + if (options.webSearch === true && isVeniceApiBaseUrl(baseUrl)) { + body.venice_parameters = { enable_web_search: "on" }; + } // Do not send provider-specific reasoning fields by default. Compatible // servers vary widely; advanced reasoning controls can be added separately. diff --git a/app/ui/dashboard-settings.ts b/app/ui/dashboard-settings.ts index 9a5c9c2a..7ee833db 100644 --- a/app/ui/dashboard-settings.ts +++ b/app/ui/dashboard-settings.ts @@ -1043,6 +1043,14 @@ export const assistantOpenAiCompatibleModelSetting = new ConfigSettingString({ description: "Exact model ID sent to the compatible provider. For glasses tools, choose a model that supports function calling.", }); +export const veniceWebSearchSetting = new ConfigSettingBoolean({ + id: "venice-web-search", + 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.", +}); + export const elevenLabsApiKeySetting = new ConfigSettingString({ id: "elevenlabs-api-key", label: "ElevenLabs key", diff --git a/app/ui/dashboard/settings-menus.ts b/app/ui/dashboard/settings-menus.ts index f386cb0c..cbc6bb21 100644 --- a/app/ui/dashboard/settings-menus.ts +++ b/app/ui/dashboard/settings-menus.ts @@ -46,6 +46,7 @@ import { assistantOpenAiCompatibleModelSetting, assistantOpenAiCompatibleUrlSetting, assistantSkipConfirmationSetting, + veniceWebSearchSetting, batteryDisplayModeSetting, brightnessSetting, autoBrightnessMinSetting, @@ -98,6 +99,7 @@ import { wearBridge } from "../../native/wear-bridge"; import { openSettingsSubMenu, SettingsPanelLayer, type SettingsSection } from "./settings-panel"; import { uiFontPickerMenuItem } from "../font-picker"; import { compatibleModelDiscoveryMenuItem } from "../openai-compatible-model-picker"; +import { isVeniceApiBaseUrl } from "../../native/openai-chat"; /** The Settings app's master-detail panel (sections on the left, contents on the right). */ export function createSettingsPanelLayer(): SettingsPanelLayer { @@ -146,31 +148,36 @@ function settingsSections(): SettingsSection[] { }, { label: "Assistant", - items: [ - // iOS offers cloud APIs; Android also supports local models and 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), - ...(!global.isIOS ? [localModelMenuItem()] : []), - toggleSettingMenuItem(assistantSkipConfirmationSetting), - // iOS has no local LLM or agent bridge yet. - ...(!global.isIOS ? [ - textSettingMenuItem(assistantBridgeHostSetting), - textSettingMenuItem(assistantBridgePortSetting), - textSettingMenuItem(assistantBridgeTokenSetting), - toggleSettingMenuItem(assistantAllowProactiveSetting), - ] : []), - ], + // Re-read on every paint so the Venice-only row follows URL edits. + get items() { + return [ + // iOS offers cloud APIs; Android also supports local models and 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)] : []), + ...(!global.isIOS ? [localModelMenuItem()] : []), + toggleSettingMenuItem(assistantSkipConfirmationSetting), + // iOS has no local LLM or agent bridge yet. + ...(!global.isIOS ? [ + textSettingMenuItem(assistantBridgeHostSetting), + textSettingMenuItem(assistantBridgePortSetting), + textSettingMenuItem(assistantBridgeTokenSetting), + toggleSettingMenuItem(assistantAllowProactiveSetting), + ] : []), + ]; + }, }, { label: "API Keys", diff --git a/app/ui/shell/shell.ts b/app/ui/shell/shell.ts index 49766d65..bfc04cfd 100644 --- a/app/ui/shell/shell.ts +++ b/app/ui/shell/shell.ts @@ -42,6 +42,7 @@ import { assistantOpenAiCompatibleModelSetting, assistantOpenAiCompatibleUrlSetting, assistantSkipConfirmationSetting, + veniceWebSearchSetting, batteryIndicatorSettingsKey, brightnessSetting, onAnySettingChanged, @@ -1726,6 +1727,7 @@ class Shell { openAiCompatibleUrl: assistantOpenAiCompatibleUrlSetting.get(), openAiCompatibleKey: assistantOpenAiCompatibleKeySetting.get(), openAiCompatibleModel: assistantOpenAiCompatibleModelSetting.get(), + veniceWebSearch: veniceWebSearchSetting.get(), }); if (llm && reasoning !== "default" && llm.effort) llm.effort = reasoning; return llm ? { kind: "direct", llm } : null; diff --git a/tests/openai-compatible-assistant.test.cjs b/tests/openai-compatible-assistant.test.cjs index db8060a6..483d239a 100644 --- a/tests/openai-compatible-assistant.test.cjs +++ b/tests/openai-compatible-assistant.test.cjs @@ -80,6 +80,40 @@ test('compatible provider sends full history, nested tools, the exact API root a noKey.session.cancel(); }); +test('Venice web search is opt-in and never leaks to other compatible providers', () => { + const defaultOff = assistant({ baseUrl: 'https://api.venice.ai/api/v1' }); + defaultOff.send('Current weather'); + assert.equal('venice_parameters' in defaultOff.requests[0].body, false); + defaultOff.session.cancel(); + + const { isVeniceApiBaseUrl } = defaultOff.load('app/native/openai-chat.ts'); + assert.equal(isVeniceApiBaseUrl(' https://api.venice.ai/api/v1/ '), true); + assert.equal(isVeniceApiBaseUrl('https://api.venice.ai/api/v1/chat/completions'), true); + assert.equal(isVeniceApiBaseUrl('http://api.venice.ai/api/v1'), false); + assert.equal(isVeniceApiBaseUrl('https://api.venice.ai.evil.example/api/v1'), false); + assert.equal(isVeniceApiBaseUrl('https://openwebui.example/api'), false); + + const enabled = assistant({ baseUrl: 'https://api.venice.ai/api/v1' }); + enabled.session.configure({ kind: 'direct', llm: { + selection: 'openai-compatible', provider: 'openai-compatible', model: 'fixture-model', + apiKey: 'fixture-key', baseUrl: 'https://api.venice.ai/api/v1', webSearch: true, + } }); + enabled.send('Current weather'); + assert.deepEqual(JSON.parse(JSON.stringify(enabled.requests[0].body.venice_parameters)), { + enable_web_search: 'on', + }); + enabled.session.cancel(); + + const openWebUi = assistant({ baseUrl: 'https://openwebui.example/api' }); + openWebUi.session.configure({ kind: 'direct', llm: { + selection: 'openai-compatible', provider: 'openai-compatible', model: 'fixture-model', + apiKey: 'fixture-key', baseUrl: 'https://openwebui.example/api', webSearch: true, + } }); + openWebUi.send('Current weather'); + assert.equal('venice_parameters' in openWebUi.requests[0].body, false); + openWebUi.session.cancel(); +}); + test('Venice and Open WebUI roots are preserved; only a complete endpoint suffix is removed', () => { const { normalizeOpenAiCompatibleUrl } = assistant().load('app/native/openai-chat.ts'); assert.equal(normalizeOpenAiCompatibleUrl(' https://api.venice.ai/api/v1/ '), 'https://api.venice.ai/api/v1'); diff --git a/tests/venice-web-search-settings.test.cjs b/tests/venice-web-search-settings.test.cjs new file mode 100644 index 00000000..0e8a9b9a --- /dev/null +++ b/tests/venice-web-search-settings.test.cjs @@ -0,0 +1,102 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { loader } = require('./helpers/load-typescript.cjs'); + +function settingsEnv(initialUrl = '') { + let url = initialUrl; + let webSearch = false; + const dummySetting = { + id: 'setting', label: 'Setting', get: () => '', set() {}, displayValue: () => '', + }; + const urlSetting = { + id: 'compatible-url', label: 'Compatible API URL', get: () => url, set: value => { url = value; }, + displayValue: () => url, + }; + const searchSetting = { + id: 'venice-web-search', label: 'Venice web search', get: () => webSearch, + set: value => { webSearch = value; }, toggle: () => { webSearch = !webSearch; }, + defaultValue: false, description: 'Venice-only web search.', + }; + const row = setting => ({ label: setting.label, description: setting.description, onSelect() {} }); + const dashboardSettings = new Proxy({ + assistantOpenAiCompatibleUrlSetting: urlSetting, + veniceWebSearchSetting: searchSetting, + enumSettingMenuItem: row, + textSettingMenuItem: row, + toggleSettingMenuItem: row, + }, { + get(target, property) { + return property in target ? target[property] : dummySetting; + }, + }); + const load = loader({ global: { isIOS: false, isAndroid: true } }, { + './remote-input-menu': { remoteInputMenuItem: () => ({ label: 'Remote input' }) }, + '@nativescript/core': { knownFolders: {} }, + '../../graphics/ui-fonts': { getDefaultSmallFont: () => ({}) }, + '../../graphics/logo': { getDashboardLogo: () => null }, + '../../graphics/textwrap': { wrapText: () => [] }, + '../../version': { FACECLAW_VERSION: 'test' }, + '../../native/llama': { + cancelLocalModelDownload() {}, deleteLocalModel() {}, startLocalModelDownload() {}, + LOCAL_MODEL: { label: 'Qwen', sizeBytes: 1_000_000_000 }, + localModelState: () => ({ status: 'missing' }), onLocalModelStateChanged: () => () => {}, + }, + '../../native/asr-model': { + ASR_MODELS: { + moonshine: { label: 'Moonshine', sizeBytes: 1 }, + 'whisper-base-en': { label: 'Whisper Base English', sizeBytes: 1 }, + }, + asrModelState: () => ({}), cancelAsrModelDownload() {}, + deleteAsrModel() {}, startAsrModelDownload() {}, onAsrModelStateChanged: () => () => {}, + }, + '../../apps/files/text-viewer': { TextViewerLayer: class {} }, + '../../analytics/privacy-disclosure': { IOS_PRIVACY_NOTICE: '' }, + '../menu': { + drawRightValueMenuItem() {}, openModalMenu() {}, + submenuItem: label => ({ label, onSelect() {} }), + }, + '../shell/shell': { shell: { noteUserActivity() {} } }, + '../dashboard-settings': dashboardSettings, + '../../native/wear-bridge': { wearBridge: {} }, + './settings-panel': { + SettingsPanelLayer: class { constructor(sections) { this.sections = sections; } }, + openSettingsSubMenu() {}, + }, + '../font-picker': { uiFontPickerMenuItem: () => ({ label: 'Font' }) }, + '../openai-compatible-model-picker': { + compatibleModelDiscoveryMenuItem: () => ({ label: 'Discover models' }), + }, + './sse': {}, + }); + const panel = load('app/ui/dashboard/settings-menus.ts').createSettingsPanelLayer(); + const section = panel.sections.find(item => item.label === 'Assistant'); + assert.ok(section); + return { + section, + labels: () => section.items.map(item => item.label), + setUrl: value => { url = value; }, + searchSetting, + }; +} + +test('Venice web search row follows the current URL and never appears for other providers', () => { + const env = settingsEnv(); + assert.equal(env.labels().includes('Venice web search'), false); + assert.equal(env.searchSetting.defaultValue, false); + assert.equal(env.searchSetting.get(), false); + + env.setUrl(' https://api.venice.ai/api/v1/ '); + assert.equal(env.labels().includes('Venice web search'), true); + + env.setUrl('https://openwebui.example/api'); + assert.equal(env.labels().includes('Venice web search'), false); + + env.setUrl('https://api.venice.ai/api/v1/chat/completions'); + assert.equal(env.labels().includes('Venice web search'), true); + + env.setUrl('https://api.venice.ai.evil.example/api/v1'); + assert.equal(env.labels().includes('Venice web search'), false); + + env.setUrl('http://api.venice.ai/api/v1'); + assert.equal(env.labels().includes('Venice web search'), false); +}); diff --git a/website/content/features.md b/website/content/features.md index 2aad09d6..140a023e 100644 --- a/website/content/features.md +++ b/website/content/features.md @@ -6,7 +6,7 @@ Inline markdown supported by the sync script: **bold**, [text](url), `code`. --> -- **A voice assistant** that wakes up when you say "Hey Even", transcribes text with an on-device model, OpenAI Whisper, ElevenLabs, or Soniox API, and responds to queries and commands using an onboard model (Qwen3 4B, slow) or with an Anthropic, OpenAI, or OpenAI-compatible Chat Completions model (including Venice and private Open WebUI servers; model ID and usually an API key required), or using your own long-running OpenClaw agent. +- **A voice assistant** that wakes up when you say "Hey Even", transcribes text with an on-device model, OpenAI Whisper, ElevenLabs, or Soniox API, and responds to queries and commands using an onboard model (Qwen3 4B, slow) or with an Anthropic, OpenAI, or OpenAI-compatible Chat Completions model (including Venice and private Open WebUI servers; model ID and usually an API key required), with optional Venice web search for supported models, or using your own long-running OpenClaw agent. - **Multitasking**, with an app-switcher sidebar and app launcher. - **Glanceboard**, a dashboard with widgets that you can quickly view with a - **Mostly-compatible with EvenHub.** Install and runapps from the Even app store. diff --git a/website/index.html b/website/index.html index 6cd37638..d9fa5f9d 100644 --- a/website/index.html +++ b/website/index.html @@ -89,7 +89,7 @@
With an OpenAI-compatible provider, the configured server receives the assistant system prompt, conversation history, available tool definitions, and tool results needed to answer. Its URL, model ID, and optional API key are stored on the phone. Faceclaw does not operate that server and cannot make representations about its logging or retention; for a private Open WebUI server, the server's operator controls those policies. If you choose Discover models, Faceclaw also requests that server's model catalog using the same configured URL and optional API key.
+If you enable Venice web search for the official Venice API URL, supported models may generate web-search queries from your assistant conversation. Those queries and their results are processed by Venice's search service and are subject to Venice's privacy policy and any applicable charges. This setting is off by default and is never sent to Open WebUI or other compatible providers.
AI conversation histories and memory files may be stored on your phone. Faceclaw does not transmit voice-assistant prompts or responses to any party other than a user-selected AI model provider. The voice assistant is given tools with which it is able to access most things on the user's phone, including all content displayed on the glasses, location, notifications, and content accessible through the Terminal app.
The AI assistant can take actions on the user's behalf, including sharing any information it has access to. The user is responsible for any instructions they give it.