Document and Material Drafting for Departmental Budget Preparation: Multi-turn Dialogue and Prompt Engineering

Document and Material Drafting for Departmental Budget Preparation: Multi-turn Dialogue and Prompt Engineering

What this category of data looks like

Data is primarily sourced from the unified budget management system, departmental staffing system, prior-year final accounts, project repository, and the annual budget preparation notice issued by the Ministry of Finance. Update frequency is annual. Daily produced documents include departmental budget drafts, project application forms, performance target forms, personnel expense calculation forms, budget approval documents, and more. Document structures typically include modules such as unit basic information, personnel expense calculation details, project expenditure lists, and performance target setting. Fields include authorized number of staff, public expense quotas, project budget amounts, performance indicators, and other relevant items. Standard metrics commonly used by fiscal authorities, such as ten thousand yuan and person, are adopted for units.

The annual update requirement means dialogue context must be bound to the current year’s budget preparation rules, to avoid mixing cross-year data. Multiple data sources mean dialogue must sequentially associate information from staffing, project repository, final accounts and other data sources. Multi-turn dialogue is needed to gradually clarify the data scope. The complexity of document fields means prompts must accurately specify the types of fields to extract, to prevent generated content from deviating from standard budget preparation formats. The serious consequences of errors mean the dialogue flow must include a parameter verification step, to ensure generated documents meet fiscal review requirements.

Configuration Settings

Under FastGPT v4.17.0, refer to the following configuration items and values:

Configuration ItemRecommended ApproachRationale
chatIdBind the unique identifier of the current budget preparation yearDifferentiate budget preparation sessions across years, avoid context confusion
messagesPopulate pre-prompts and user dialogue content sequentially according to budget preparation stages, retain context from no more than the first 3 turnsBudget preparation data is fixed per year, excessive context will introduce irrelevant historical data
variablesPreset variables such as authorized unit staffing number, project repository list, annual quota standards, pull values from corresponding systemsEnsure generated content matches actual business data, avoid deviations from generic templates
Context window limit8000–12000 charactersCover core document content for single-department budget preparation, avoid context overflow
Prompt module divisionSet up modules separately for personnel expenses, project expenditures, and performance targetsCorrespond to the fixed structure of budget documents, improve standardization of generated content

Three Common Mistakes

  • Phenomenon: The generated budget document does not include the specified performance target fields when calling the /api/v1/chat/completions API. Cause: The dedicated prompt for the performance target form was not correctly embedded in the messages parameter, so the model did not match the document structure.
  • Phenomenon: Cross-year budget data is mixed during multi-turn dialogue. Cause: The unique identifier of the current preparation year was not bound via chatId, so the session context loaded prior-year budget data.
  • Phenomenon: Generated content does not comply with the budget preparation rules of the corresponding department when using a global API key to initiate a dialogue. Cause: Department-specific preparation parameters were not passed via the variables parameter, so the model used generic rules to generate content.

How to Confirm Proper Configuration

  • Initiate a test dialogue, input the current year’s budget preparation requirements, and check if the generated content includes specified fields such as authorized number of staff and project budget amount.
  • View session logs, confirm that the chatId parameter carries the unique identifier of the current year, with no cross-year context remaining.
  • Check the variables parameter when calling the API, confirm that latest data synchronized from corresponding business systems has been passed in.
  • Switch between Chinese and English input, confirm that the dialogue flow correctly matches the current language environment.

The values provided here are common starting points, and should be evaluated against the reader’s own samples.

Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-28.