feat: Enhance agent functionality with ModelProfile integration
- Added ModelProfile to the Agent record to allow for more detailed model configurations. - Updated AgentExecutorService to utilize ModelProfile when fetching clients. - Modified BaseAgent interface to include a default modelProfile method. - Adjusted Client interface and implementations to support ModelProfile in conversation and streaming methods. - Enhanced ClientService to retrieve clients based on ModelProfile. - Updated CompletionInterceptor to work with ModelProfile instead of ModelCategory. - Refactored AzureAiClient and other client implementations to handle ModelProfile correctly. - Changed CachedClient to cache responses based on ModelProfile. - Updated ModelCategory to a record type for better validation and immutability. - Enhanced ModelProfile with validation checks for its fields. - Updated ModelProfileService to support fetching profiles based on ModelCategory. - Adjusted tests to accommodate changes in Agent and ModelProfile. - Updated properties files to include category information for model profiles.
This commit is contained in:
@@ -6,10 +6,12 @@ import java.util.function.Function;
|
||||
|
||||
import de.extio.lmlib.agent.responsehandler.AgentResponseHandler;
|
||||
import de.extio.lmlib.profile.ModelCategory;
|
||||
import de.extio.lmlib.profile.ModelProfile;
|
||||
|
||||
public record Agent(String name,
|
||||
AgentType agentType,
|
||||
ModelCategory modelCategory,
|
||||
ModelProfile modelProfile,
|
||||
String systemPrompt,
|
||||
String textTemplate,
|
||||
AgentResponseHandler responseHandler,
|
||||
@@ -44,6 +46,14 @@ public record Agent(String name,
|
||||
return BaseAgent.super.modelCategory(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelProfile modelProfile(final AgentContext context) {
|
||||
if (modelProfile != null) {
|
||||
return modelProfile;
|
||||
}
|
||||
return BaseAgent.super.modelProfile(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preProcess(final AgentContext context) {
|
||||
if (preProcessor != null) {
|
||||
|
||||
Reference in New Issue
Block a user