diff --git a/api/app/kafeido/proto/go-openapiv2/client/kafeido_service/kafeido_service_create_prediction_responses.go b/api/app/kafeido/proto/go-openapiv2/client/kafeido_service/kafeido_service_create_prediction_responses.go index 186aebc..5b5b580 100644 --- a/api/app/kafeido/proto/go-openapiv2/client/kafeido_service/kafeido_service_create_prediction_responses.go +++ b/api/app/kafeido/proto/go-openapiv2/client/kafeido_service/kafeido_service_create_prediction_responses.go @@ -205,6 +205,9 @@ type KafeidoServiceCreatePredictionBody struct { // image requests ImageRequests []*models.KafeidoPredictImageRequestBody `json:"imageRequests"` + // multimodal requests + MultimodalRequests []*models.KafeidoPredictMultiModalRequestBody `json:"multimodalRequests"` + // timeout Timeout string `json:"timeout,omitempty"` @@ -224,6 +227,10 @@ func (o *KafeidoServiceCreatePredictionBody) Validate(formats strfmt.Registry) e res = append(res, err) } + if err := o.validateMultimodalRequests(formats); err != nil { + res = append(res, err) + } + if err := o.validateType(formats); err != nil { res = append(res, err) } @@ -286,6 +293,32 @@ func (o *KafeidoServiceCreatePredictionBody) validateImageRequests(formats strfm return nil } +func (o *KafeidoServiceCreatePredictionBody) validateMultimodalRequests(formats strfmt.Registry) error { + if swag.IsZero(o.MultimodalRequests) { // not required + return nil + } + + for i := 0; i < len(o.MultimodalRequests); i++ { + if swag.IsZero(o.MultimodalRequests[i]) { // not required + continue + } + + if o.MultimodalRequests[i] != nil { + if err := o.MultimodalRequests[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "multimodalRequests" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "multimodalRequests" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (o *KafeidoServiceCreatePredictionBody) validateType(formats strfmt.Registry) error { if swag.IsZero(o.Type) { // not required return nil @@ -317,6 +350,10 @@ func (o *KafeidoServiceCreatePredictionBody) ContextValidate(ctx context.Context res = append(res, err) } + if err := o.contextValidateMultimodalRequests(ctx, formats); err != nil { + res = append(res, err) + } + if err := o.contextValidateType(ctx, formats); err != nil { res = append(res, err) } @@ -377,6 +414,31 @@ func (o *KafeidoServiceCreatePredictionBody) contextValidateImageRequests(ctx co return nil } +func (o *KafeidoServiceCreatePredictionBody) contextValidateMultimodalRequests(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.MultimodalRequests); i++ { + + if o.MultimodalRequests[i] != nil { + + if swag.IsZero(o.MultimodalRequests[i]) { // not required + return nil + } + + if err := o.MultimodalRequests[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "multimodalRequests" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "multimodalRequests" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (o *KafeidoServiceCreatePredictionBody) contextValidateType(ctx context.Context, formats strfmt.Registry) error { if o.Type != nil { diff --git a/api/app/kafeido/proto/go-openapiv2/models/kafeido_create_prediction_response.go b/api/app/kafeido/proto/go-openapiv2/models/kafeido_create_prediction_response.go index 5a54e7c..5af2e5c 100644 --- a/api/app/kafeido/proto/go-openapiv2/models/kafeido_create_prediction_response.go +++ b/api/app/kafeido/proto/go-openapiv2/models/kafeido_create_prediction_response.go @@ -24,6 +24,12 @@ type KafeidoCreatePredictionResponse struct { // image responses ImageResponses []*KafeidoPredictImageResponseBody `json:"imageResponses"` + + // multimodal responses + MultimodalResponses []*KafeidoPredictMultiModalResponseBody `json:"multimodalResponses"` + + // text responses + TextResponses []*KafeidoPredictTextResponseBody `json:"textResponses"` } // Validate validates this kafeido create prediction response @@ -38,6 +44,14 @@ func (m *KafeidoCreatePredictionResponse) Validate(formats strfmt.Registry) erro res = append(res, err) } + if err := m.validateMultimodalResponses(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTextResponses(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -96,6 +110,58 @@ func (m *KafeidoCreatePredictionResponse) validateImageResponses(formats strfmt. return nil } +func (m *KafeidoCreatePredictionResponse) validateMultimodalResponses(formats strfmt.Registry) error { + if swag.IsZero(m.MultimodalResponses) { // not required + return nil + } + + for i := 0; i < len(m.MultimodalResponses); i++ { + if swag.IsZero(m.MultimodalResponses[i]) { // not required + continue + } + + if m.MultimodalResponses[i] != nil { + if err := m.MultimodalResponses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("multimodalResponses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("multimodalResponses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *KafeidoCreatePredictionResponse) validateTextResponses(formats strfmt.Registry) error { + if swag.IsZero(m.TextResponses) { // not required + return nil + } + + for i := 0; i < len(m.TextResponses); i++ { + if swag.IsZero(m.TextResponses[i]) { // not required + continue + } + + if m.TextResponses[i] != nil { + if err := m.TextResponses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("textResponses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("textResponses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // ContextValidate validate this kafeido create prediction response based on the context it is used func (m *KafeidoCreatePredictionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -108,6 +174,14 @@ func (m *KafeidoCreatePredictionResponse) ContextValidate(ctx context.Context, f res = append(res, err) } + if err := m.contextValidateMultimodalResponses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTextResponses(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -164,6 +238,56 @@ func (m *KafeidoCreatePredictionResponse) contextValidateImageResponses(ctx cont return nil } +func (m *KafeidoCreatePredictionResponse) contextValidateMultimodalResponses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MultimodalResponses); i++ { + + if m.MultimodalResponses[i] != nil { + + if swag.IsZero(m.MultimodalResponses[i]) { // not required + return nil + } + + if err := m.MultimodalResponses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("multimodalResponses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("multimodalResponses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *KafeidoCreatePredictionResponse) contextValidateTextResponses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TextResponses); i++ { + + if m.TextResponses[i] != nil { + + if swag.IsZero(m.TextResponses[i]) { // not required + return nil + } + + if err := m.TextResponses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("textResponses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("textResponses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *KafeidoCreatePredictionResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_multi_modal_request_body.go b/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_multi_modal_request_body.go new file mode 100644 index 0000000..1460be8 --- /dev/null +++ b/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_multi_modal_request_body.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// KafeidoPredictMultiModalRequestBody kafeido predict multi modal request body +// +// swagger:model kafeidoPredictMultiModalRequestBody +type KafeidoPredictMultiModalRequestBody struct { + + // audio bytes + AudioBytes *KafeidoRequestInBytes `json:"audioBytes,omitempty"` + + // image bytes + ImageBytes *KafeidoRequestInBytes `json:"imageBytes,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // text + Text string `json:"text,omitempty"` +} + +// Validate validates this kafeido predict multi modal request body +func (m *KafeidoPredictMultiModalRequestBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAudioBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageBytes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KafeidoPredictMultiModalRequestBody) validateAudioBytes(formats strfmt.Registry) error { + if swag.IsZero(m.AudioBytes) { // not required + return nil + } + + if m.AudioBytes != nil { + if err := m.AudioBytes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("audioBytes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("audioBytes") + } + return err + } + } + + return nil +} + +func (m *KafeidoPredictMultiModalRequestBody) validateImageBytes(formats strfmt.Registry) error { + if swag.IsZero(m.ImageBytes) { // not required + return nil + } + + if m.ImageBytes != nil { + if err := m.ImageBytes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("imageBytes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("imageBytes") + } + return err + } + } + + return nil +} + +// ContextValidate validate this kafeido predict multi modal request body based on the context it is used +func (m *KafeidoPredictMultiModalRequestBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAudioBytes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImageBytes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KafeidoPredictMultiModalRequestBody) contextValidateAudioBytes(ctx context.Context, formats strfmt.Registry) error { + + if m.AudioBytes != nil { + + if swag.IsZero(m.AudioBytes) { // not required + return nil + } + + if err := m.AudioBytes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("audioBytes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("audioBytes") + } + return err + } + } + + return nil +} + +func (m *KafeidoPredictMultiModalRequestBody) contextValidateImageBytes(ctx context.Context, formats strfmt.Registry) error { + + if m.ImageBytes != nil { + + if swag.IsZero(m.ImageBytes) { // not required + return nil + } + + if err := m.ImageBytes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("imageBytes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("imageBytes") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *KafeidoPredictMultiModalRequestBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *KafeidoPredictMultiModalRequestBody) UnmarshalBinary(b []byte) error { + var res KafeidoPredictMultiModalRequestBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_multi_modal_response_body.go b/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_multi_modal_response_body.go new file mode 100644 index 0000000..be0f003 --- /dev/null +++ b/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_multi_modal_response_body.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// KafeidoPredictMultiModalResponseBody kafeido predict multi modal response body +// +// swagger:model kafeidoPredictMultiModalResponseBody +type KafeidoPredictMultiModalResponseBody struct { + + // key + Key string `json:"key,omitempty"` + + // prediction + Prediction *KafeidoResponseInJSON `json:"prediction,omitempty"` +} + +// Validate validates this kafeido predict multi modal response body +func (m *KafeidoPredictMultiModalResponseBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrediction(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KafeidoPredictMultiModalResponseBody) validatePrediction(formats strfmt.Registry) error { + if swag.IsZero(m.Prediction) { // not required + return nil + } + + if m.Prediction != nil { + if err := m.Prediction.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prediction") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prediction") + } + return err + } + } + + return nil +} + +// ContextValidate validate this kafeido predict multi modal response body based on the context it is used +func (m *KafeidoPredictMultiModalResponseBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePrediction(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KafeidoPredictMultiModalResponseBody) contextValidatePrediction(ctx context.Context, formats strfmt.Registry) error { + + if m.Prediction != nil { + + if swag.IsZero(m.Prediction) { // not required + return nil + } + + if err := m.Prediction.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prediction") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prediction") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *KafeidoPredictMultiModalResponseBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *KafeidoPredictMultiModalResponseBody) UnmarshalBinary(b []byte) error { + var res KafeidoPredictMultiModalResponseBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_text_response_body.go b/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_text_response_body.go new file mode 100644 index 0000000..96afabc --- /dev/null +++ b/api/app/kafeido/proto/go-openapiv2/models/kafeido_predict_text_response_body.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// KafeidoPredictTextResponseBody kafeido predict text response body +// +// swagger:model kafeidoPredictTextResponseBody +type KafeidoPredictTextResponseBody struct { + + // key + Key string `json:"key,omitempty"` + + // prediction + Prediction *KafeidoResponseInJSON `json:"prediction,omitempty"` +} + +// Validate validates this kafeido predict text response body +func (m *KafeidoPredictTextResponseBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrediction(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KafeidoPredictTextResponseBody) validatePrediction(formats strfmt.Registry) error { + if swag.IsZero(m.Prediction) { // not required + return nil + } + + if m.Prediction != nil { + if err := m.Prediction.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prediction") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prediction") + } + return err + } + } + + return nil +} + +// ContextValidate validate this kafeido predict text response body based on the context it is used +func (m *KafeidoPredictTextResponseBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePrediction(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KafeidoPredictTextResponseBody) contextValidatePrediction(ctx context.Context, formats strfmt.Registry) error { + + if m.Prediction != nil { + + if swag.IsZero(m.Prediction) { // not required + return nil + } + + if err := m.Prediction.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prediction") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prediction") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *KafeidoPredictTextResponseBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *KafeidoPredictTextResponseBody) UnmarshalBinary(b []byte) error { + var res KafeidoPredictTextResponseBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/app/kafeido/proto/go-openapiv2/models/kafeido_type_prediction_data.go b/api/app/kafeido/proto/go-openapiv2/models/kafeido_type_prediction_data.go index 28c7fd8..44e1477 100644 --- a/api/app/kafeido/proto/go-openapiv2/models/kafeido_type_prediction_data.go +++ b/api/app/kafeido/proto/go-openapiv2/models/kafeido_type_prediction_data.go @@ -38,6 +38,12 @@ const ( // KafeidoTypePredictionDataTYPEPREDICTIONDATAAUDIO captures enum value "TYPE_PREDICTION_DATA_AUDIO" KafeidoTypePredictionDataTYPEPREDICTIONDATAAUDIO KafeidoTypePredictionData = "TYPE_PREDICTION_DATA_AUDIO" + + // KafeidoTypePredictionDataTYPEPREDICTIONDATATEXT captures enum value "TYPE_PREDICTION_DATA_TEXT" + KafeidoTypePredictionDataTYPEPREDICTIONDATATEXT KafeidoTypePredictionData = "TYPE_PREDICTION_DATA_TEXT" + + // KafeidoTypePredictionDataTYPEPREDICTIONDATAMULTIMODAL captures enum value "TYPE_PREDICTION_DATA_MULTIMODAL" + KafeidoTypePredictionDataTYPEPREDICTIONDATAMULTIMODAL KafeidoTypePredictionData = "TYPE_PREDICTION_DATA_MULTIMODAL" ) // for schema @@ -45,7 +51,7 @@ var kafeidoTypePredictionDataEnum []interface{} func init() { var res []KafeidoTypePredictionData - if err := json.Unmarshal([]byte(`["TYPE_PREDICTION_DATA_UNSPECIFIED","TYPE_PREDICTION_DATA_PHOTO","TYPE_PREDICTION_DATA_AUDIO"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["TYPE_PREDICTION_DATA_UNSPECIFIED","TYPE_PREDICTION_DATA_PHOTO","TYPE_PREDICTION_DATA_AUDIO","TYPE_PREDICTION_DATA_TEXT","TYPE_PREDICTION_DATA_MULTIMODAL"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/app/kafeido/cli/cmd/res_prediction.go b/app/kafeido/cli/cmd/res_prediction.go index b0948a2..6b407a3 100644 --- a/app/kafeido/cli/cmd/res_prediction.go +++ b/app/kafeido/cli/cmd/res_prediction.go @@ -8,6 +8,8 @@ import ( "path/filepath" "time" + "github.com/google/uuid" + appservice "github.com/footprintai/grandturks-client/v2/api/app/kafeido/proto/go-openapiv2/client/kafeido_service" appmodels "github.com/footprintai/grandturks-client/v2/api/app/kafeido/proto/go-openapiv2/models" pkgio "github.com/footprintai/grandturks-client/v2/pkg/io" @@ -23,6 +25,7 @@ func NewCreatePredictionCommand(logger log.Logger, ioStreams genericclioptions.I queryFile string queryLang string queryType string + queryText string ) handler := func() error { @@ -43,7 +46,7 @@ func NewCreatePredictionCommand(logger log.Logger, ioStreams genericclioptions.I if queryType == "image" { params.Body.Type = appmodels.KafeidoTypePredictionDataTYPEPREDICTIONDATAPHOTO.Pointer() params.Body.ImageRequests = []*appmodels.KafeidoPredictImageRequestBody{ - &appmodels.KafeidoPredictImageRequestBody{ + { Key: filepath.Base(queryFile), ImageBytes: &appmodels.KafeidoRequestInBytes{ B64: pkgio.MustReadAll2Base64(rc), @@ -53,7 +56,7 @@ func NewCreatePredictionCommand(logger log.Logger, ioStreams genericclioptions.I } else if queryType == "audio" { params.Body.Type = appmodels.KafeidoTypePredictionDataTYPEPREDICTIONDATAAUDIO.Pointer() params.Body.AudioRequests = []*appmodels.KafeidoPredictAudioRequestBody{ - &appmodels.KafeidoPredictAudioRequestBody{ + { Key: filepath.Base(queryFile), Lang: []string{queryLang}, AudioBytes: &appmodels.KafeidoRequestInBytes{ @@ -61,6 +64,17 @@ func NewCreatePredictionCommand(logger log.Logger, ioStreams genericclioptions.I }, }, } + } else if queryType == "multimodal" { + params.Body.Type = appmodels.KafeidoTypePredictionDataTYPEPREDICTIONDATAMULTIMODAL.Pointer() + params.Body.MultimodalRequests = []*appmodels.KafeidoPredictMultiModalRequestBody{ + { + Key: uuid.NewString(), + ImageBytes: &appmodels.KafeidoRequestInBytes{ + B64: pkgio.MustReadAll2Base64(rc), + }, + Text: queryText, + }, + } } started := time.Now() kafeidoCreatePredictionOk, err := runCmd.stub.KafeidoService.KafeidoServiceCreatePrediction( @@ -98,8 +112,9 @@ func NewCreatePredictionCommand(logger log.Logger, ioStreams genericclioptions.I cmd.Flags().StringVar(&projectId, "project_id", "", "project Id") cmd.Flags().StringVar(&modelInferenceId, "inference_id", "", "inference id") cmd.Flags().StringVar(&queryFile, "query_file", "", "query file path") - cmd.Flags().StringVar(&queryType, "query_type", "image", "query type: image or audio (default: image") + cmd.Flags().StringVar(&queryType, "query_type", "image", "query type: image or audio or multimodal (default: image") cmd.Flags().StringVar(&queryLang, "query_lang", "en", "query lang: en or zh(default: en") + cmd.Flags().StringVar(&queryText, "query_text", "", "query text") cmd.MarkFlagRequired("project_id") cmd.MarkFlagRequired("inference_id") cmd.MarkFlagRequired("query_type") diff --git a/pkg/version/version.go b/pkg/version/version.go index 5c339ec..b3e6252 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -9,7 +9,7 @@ import ( var ( BuildTime = "" - version, _ = goversion.NewVersion("2.2.1") + version, _ = goversion.NewVersion("2.3.0") ) func GreatThan(v1, v2 string) bool {