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 },
    ],
  };
}
