feat(weknoracloud): implement WeKnoraCloud VLM integration

- Added WeKnoraCloudVLM struct to handle interactions with the WeKnoraCloud API, including image and text processing capabilities.
- Enhanced model configuration to include AppID and AppSecret for secure API access.
- Updated modelService to resolve WeKnoraCloud credentials and pass them to the VLM configuration.
- Implemented Predict method for sending requests to the WeKnoraCloud API and processing responses.

This update introduces a new integration with WeKnoraCloud, expanding the application's capabilities in handling multimedia content.
This commit is contained in:
wizardchen
2026-04-15 14:55:10 +08:00
committed by lyingbug
parent 3fcfa89062
commit 9ba8582f70
3 changed files with 200 additions and 0 deletions
+4
View File
@@ -510,6 +510,8 @@ func (s *modelService) GetVLMModel(ctx context.Context, modelId string) (vlm.VLM
}
}
appID, appSecret := s.resolveWeKnoraCloudCredentials(ctx, &model.Parameters)
vlmModel, err := vlm.NewVLM(&vlm.Config{
ModelID: model.ID,
APIKey: model.Parameters.APIKey,
@@ -519,6 +521,8 @@ func (s *modelService) GetVLMModel(ctx context.Context, modelId string) (vlm.VLM
InterfaceType: ifType,
Provider: model.Parameters.Provider,
Extra: stringMapToAnyMap(model.Parameters.ExtraConfig),
AppID: appID,
AppSecret: appSecret,
}, s.ollamaService)
if err != nil {
logger.ErrorWithFields(ctx, err, map[string]interface{}{