feat(S2): max_tokens dynamic from template, remove hardcoded 500

- PromptTemplate model: add max_tokens (default 500) and example_input fields
- generate_with_llm: read max_tokens from template, accept override param
- api_prompt_generate: accept optional max_tokens with 100-4096 clamp
- Vue: add advanced options toggle with max_tokens input
- Vue: auto-populate max_tokens from selected template

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
renjianbo
2026-05-03 09:46:12 +08:00
parent ba73f8395a
commit eb5056b5f2
5 changed files with 58 additions and 13 deletions

View File

@@ -14,6 +14,6 @@ export function fetchTemplatesByCategory(category: string) {
return client.get<TemplatesByCategoryResponse>(path).then((r) => r.data)
}
export function generatePrompt(body: { input_text: string; template_id: number | null }) {
export function generatePrompt(body: { input_text: string; template_id: number | null; max_tokens?: number }) {
return client.post<GeneratePromptResponse>('/api/prompt/generate', body).then((r) => r.data)
}