Class AiOperationsWrapper

java.lang.Object
com.aispect.core.engine.runtime.context.AiOperationsWrapper
All Implemented Interfaces:
AiOperations

public class AiOperationsWrapper extends Object implements AiOperations
AiOperations wrapper, belongs torunning phase (Runtime)Responsibilities.

When calling a method, if Agent Configured on the annotation modelName, then inject the model name into subsequent AI Calling, Implement method-level model overrides without modifying the original AiOperations accomplish.

  • Constructor Details

    • AiOperationsWrapper

      public AiOperationsWrapper(AiOperations delegate, String modelName)
  • Method Details

    • prompt

      public Response prompt(String overrideModel, String agentName, PromptContext context) throws AiSpectException
      Description copied from interface: AiOperations
      Manually initiate a synchronization AI Prompt word call with model name override.
      Specified by:
      prompt in interface AiOperations
      Parameters:
      overrideModel - Preferred model name (overrides global default configuration)
      agentName - Agentname
      context - Prompt context for this request
      Returns:
      return AI Non-streaming response results for the model
      Throws:
      AiSpectException - Any exception during model call
    • promptStream

      public Stream<Response> promptStream(String overrideModel, String agentName, PromptContext context) throws AiSpectException
      Description copied from interface: AiOperations
      Manually initiate a streaming AI Prompt word call with model name override.
      Specified by:
      promptStream in interface AiOperations
      Parameters:
      overrideModel - Preferred model name (overrides global default configuration)
      agentName - Agentname
      context - Prompt context for this request
      Returns:
      Return response stream
      Throws:
      AiSpectException - Any exception during model call
    • getClient

      public AiClient getClient()
      Description copied from interface: AiOperations
      Expose underlying bindings AiClient Client adapter instance.

      For advanced developers to directly perform some platform-specific high-level API operations (such as model-specific fine-tuning request, etc.).

      Specified by:
      getClient in interface AiOperations
      Returns:
      Unified adaptation client injected by the bottom layer