简体中文 | English
SDK Core is the provider-neutral Java API published as run.halo.aifoundation:api. Consumer
plugins depend on this module; Halo administrators choose providers, models, capabilities, and
parameter mappings.
modelName always means AiModel.metadata.name, not a provider type or provider-side model ID.
- Getting started
- Generating and streaming text
- Structured output
- Tools and multi-step generation
- Embeddings, reranking, and RAG
- Image generation
- Middleware, step control, and lifecycle
- Error handling
- Complete public API index
| Need | Main types |
|---|---|
| Resolve a model | AiModelService |
| Generate text | LanguageModel, GenerateTextRequest, GenerateTextResult |
| Stream text | StreamTextResult, TextStreamPart |
| Structured output | OutputSpec, JsonSchema, StructuredSchema |
| Tools | ToolDefinition, ToolChoice, StopCondition, PreparedStep |
| Embeddings | EmbeddingModel, EmbeddingRequest, EmbeddingUtils |
| Reranking and RAG | RerankingModel, RagMiddlewares, RagMiddlewareOptions |
| Images | ImageGenerationModel, GenerateImageRequest, GeneratedFile |
| Request control | CancellationSource, GenerationTimeouts, lifecycle APIs |
| Browser stream bridge | UIMessageChatHandlers, UIMessageStreamResponse |
The API is reactive: completed values normally use Mono<T> and event streams use Flux<T>.
Preserve responseMessages when continuing a conversation or tool loop, and treat model
capabilities and warnings as runtime data.
Return to the developer documentation.