Skip to content

[feat][backend] Add prompt management OpenAPI endpoints for CRUD, draft and commit operations#474

Merged
lizwang11 merged 3 commits into
mainfrom
feat/prompt_openapi_2
Mar 25, 2026
Merged

[feat][backend] Add prompt management OpenAPI endpoints for CRUD, draft and commit operations#474
lizwang11 merged 3 commits into
mainfrom
feat/prompt_openapi_2

Conversation

@lizwang11
Copy link
Copy Markdown
Collaborator

This PR introduces a complete set of Prompt Management OpenAPI endpoints, extending the existing prompt OpenAPI service (which previously only supported Execute, ExecuteStreaming, ListPromptBasic, and BatchGetPromptByPromptKey) with 6 new management APIs:

New API Endpoints:

Method Path Description POST /v1/loop/prompts Create a new prompt with name, key, description, type, and security level DELETE /v1/loop/prompts/:prompt_id Delete a prompt by ID GET /v1/loop/prompts/:prompt_id Get prompt details (optionally with commit and/or draft info) POST /v1/loop/prompts/:prompt_id/drafts/save Save a prompt draft POST /v1/loop/prompts/:prompt_id/drafts/commit Commit a prompt draft with version and description POST /v1/loop/prompts/:prompt_id/commits/list List prompt commit history with pagination

@lizwang11 lizwang11 requested a review from caijialin0626 March 25, 2026 06:27
ming845378603
ming845378603 previously approved these changes Mar 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 70.64516% with 91 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...les/prompt/application/convertor/openapi_manage.go 46.37% 66 Missing and 8 partials ⚠️
...i/handler/coze/loop/apis/prompt_open_apiservice.go 0.00% 12 Missing ⚠️
backend/modules/prompt/application/openapi.go 96.87% 3 Missing and 2 partials ⚠️

❌ Your patch status has failed because the patch coverage (70.64%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #474      +/-   ##
==========================================
- Coverage   75.07%   75.07%   -0.01%     
==========================================
  Files         632      633       +1     
  Lines       67215    67521     +306     
==========================================
+ Hits        50464    50693     +229     
- Misses      13523    13594      +71     
- Partials     3228     3234       +6     
Flag Coverage Δ
unittests 75.07% <70.64%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/modules/prompt/application/openapi.go 91.44% <96.87%> (+3.31%) ⬆️
...i/handler/coze/loop/apis/prompt_open_apiservice.go 0.00% <0.00%> (ø)
...les/prompt/application/convertor/openapi_manage.go 46.37% <46.37%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee7c5d5...45af46c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lizwang11 lizwang11 merged commit 66bae53 into main Mar 25, 2026
16 of 17 checks passed
@lizwang11 lizwang11 deleted the feat/prompt_openapi_2 branch March 25, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants