Skip to content

Commit 7f278f3

Browse files
kasarolzzwlsy357Coda-bot
authored
[feat][prompt] support associating labels with prompt version (#137)
--------- Co-authored-by: liushengyang <[email protected]> Co-authored-by: liushengyang <[email protected]> Co-authored-by: Coda <[email protected]>
1 parent 5f1b522 commit 7f278f3

File tree

82 files changed

+20279
-1667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+20279
-1667
lines changed

.github/.codecov.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ ignore:
5353
- "**/wire_gen.go"
5454
- "**/errno/**"
5555
- "**/main.go"
56+
- "**/repo/mysql/**"
57+
- "**/repo/redis/**"
5658

5759
parsers:
5860
gcov:

.github/workflows/backend-ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup Go
3232
uses: actions/setup-go@v5
3333
with:
34-
go-version: "1.23.4"
34+
go-version: "1.24.0"
3535

3636
- name: Golang Lint
3737
# https://golangci-lint.run/
@@ -58,7 +58,7 @@ jobs:
5858
- name: Setup Go
5959
uses: actions/setup-go@v5
6060
with:
61-
go-version: "1.23.4"
61+
go-version: "1.24.0"
6262

6363
- name: Build
6464
run: go build -v ./...

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ release/deployment/helm-chart/umbrella/Chart.lock
5151

5252
**/kitex_remote_config.json
5353
.coda/
54+
.cursor/

backend/api/handler/coze/loop/apis/prompt_manage_service.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/api/router/coze/loop/apis/coze.loop.apis.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/api/router/coze/loop/apis/middleware.go

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/coze-dev/coze-loop/backend
22

33
go 1.24.0
44

5-
toolchain go1.24.1
5+
toolchain go1.24.4
66

77
replace github.com/apache/thrift => github.com/apache/thrift v0.13.0
88

@@ -36,8 +36,8 @@ require (
3636
github.com/cloudwego/kitex v0.13.1
3737
github.com/coocood/freecache v1.2.4
3838
github.com/coreos/go-semver v0.3.0
39-
github.com/coze-dev/cozeloop-go v0.1.7
40-
github.com/coze-dev/cozeloop-go/spec v0.1.3
39+
github.com/coze-dev/cozeloop-go v0.1.9
40+
github.com/coze-dev/cozeloop-go/spec v0.1.4-0.20250829072213-3812ddbfb735
4141
github.com/deatil/go-encoding v1.0.3003
4242
github.com/dimchansky/utfbom v1.1.1
4343
github.com/dolthub/go-mysql-server v0.18.0

backend/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ github.com/coocood/freecache v1.2.4/go.mod h1:RBUWa/Cy+OHdfTGFEhEuE1pMCMX51Ncizj
249249
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
250250
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
251251
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
252-
github.com/coze-dev/cozeloop-go v0.1.7 h1:Y9AbLFLJdYWGPJJecWScSeW8W4kY38CLzBx0/ha/lZ4=
253-
github.com/coze-dev/cozeloop-go v0.1.7/go.mod h1:rhHtKT9D8wdqd+X1heP2A7zNyTohuA16ESv+rhEClbE=
254-
github.com/coze-dev/cozeloop-go/spec v0.1.3 h1:UXsykaQfBC+uMOJRQdgc0bv/SL3NOqOB+0H6OR3oMDw=
255-
github.com/coze-dev/cozeloop-go/spec v0.1.3/go.mod h1:/f3BrWehffwXIpd4b5rYIqktLd/v5dlLBw0h9F/LQIU=
252+
github.com/coze-dev/cozeloop-go v0.1.9 h1:4mb1x+uP0WNRG/safwWrOwm65T+qQsWOt+W8ZrZEFUU=
253+
github.com/coze-dev/cozeloop-go v0.1.9/go.mod h1:RMH0F6ZMwZm4ZL92IHLjTf4lmr8QHxYJVPCdz60ZbbI=
254+
github.com/coze-dev/cozeloop-go/spec v0.1.4-0.20250829072213-3812ddbfb735 h1:qxAwjHy0SLQazDO3oGJ8D24vOeM2Oz2+n27bNPegBls=
255+
github.com/coze-dev/cozeloop-go/spec v0.1.4-0.20250829072213-3812ddbfb735/go.mod h1:/f3BrWehffwXIpd4b5rYIqktLd/v5dlLBw0h9F/LQIU=
256256
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
257257
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
258258
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 h1:iwZdTE0PVqJCos1vaoKsclOGD3ADKpshg3SRtYBbwso=

backend/infra/looptracer/span.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,45 @@ func (s SpanImpl) SetCallType(callType string) {
128128
})
129129
}
130130

131+
func (s SpanImpl) SetServiceName(ctx context.Context, serviceName string) {
132+
s.LoopSpan.SetServiceName(ctx, serviceName)
133+
}
134+
135+
func (s SpanImpl) SetLogID(ctx context.Context, logID string) {
136+
s.LoopSpan.SetLogID(ctx, logID)
137+
}
138+
139+
func (s SpanImpl) SetFinishTime(finishTime time.Time) {
140+
s.LoopSpan.SetFinishTime(finishTime)
141+
}
142+
143+
func (s SpanImpl) SetSystemTags(ctx context.Context, systemTags map[string]interface{}) {
144+
s.LoopSpan.SetSystemTags(ctx, systemTags)
145+
}
146+
147+
func (s SpanImpl) SetDeploymentEnv(ctx context.Context, deploymentEnv string) {
148+
s.LoopSpan.SetDeploymentEnv(ctx, deploymentEnv)
149+
}
150+
131151
var _ Span = (*noopSpan)(nil)
132152

133153
type noopSpan struct{}
134154

155+
func (n noopSpan) SetServiceName(ctx context.Context, serviceName string) {
156+
}
157+
158+
func (n noopSpan) SetLogID(ctx context.Context, logID string) {
159+
}
160+
161+
func (n noopSpan) SetFinishTime(finishTime time.Time) {
162+
}
163+
164+
func (n noopSpan) SetSystemTags(ctx context.Context, systemTags map[string]interface{}) {
165+
}
166+
167+
func (n noopSpan) SetDeploymentEnv(ctx context.Context, deploymentEnv string) {
168+
}
169+
135170
func (n noopSpan) GetSpanID() string {
136171
return ""
137172
}

backend/infra/platestwrite/latest_write_tracker.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ const (
124124
ResourceTypeVersion ResourceType = "version"
125125
ResourceTypeItem ResourceType = "item"
126126

127-
ResourceTypePromptBasic ResourceType = "prompt_basic"
128-
ResourceTypePromptDraft ResourceType = "prompt_draft"
129-
ResourceTypePromptCommit ResourceType = "prompt_commit"
127+
ResourceTypePromptBasic ResourceType = "prompt_basic"
128+
ResourceTypePromptDraft ResourceType = "prompt_draft"
129+
ResourceTypePromptCommit ResourceType = "prompt_commit"
130+
ResourceTypePromptLabel ResourceType = "prompt_label"
131+
ResourceTypePromptCommitLabelMapping ResourceType = "prompt_commit_label_mapping"
130132

131133
ResourceTypeExperiment ResourceType = "experiment"
132134
ResourceTypeEvalSet ResourceType = "eval_set"

0 commit comments

Comments
 (0)