Package com.aispect.api
Interface AiOperations
- All Known Implementing Classes:
AiOperationsWrapper
public interface AiOperations
Exposed to developers for manual control AI Interactive basic service facade interface.
Although the framework mainly promotes the use of annotations and AOP Perform non-intrusive programming, but in some scenarios (such as inside the orchestrator, in customized code), developers still need to directly call the underlying LLM Or get the client currently mounted on the system, At this time, you can operate through this interface.
-
Method Summary
Modifier and TypeMethodDescriptionExpose underlying bindingsAiClientClient adapter instance.default Responseprompt(PromptContext context) Manually initiate a synchronization AI Prompt word call.default Responseprompt(String agentName, PromptContext context) Manually initiate a synchronization AI Prompt word call with Agent Name so that the underlying layer can configure routing.prompt(String modelName, String agentName, PromptContext context) Manually initiate a synchronization AI Prompt word call with model name override.promptStream(PromptContext context) Manually initiate a streaming AI Prompt word call.promptStream(String agentName, PromptContext context) Manually initiate a streaming AI Prompt word call with Agent Name so that the underlying layer can configure routing.promptStream(String modelName, String agentName, PromptContext context) Manually initiate a streaming AI Prompt word call with model name override.
-
Method Details
-
prompt
Manually initiate a synchronization AI Prompt word call with model name override.- Parameters:
modelName- Preferred model name (overrides global default configuration)agentName- Agentnamecontext- Prompt context for this request- Returns:
- return AI Non-streaming response results for the model
- Throws:
AiSpectException- Any exception during model call
-
prompt
Manually initiate a synchronization AI Prompt word call.- Parameters:
context- Prompt context for this request- Returns:
- return AI Non-streaming response results for the model
- Throws:
AiSpectException- Any exception during model call
-
prompt
Manually initiate a synchronization AI Prompt word call with Agent Name so that the underlying layer can configure routing.- Parameters:
agentName- Agentnamecontext- Prompt context for this request- Returns:
- return AI Non-streaming response results for the model
- Throws:
AiSpectException- Any exception during model call
-
promptStream
Stream<Response> promptStream(String modelName, String agentName, PromptContext context) throws AiSpectException Manually initiate a streaming AI Prompt word call with model name override.- Parameters:
modelName- Preferred model name (overrides global default configuration)agentName- Agentnamecontext- Prompt context for this request- Returns:
- Return response stream
- Throws:
AiSpectException- Any exception during model call
-
promptStream
Manually initiate a streaming AI Prompt word call.- Parameters:
context- Prompt context for this request- Returns:
- Returns the response stream, which will be automatically closed when all is generated.
- Throws:
AiSpectException- Any exception during model call
-
promptStream
default Stream<Response> promptStream(String agentName, PromptContext context) throws AiSpectException Manually initiate a streaming AI Prompt word call with Agent Name so that the underlying layer can configure routing.- Parameters:
agentName- Agentnamecontext- Prompt context for this request- Returns:
- Returns the response stream, which will be automatically closed when all is generated.
- Throws:
AiSpectException- Any exception during model call
-
getClient
AiClient getClient()Expose underlying bindingsAiClientClient adapter instance.For advanced developers to directly perform some platform-specific high-level API operations (such as model-specific fine-tuning request, etc.).
- Returns:
- Unified adaptation client injected by the bottom layer
-