For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Classification Cache

To speed up the classification of an input file against many template forms, the SDK provides a way to create a cache data that will be used if present to classify the correct template fast.

      var templatesFolder = "./templates"; 

      using TemplatesCollection templates = new TemplatesCollection.Builder() 
            .FromSourceFolder(templatesFolder) 
            .Build(); 

      using TemplatesCollectionCache cache = new TemplatesCollectionCache.Builder() 
            .SetTemplatesSource(templates) 
            .SetRuntimeFolder("./runtimes") 
            .SetLicense(["", ""]) 
            .Build(); 

      Result<BuildCacheResult> result = cache.Build(); 
      String templatesFolder = "./templates";
      String[] license = new String[2]; 
      license[0] = "";
      license[1] = "";

      TemplatesCollection templates = new TemplatesCollection.Builder() 
            .fromSourceFolder(templatesFolder) 
            .build(); 

      TemplatesCollectionCache cache = new TemplatesCollectionCache.Builder() 
            .setTemplatesSource(templates) 
            .setRuntimeFolder("./runtimes") 
            .setLicense(license) 
            .build(); 

      Result<BuildCacheResult> result = cache.build(null);
      
      result.dispose();
      cache.dispose();
      templates.dispose();

Last updated

Was this helpful?