Crafting Process Documents and Exception Reports for Cosmetics Production: Tool Calling and Plugins

Data for this category comes from registered and filed formulas, raw material safety documents, weighing and emulsification equipment, ERP/MES

What the data for this category looks like

Data for this category comes from registered and filed formulas, raw material safety documents, weighing and emulsification equipment, ERP/MES systems, laboratory records, and packaging material version documents from skincare, haircare, makeup, and special cosmetics manufacturers. Daily documents include formula process sheets, weighing and feeding records, emulsification or filling records, cleaning and site clearance records, semi-finished and finished product inspection reports, and label review forms. Fields include restricted substance content of raw materials, process temperature, homogenization time, production batch number, packaging material claim content, and more. Data updates with each production batch or line change.

What constraints do these characteristics impose on the tool calling and plugins workflow?

Data updates with each production batch or line change, so tool calling must bind to the exclusive data scope of a single production batch to avoid mixing data across batches. Document fields contain highly compliant professional content, so tool calling must accurately match fields from filed formulas and raw material safety documents to prevent inconsistent filing risks. The total data volume covering all process links for a single production run is large, so tool calling must limit the scope of data returned in a single request to avoid context overload. Tool calling must also support field alignment across multiple data sources to ensure accurate parameters during the review phase.

Configuration Settings

Configuration ItemRecommended SettingRationale
Workflow/API tool selectionautoMeets automatic calling needs for multi-source process data
Workflow/API function-call configurationEnabledSupports precise calling of specific document modules such as formulas and inspection records
Single Search LimitTop 3 entriesMatches the limited data volume of a single production batch
Maximum Context8000–10000 tokenCovers the document length of the full process for a single production batch
RerankingCalibrated via actual testingPrioritizes matching core fields such as restricted substances and process parameters
Call Timeout Threshold60 secondsPrevents timeout during single-batch data processing

This document is written based on FastGPT v4.17.0.

Three Common Mistakes

  • Symptom: Tool calling accidentally introduces knowledge base content from non-current production batches. Cause: Fails to bind the exclusive data scope for a single production batch, and defaults to calling all knowledge base documents.
  • Symptom: API calls return a 514 status code. Cause: Fails to limit the return data volume or timeout threshold for a single tool call, exceeding the interface's transmission or processing limits.
  • Symptom: Exception reports generated by tool calling lack fields related to raw material restricted substances. Cause: Fails to align field mappings between raw material safety documents and inspection records, making it impossible to extract corresponding compliant content.

How to Verify Correct Configuration

  • Trigger a single-batch process review task, and check if tool calling only returns exclusive data such as formulas and feeding records for that batch.
  • Simulate an API call, confirm that no abnormal status codes are returned, and that functionCall and toolChoice configurations trigger correctly.
  • Generate a draft exception report, and verify that core fields such as restricted substances, process parameters, and production batch number are covered.
  • Review tool calling logs, confirm that only preset data source modules are called, and no additional irrelevant data is introduced.

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