java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<VllmActor>
com.scivicslab.turingworkflow.workflow.IIActorRef<VllmActor>
com.scivicslab.turingworkflow.plugins.kanakanji.VllmActor
All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName, AutoCloseable

public class VllmActor extends com.scivicslab.turingworkflow.workflow.IIActorRef<VllmActor>
Actor that calls a vLLM server via OpenAI-compatible chat completions API.

Provides two-step kana-kanji pair generation:

  1. segment - Step 1: merge OCR fragments into bunsetsu-segmented sentences
  2. toHiragana - Step 2: convert bunsetsu-segmented kanji text to hiragana

Supported actions:

  • setUrl - Set the vLLM endpoint URL
  • setModel - Set the model name
  • segment - Step 1: segment OCR text into bunsetsu
  • toHiragana - Step 2: convert segmented text to hiragana
  • Field Summary

    Fields inherited from class com.scivicslab.pojoactor.core.ActorRef

    actorName, actorSystem, object
  • Constructor Summary

    Constructors
    Constructor
    Description
    VllmActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.scivicslab.pojoactor.core.ActionResult
    segment(String ocrText)
    Step 1: Send OCR text to LLM for bunsetsu segmentation.
    com.scivicslab.pojoactor.core.ActionResult
    setModel(String modelName)
     
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
    toHiragana(String segmentedText)
    Step 2: Convert bunsetsu-segmented kanji text to hiragana/kanji pairs.

    Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef

    callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgument

    Methods inherited from class com.scivicslab.pojoactor.core.ActorRef

    ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, expandVariables, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getLastResult, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setLastResult, setParentName, system, tell, tell, tellNow, toStringOfJson, toStringOfYaml

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VllmActor

      public VllmActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
  • Method Details

    • setUrl

      public com.scivicslab.pojoactor.core.ActionResult setUrl(String url)
    • setModel

      public com.scivicslab.pojoactor.core.ActionResult setModel(String modelName)
    • segment

      public com.scivicslab.pojoactor.core.ActionResult segment(String ocrText)
      Step 1: Send OCR text to LLM for bunsetsu segmentation. Returns the segmented kanji text (one sentence per line, bunsetsu separated by |).
    • toHiragana

      public com.scivicslab.pojoactor.core.ActionResult toHiragana(String segmentedText)
      Step 2: Convert bunsetsu-segmented kanji text to hiragana/kanji pairs.

      Processes input in batches of 20 lines. For each batch, validates that lines containing Japanese have hiragana readings. Lines that fail validation are retried individually (up to 2 times). Purely ASCII/numeric lines require no hiragana and are passed through.

      Returns:
      tab-separated hiragana-kanji pairs, one per line