Add dedicated quick question API
TestFlight / Build and upload (push) Successful in 1m42s

This commit is contained in:
2026-08-27 19:31:23 -07:00
parent 5f9fc82b86
commit 922172fc60
13 changed files with 269 additions and 44 deletions
+30
View File
@@ -0,0 +1,30 @@
import type { MultiplexRequest, Provider } from "./types.js";
export const QUICK_QUESTION_SYSTEM_PROMPT =
"You are answering a quick question in a one-shot experience intended to replace a quick Google search. " +
"Give a succinct, direct, self-contained answer. Do not ask follow-up questions, invite the user to continue, " +
"or offer additional help. If the question is ambiguous, make the most reasonable assumption and state it briefly only when needed.";
export type QuickQuestionRequest = {
provider: Provider;
model: string;
question: string;
enabledTools?: string[];
userLocation?: string;
temperature?: number;
maxTokens?: number;
};
export function buildQuickQuestionMultiplexRequest({
question,
...request
}: QuickQuestionRequest): MultiplexRequest {
return {
...request,
persist: false,
messages: [
{ role: "system", content: QUICK_QUESTION_SYSTEM_PROMPT },
{ role: "user", content: question },
],
};
}