forked from Blendman974/faceclaw
Assistant: add a Hermes agent backend
A "Hermes agent" assistant model talks to a Hermes Agent gateway's OpenAI-compatible API server (streamed /v1/chat/completions), with Hermes URL and key settings under Assistant. Hermes keeps the conversation: each assistant session maps to one X-Hermes-Session-Id and only the latest user message is sent. Faceclaw's own tools are not offered to it, and its reasoning stream is not shown on the glasses. See notes/hermes-assistant.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2bb7b3ea1a
commit
d9924eedcd
9 files changed
+297
-4
No files matched your search
@@ -894,6 +894,28 @@ export const assistantBackendSetting = new ConfigSettingEnum<AssistantBackendKin
|
||||
global.isIOS ? "Cloud models called with your OpenAI or Anthropic API key. Add your key in Settings > API Keys." : "Who answers assistant queries: an LLM called from the phone (a cloud API with your key, or the downloaded on-phone model), or your own long-running agent (e.g. OpenClaw) reached through the faceclaw-agent-bridge plugin.",
|
||||
});
|
||||
|
||||
export const assistantHermesUrlSetting = new ConfigSettingString({
|
||||
id: "assistant-hermes-url",
|
||||
label: "Hermes URL",
|
||||
storageKey: "assistant.hermesUrl",
|
||||
defaultValue: "",
|
||||
editorTitle: "Hermes API server (e.g. http://host:8642/v1)",
|
||||
glassesEditTitle: "Edit Hermes URL",
|
||||
formatValue: (value) => value || "(not set)",
|
||||
description: "Address of a Hermes Agent gateway's API server, used when Hermes agent is the assistant model.",
|
||||
});
|
||||
|
||||
export const assistantHermesKeySetting = new ConfigSettingString({
|
||||
id: "assistant-hermes-key",
|
||||
label: "Hermes key",
|
||||
storageKey: "assistant.hermesKey",
|
||||
defaultValue: "",
|
||||
editorTitle: "Hermes API server key",
|
||||
glassesEditTitle: "Edit Hermes key",
|
||||
formatValue: (value) => (value ? `${value.slice(0, 6)}...` : "(not set)"),
|
||||
description: "The API server's key (API_SERVER_KEY in Hermes's .env).",
|
||||
});
|
||||
|
||||
export const assistantBridgeHostSetting = new ConfigSettingString({
|
||||
id: "assistant-bridge-host",
|
||||
label: "Bridge host",
|
||||
@@ -991,6 +1013,7 @@ 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 === "hermes") return assistantHermesUrlSetting.get().trim().length === 0;
|
||||
return false;
|
||||
},
|
||||
description:
|
||||
|
||||
@@ -36,6 +36,8 @@ import {
|
||||
uiDepthSetting,
|
||||
assistantAllowProactiveSetting,
|
||||
assistantBackendSetting,
|
||||
assistantHermesKeySetting,
|
||||
assistantHermesUrlSetting,
|
||||
assistantBridgeHostSetting,
|
||||
assistantBridgePortSetting,
|
||||
assistantBridgeTokenSetting,
|
||||
@@ -134,6 +136,8 @@ function settingsSections(): SettingsSection[] {
|
||||
// iOS offers cloud APIs; Android also supports local models and the bridge.
|
||||
enumSettingMenuItem(assistantBackendSetting),
|
||||
enumSettingMenuItem(assistantModelSetting),
|
||||
textSettingMenuItem(assistantHermesUrlSetting),
|
||||
textSettingMenuItem(assistantHermesKeySetting),
|
||||
...(!global.isIOS ? [localModelMenuItem()] : []),
|
||||
toggleSettingMenuItem(assistantSkipConfirmationSetting),
|
||||
// iOS has no local LLM or agent bridge yet.
|
||||
|
||||
@@ -31,6 +31,8 @@ import type { AssistantContext } from "../../assistant/types";
|
||||
import { SingleNotificationLayer } from "../notifications";
|
||||
import {
|
||||
anthropicApiKeySetting,
|
||||
assistantHermesKeySetting,
|
||||
assistantHermesUrlSetting,
|
||||
assistantBackendSetting,
|
||||
assistantBridgeHostSetting,
|
||||
assistantBridgePortSetting,
|
||||
@@ -1643,6 +1645,8 @@ class Shell {
|
||||
const llm = resolveAssistantModel(model, {
|
||||
anthropic: anthropicApiKeySetting.get(),
|
||||
openai: openAiApiKeySetting.get(),
|
||||
hermesUrl: assistantHermesUrlSetting.get(),
|
||||
hermesKey: assistantHermesKeySetting.get(),
|
||||
});
|
||||
if (llm && reasoning !== "default" && llm.effort) llm.effort = reasoning;
|
||||
return llm ? { kind: "direct", llm } : null;
|
||||
|
||||
Reference in new issue
Block a user