Add Venice assistant web search option

This commit is contained in:
reidellawfirm committed 2026-10-31 16:01:25 -05:00
1 parent cc8dc544be
commit 9a8c681d67
14 files changed
+218 -30

No files matched your search

+4 -1
View File
@@ -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(),
+6
View File
@@ -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") {
+1
View File
@@ -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),