Process Document and Abnormal Report Drafting for Non-Ferrous Metal Smelting and Electrolysis: Tool Calling and Plugins

Data for this category mainly comes from concentrate and auxiliary material analysis, DCS systems, cell voltage and current monitoring, laboratories

What this category of data looks like

Data for this category mainly comes from concentrate and auxiliary material analysis, DCS systems, cell voltage and current monitoring, laboratories, and energy and environmental monitoring equipment. Daily documents include batching lists, smelting records, electrolytic cell condition records, laboratory reports, anode and cathode quality records, and environmental protection ledgers. Data update frequency changes in real time based on production batches, furnace heats, or cell conditions. Some parameters such as cell voltage and current are updated every second, while raw material composition analysis is updated upon completion of each batch of raw materials. Document fields include raw material composition parameters, cell condition values, laboratory test indicators, environmental emission indicators, and other items. There is no unified fixed format, and corresponding fields must be identified according to document type.

Multi-source heterogeneous data sources and real-time update rhythms require tool calling to interface with multiple systems simultaneously, and set reasonable timeout periods to match data pull speeds. Diverse document structures and non-uniform fields require plugins to have the ability to automatically identify fields based on document type, avoiding confusion of parameters from different documents. High-frequency real-time data and complex composition balance and cell condition control requirements require tool calling to support batch data processing, and ensure the accuracy of calling results to prevent errors in process documents caused by data delays or missing information. In addition, the consequences of errors are directly linked to metal recovery rates and environmental compliance. The failure retry and exception trigger logic of tool calling must strictly adapt to the risk level of the production link.

Configuration Settings

This configuration description is based on FastGPT v4.17.0:

Configuration ItemRecommended SettingRationale
Workflow/API tool selectionautoAdapt to multi-source data to automatically call corresponding tools, no need to manually specify tool types
Workflow/API function-call configurationEnable forced modeEnsure complete extraction of required fields for process documents and abnormal reports, avoid missing key parameters
Tool call timeout period10–30 secondsMatch the second-level update interval of real-time cell condition data, prevent waiting for outdated data
Maximum context per single tool call8000 tokenAccommodate the complete content of multiple smelting and electrolysis records, avoid content truncation
Tool result aggregation ruleGroup by document typeDistinguish data of different categories such as batching lists and cell condition records, ensure clear output structure
Exception trigger thresholdCalibrate based on actual measurementsAdapt to abnormal judgment standards for different smelting links, avoid false positives or false negatives

Three Common Errors

  • Phenomenon: Mixed intermediate AI conversation content appears in tool call output, and the final result includes multiple rounds of irrelevant interactions. Cause: No tool call termination configuration was added at the end of the process orchestration, causing the context to not be truncated and leaving residual previous conversation information.
  • Phenomenon: Some required fields in process documents are empty, and format verification cannot be completed. Cause: The functionCall forced mode was not enabled, so the AI did not call the corresponding tool to extract complete information such as raw material ratios and cell condition parameters.
  • Phenomenon: Tool call returns a timeout error, with the status code showing request timeout. Cause: The set timeout period is shorter than the average time required for multi-source data pulling, and does not match the update rhythm of real-time production data.

How to Confirm Proper Configuration

  • Import a complete sample of electrolytic cell condition records and batching lists, trigger the tool call process, and check that the final output only contains aggregated process documents and abnormal reports, with no intermediate AI conversation content.
  • View the tool call log to confirm that the functionCall mode is enabled, and all required fields such as cell voltage and raw material ratio have been correctly extracted.
  • Simulate input of abnormal data, check whether the tool call triggers the generation of an abnormal report within the set threshold, and that the timeout period meets the configuration requirements.
  • Compare multiple rounds of call results to confirm that tool call results are correctly grouped by document type, with no mixed data from different documents.

The values provided here are common starting points and should be measured against the reader's own samples.