Skip to content

Commit 98a227d

Browse files
feat(devops): use golang code in debug input
1 parent 0b9e851 commit 98a227d

File tree

8 files changed

+901
-31
lines changed

8 files changed

+901
-31
lines changed

devops/internal/apihandler/debug.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func StreamDebugRun(res http.ResponseWriter, req *http.Request) {
136136
FromNode: rs.FromNode,
137137
}
138138

139-
debugID, stateCh, errCh, err := service.DebugSVC.DebugRun(ctx, m, rs.Input)
139+
debugID, stateCh, errCh, err := service.DebugSVC.DebugRun(ctx, m, rs.Input, rs.InputFormat)
140140
if err != nil {
141141
log.Errorf(err.Error())
142142
return

devops/internal/apihandler/types/debug.go

+11-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ type CreateDebugThreadResponse struct {
3232
}
3333

3434
type DebugRunRequest struct {
35-
FromNode string `json:"from_node"`
36-
Input string `json:"input"` // mock input data after json marshal
37-
LogID string `json:"log_id"`
35+
FromNode string `json:"from_node"`
36+
Input string `json:"input"` // mock input data after json marshal
37+
LogID string `json:"log_id"`
38+
InputFormat InputFormat `json:"input_format"`
3839
}
3940

4041
type DebugRunEventType string
@@ -114,3 +115,10 @@ func (d DebugRunEventMsg) JsonBytes() []byte {
114115
type ListInputTypesResponse struct {
115116
Types []*devmodel.JsonSchema `json:"types,omitempty"`
116117
}
118+
119+
type InputFormat int
120+
121+
const (
122+
InputFormatOfJson InputFormat = 0
123+
InputFormatOfCode InputFormat = 1
124+
)

devops/internal/mock/container_mock.go

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

devops/internal/mock/debug_run_mock.go

+5-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)