What data looks like for this use case
PCB manufacturing production ledger data sources include customer-provided Gerber files, drill files, BOM lists, CAM parsing records, real-time parameters from drilling, lamination and other equipment, bath solution test results, and inspection reports from AOI, electrical testing, and laboratory slicing. Data is updated continuously, by production batch, or per shift. Daily documents include engineering production instructions, drill parameter sheets, lamination process records, chemical analysis sheets, and defect inspection reports. Single-batch ledgers contain multiple structured and semi-structured fields, including specific parameters such as hole diameter, copper thickness, and number of detected defects. All data is tied to a corresponding production batch identifier.
What constraints do these characteristics impose on multi-turn dialogue and prompt engineering
PCB manufacturing ledger data has scattered sources and varied formats. Multi-turn dialogue must gradually guide collection of different types of business data to avoid missing key parameters. Data is updated frequently per production batch, so dialogue context must strictly bind batch identifiers to prevent cross-batch data confusion. Single-batch data volume is large, so prompts must explicitly specify field extraction rules for different documents to ensure only valid current batch data is included in summaries. Ledger abnormalities can cause entire board batches to be scrapped, so dialogue must validate field completeness and proactively ask for missing critical parameters.
Configuration Settings
This configuration is based on FastGPT v4.17.0. Specific parameters are as follows:
| Configuration Item | Recommended Approach | Rationale |
|---|---|---|
| Dialogue ID Configuration | Assign a unique chatId to each production batch's dialogue | Distinguish dialogue histories for different batches to prevent cross-batch data mix-ups |
| Variable Passing Configuration | Pass production batch ID and Gerber version number via the variables parameter, using a key-value pair object | Precisely locate ledger data for the target production batch |
| Context Window Size | 8000–12000 tokens, calibrated via actual testing | Single-batch PCB ledgers include multiple equipment reports and inspection records, requiring sufficient context to hold complete data |
| Multi-turn Dialogue History Retention Count | Keep the first 30 dialogue records | Limit historical data scale to avoid interfering with ledger generation for the current batch |
| Timeout Waiting Configuration | 600 seconds, calibrated via actual testing | Adapt to the multi-step nature of PCB ledger collection, allowing sufficient time to supplement missing data |
| Prompt Template Variable Binding | Map document fields such as Gerber parsing records and AOI reports to prompt placeholders | Explicitly specify required ledger fields to ensure summary content meets business requirements |
Three Common Mistakes
- Symptom: After passing the
variablesparameter via API, the generated production ledger is not associated with the specified PCB production batch. Cause: The batch identifier invariableswas not bound to the retrieval filter conditions of the prompt. - Symptom: After a text content extraction failure triggers a predefined response, the dialogue terminates directly without waiting for user supplementary input. Cause: No waiting trigger rule for multi-turn dialogue was configured, only a single extraction operation was executed.
- Symptom: The model outputs Chinese text, but the prompt requires English output. Cause: The output language rule was not explicitly specified in the
messagesparameter, and the language configuration consistency between the knowledge base and model was not verified.
How to Verify Proper Configuration
- Test passing the
variablesparameter with a specified PCB production batch number, and check that the generated ledger only includes equipment parameters and inspection report data for that batch. - Simulate a text content extraction failure scenario, and confirm that the system returns a preset prompt and waits for the user to supplement necessary production data.
- After configuring an English prompt template, check that the model's output report meets the specified language requirements.
- Initiate consecutive multi-turn dialogues switching between different production batches, and confirm that each generated ledger only associates with the current batch's data sources.
The values provided are common starting points and should be measured against the reader's own samples.