Provider Development
Overview
Learn how to develop custom model provider plugins.
Development Steps
1. Create Maven Module
xml
<project>
<groupId>com.astrsomn</groupId>
<artifactId>astrsomn-provider-custom</artifactId>
<version>0.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.astrsomn</groupId>
<artifactId>astrsomn-api-runtime</artifactId>
<version>${astrsomn.version}</version>
</dependency>
</dependencies>
</project>2. Implement ModelProviderHandler
java
public class CustomProviderHandler implements ModelProviderHandler {
@Override
public String getProvider() {
return "CUSTOM";
}
@Override
public void init(Map<String, Object> config) {
// Initialize
}
@Override
public String chat(String model, String message, List<Message> history) {
// Implementation
return "";
}
}3. Configure SPI
Create META-INF/services/com.astrsomn.api.runtime.model.ModelProviderHandler:
com.astrsomn.provider.custom.CustomProviderHandlerRelated Documentation
- Interface Guide - API interface specifications
- Examples - Complete examples