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
@@ -1,4 +1,5 @@
|
||||
import { streamAnthropicMessage } from "../native/anthropic";
|
||||
import { streamHermesChat } from "../native/hermes";
|
||||
import { streamLocalQwen } from "../native/llama";
|
||||
import { streamOpenAiResponse } from "../native/openai";
|
||||
import type {
|
||||
@@ -30,6 +31,9 @@ export type DirectTurnOptions = {
|
||||
apiKey: string;
|
||||
model: string;
|
||||
effort?: "low" | "medium" | "high";
|
||||
/** Hermes: the API root, and the server-side session this conversation maps to. */
|
||||
baseUrl?: string;
|
||||
sessionId?: string;
|
||||
system: string;
|
||||
/** Owned by the session; this loop appends assistant + tool_result messages. */
|
||||
messages: LlmMessage[];
|
||||
@@ -79,7 +83,8 @@ export class DirectAssistantBackend {
|
||||
system: options.system,
|
||||
effort: options.effort,
|
||||
messages: options.messages,
|
||||
tools: options.buildTools(),
|
||||
// Hermes runs its own tools; Faceclaw's are not offered to it.
|
||||
tools: options.provider === "hermes" ? [] : options.buildTools(),
|
||||
onTextDelta: (delta, textSoFar) => {
|
||||
if (cancelled) return;
|
||||
options.callbacks.onTextDelta(delta, priorText + textSoFar);
|
||||
@@ -128,7 +133,9 @@ export class DirectAssistantBackend {
|
||||
},
|
||||
};
|
||||
streamHandle =
|
||||
options.provider === "openai"
|
||||
options.provider === "hermes"
|
||||
? streamHermesChat({ ...streamOptions, baseUrl: options.baseUrl ?? "", sessionId: options.sessionId ?? "" })
|
||||
: options.provider === "openai"
|
||||
? streamOpenAiResponse(streamOptions)
|
||||
: options.provider === "local"
|
||||
? streamLocalQwen(streamOptions)
|
||||
|
||||
Reference in new issue
Block a user