fix: [ML-648]: Add error to generate output structs (#3397)

* fix test
* pointer to message
* Add error to generate output structs
This commit is contained in:
Yogesh Chauhan 2025-02-10 11:42:43 +00:00 committed by Harness
parent cee3efb886
commit d2a2c2c361
4 changed files with 11 additions and 9 deletions

View File

@ -27,7 +27,7 @@ type Suggestion struct {
type Conversation struct {
Role enum.Role `json:"role"`
Message Message `json:"message"`
Message *Message `json:"message"`
}
type Message struct {

View File

@ -47,7 +47,7 @@ func TestSanitizeConversation(t *testing.T) {
conversations: []types.Conversation{
{
Role: enum.RoleUser,
Message: types.Message{
Message: &types.Message{
Type: enum.TypeText,
Data: "data",
},
@ -62,7 +62,7 @@ func TestSanitizeConversation(t *testing.T) {
conversations: []types.Conversation{
{
Role: "",
Message: types.Message{
Message: &types.Message{
Type: enum.TypeText,
Data: "data",
},
@ -77,7 +77,7 @@ func TestSanitizeConversation(t *testing.T) {
conversations: []types.Conversation{
{
Role: "invalidRole",
Message: types.Message{
Message: &types.Message{
Type: enum.TypeText,
Data: "data",
},
@ -93,7 +93,7 @@ func TestSanitizeConversation(t *testing.T) {
conversations: []types.Conversation{
{
Role: enum.RoleUser,
Message: types.Message{
Message: &types.Message{
Type: "",
Data: "data",
},
@ -108,7 +108,7 @@ func TestSanitizeConversation(t *testing.T) {
conversations: []types.Conversation{
{
Role: enum.RoleUser,
Message: types.Message{
Message: &types.Message{
Type: "invalidMessageType",
Data: "data",
},
@ -124,7 +124,7 @@ func TestSanitizeConversation(t *testing.T) {
conversations: []types.Conversation{
{
Role: enum.RoleUser,
Message: types.Message{
Message: &types.Message{
Type: enum.TypeText,
Data: "",
},

View File

@ -25,7 +25,8 @@ type PipelineStageGenerateRequest struct {
}
type PipelineStageGenerateResponse struct {
YAML string
YAML string
Error string
}
type PipelineStageUpdateRequest struct {

View File

@ -25,7 +25,8 @@ type PipelineStepGenerateRequest struct {
}
type PipelineStepGenerateResponse struct {
Yaml string
Yaml string
Error string
}
type PipelineStepUpdateRequest struct {