Bid Document and Quotation Preparation for Active Pharmaceutical Ingredient and Pharmaceutical Intermediate Production: Tool Calling and Plugins

The data for this category comes from registered process documents, raw material batch ledgers, DCS production control systems, weighing systems, LIMS

What Data Looks Like for This Category

The data for this category comes from registered process documents, raw material batch ledgers, DCS production control systems, weighing systems, LIMS laboratory information management systems, chromatography data systems, and QMS quality management systems. Daily generated documents include batch production records, material balance reports, reaction and purification process records, cleaning validation records, impurity profile reports, deviation and change control documents. Data is updated once per production batch and once per process step. Fields include process parameters, yield data, impurity content, solvent residue levels, batch numbers, and compliance status. Units include molar ratios, percentages, milligrams per unit, and others.

What Constraints Do These Characteristics Impose on Tool Calling and Plugins

Data for this category is multi-source and updated per batch. Tool calls must be bound to the context of the corresponding production batch to avoid mixing process parameters and impurity data across batches. Daily documents include specialized chemical parameters and compliance records. Plugins must support parsing structured and semi-structured files such as impurity profile reports and material balance reports. Yield, impurity content, and other data directly affect the reasonableness of bid quotations. Tool calls must verify batch consistency and compliance status of data sources. Bid documents must match registered process requirements. Plugins must link to deviation and change control documents in the QMS system to ensure content meets registered compliance standards.

How to Configure Settings

The following configuration instructions are based on FastGPT v4.17.0.

Configuration ItemRecommended SettingRationale
Workflow/API tool selectionSet to auto and bind to the active pharmaceutical ingredient bidding tool setAutomatically trigger tool calls for corresponding batch data and impurity profile parsing, matching business data structures
Workflow/API function-call configurationEnable forced tool callingEnsure that compliant data tools must be called when generating quotations and documents, avoiding generation of unsubstantiated content
Historical conversation retention rounds3–5 roundsAdapt to the need for associating past batch processes and quotations during bid preparation, controlling context length
Tool call timeout period60–120 secondsAdapt to the time required for multi-source data pulling and professional document parsing, avoiding call interruptions
Maximum context window8000–12000 tokenAccommodate content from multiple process records and impurity profile reports, ensuring context integrity for tool calls
Number of entries returned per single tool callTop 3–5 entriesAdapt to the reasonable range of multi-source data pulling, avoiding excessive data return that causes context overflow

Three Common Configuration Mistakes

  • Issue: After configuring a locally deployed Ollama model, checking the enable tool calling option still fails to trigger tool calls. Cause: The tool calling protocol of some locally deployed models is not fully compatible with FastGPT's plugin calling logic. Confirm that the model natively supports standard tool calling formats.
  • Issue: In multi-workflow model calls, when accessing the same ID multiple times, the historical records from the first model call are not retained. Cause: The first model call was set to retain only 1 round of conversation, and no global session ID was bound, preventing context reuse across steps.
  • Issue: After enabling the output thinking configuration, no thinking content is displayed during tool calls. Cause: The toolChoice parameter was not correctly configured to allow thinking output, or the model did not return structured output fields for the thinking phase.

How to Confirm Correct Configuration

  • Submit a simulated bid document generation request, check if the tool call logs trigger dedicated tool calls matching this category.
  • Check the historical conversation retention rounds configuration, confirm that multiple accesses with the same session ID can retain corresponding context data.
  • Verify that after enabling the thinking output configuration, structured thinking process content is displayed during the tool call workflow.
  • Test pulling impurity profile report data for a single batch, confirm that tool calls can normally parse and return corresponding fields.

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