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:
@@ -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{}{
|
||||
|
||||
Reference in New Issue
Block a user