User Tools

Site Tools


api:dk11:delphi:gisaimodelcustom.tgis_aimodelcustom



TGIS_AIModelCustom class

DK for Delphi | GisAIModelCustom.TGIS_AIModelCustom | Classes | Constructors | Methods | Properties

Generic, user-configurable AI model runner that builds Python scripts from a template and executes them through a Python manager.

Available also on: .NET.

Syntax

// Delphi
type
  TGIS_AIModelCustom = class( TGIS_AIModel )
  end;
// C++ Builder
class PASCALIMPLEMENTATION TGIS_AIModelCustom : public TGIS_AIModel
{
};

Inheritance

Constructors

Inherited Overrides Protected
Name Visibility Description
Create public Instantiates a custom AI model with a Python manager, model path, script template, required modules, and placeholder tokens.
Destroy public Releases cached output and result state.
(Inherited from TGIS_AIModel)

Methods

Inherited Overrides Protected
Name Visibility Description
BuildRawResult protected Builds a raw output result when structured JSON cannot be parsed.
(Inherited from TGIS_AIModel)
BuildScript protected Builds the Python script that executes the model for the specified input image.
(Overrides TGIS_AIModel.BuildScript)
GetRequiredModules protected Gets the list of Python modules required by the model.
(Overrides TGIS_AIModel.GetRequiredModules)
InstallModules public Installs the Python modules required by the model.
(Inherited from TGIS_AIModel)
RequirePython protected Ensures that the Python environment is available and ready to run.
(Inherited from TGIS_AIModel)
Run public Runs the model for the specified input image.
(Inherited from TGIS_AIModel)
SetRequiredModules public Sets the list of required Python modules for this custom AI model.
SetScriptTemplate public Sets the Python script template and placeholder tokens used to build runnable scripts.
TryExtractJsonObject protected Tries to extract a JSON object text from arbitrary output text.
(Inherited from TGIS_AIModel)
UninstallModules public Uninstalls the Python modules required by the model.
(Inherited from TGIS_AIModel)

Properties

Inherited Protected
Name Visibility Description
ImagePlaceholder public Placeholder token used for image path.
LastError public Last captured standard error output.
(Inherited from TGIS_AIModel)
LastOutput public Last captured standard output.
(Inherited from TGIS_AIModel)
LastResult public Last parsed model result.
(Inherited from TGIS_AIModel)
ModelName public Model display name.
ModelPath public Model path used by the implementation.
(Inherited from TGIS_AIModel)
ModelPlaceholder public Placeholder token used for model path.
Python public Python manager used to execute scripts.
(Inherited from TGIS_AIModel)
ScriptTemplate public Python script template text used to build runnable scripts for the custom AI model.

Remarks

PURPOSE: Provides a flexible AI model wrapper for custom inference workflows where execution logic is supplied as a Python script template instead of being hardcoded in the DK11 class.

BEHAVIOR: The class stores model metadata, required Python modules, and placeholder tokens, then builds runnable script text by replacing model and image path placeholders in the template.

CONSTRAINTS: Execution depends on a valid Python environment provided by TGIS_AIPythonManager. Script generation requires matching placeholder tokens in the template text.

References

2026/07/11 00:20

Page Tools