[feat][prompt] Unified Internal & External Prompt Architecture Changes#355
Open
caijialin0626 wants to merge 40 commits intomainfrom
Open
[feat][prompt] Unified Internal & External Prompt Architecture Changes#355caijialin0626 wants to merge 40 commits intomainfrom
caijialin0626 wants to merge 40 commits intomainfrom
Conversation
2582bd7 to
3d06b54
Compare
看一下feat/prompt\_sync\_1222这个分支和main的diff,帮我补齐所有差异的ut,并确保完整的ut测试通过,其中需要mock的统一使用mockgen来生成,你可参考其他test文件 写完之后,你可以使用go test ./... -v | grep FAIL 来测试
@/Users/bytedance/GolandProjects/coze-loop/backend/modules/prompt/domain/service/tool\_results\_collector\_test.go 需要使用mock ,使用mockgen 在@/Users/bytedance/GolandProjects/coze-loop/backend/modules/prompt/domain/service/mocks 中生成mock方法并使用,你可以参考 tool\_config\_test
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #355 +/- ##
==========================================
+ Coverage 69.76% 69.88% +0.12%
==========================================
Files 616 619 +3
Lines 58291 58776 +485
==========================================
+ Hits 40666 41076 +410
- Misses 14637 14690 +53
- Partials 2988 3010 +22
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 26 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
参考下面的ut报告帮我补充一下对应的ut ❌ Patch coverage is `76.68919%` with `69 lines` in your changes missing coverage. Please review. [Files with missing lines](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev)Patch %Lines [backend/modules/prompt/application/openapi.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fapplication%2Fopenapi.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9hcHBsaWNhdGlvbi9vcGVuYXBpLmdv) 15.78% [29 Missing and 3 partials⚠️ ](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev) [...nd/modules/prompt/application/convertor/openapi.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fapplication%2Fconvertor%2Fopenapi.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9hcHBsaWNhdGlvbi9jb252ZXJ0b3Ivb3BlbmFwaS5nbw==) 77.77% [10 Missing and 10 partials⚠️ ](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev) [backend/modules/prompt/domain/service/execute.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fdomain%2Fservice%2Fexecute.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9kb21haW4vc2VydmljZS9leGVjdXRlLmdv) 89.61% [4 Missing and 4 partials⚠️ ](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev) [...kend/modules/prompt/domain/entity/prompt\_detail.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fdomain%2Fentity%2Fprompt_detail.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9kb21haW4vZW50aXR5L3Byb21wdF9kZXRhaWwuZ28=) 83.33% [3 Missing and 2 partials⚠️ ](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev) [...end/modules/prompt/application/convertor/prompt.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fapplication%2Fconvertor%2Fprompt.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9hcHBsaWNhdGlvbi9jb252ZXJ0b3IvcHJvbXB0Lmdv) 84.61% [2 Missing and 2 partials⚠️ ](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev) ❌ Your patch check has failed because the patch coverage (76.68%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the [target](https://docs.codecov.com/docs/commit-status#target) coverage. [](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&utm\_medium=referral&utm\_source=github&utm\_content=comment&utm\_campaign=pr+comments&utm\_term=coze-dev) ```javascript @@ Coverage Diff @@ ## main #355 +/- ## ======================================== Coverage 69.76% 69.77% ======================================== Files 616 618 +2 Lines 58291 58501 +210 ======================================== + Hits 40666 40818 +152 - Misses 14637 14680 +43 - Partials 2988 3003 +15 ``` [Flag](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev)Coverage Δ [unittests](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev) `69.77% <76.68%> (+<0.01%)` ⬆️ Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#carryforward-flags-in-the-pull-request-comment) to find out more. [Files with missing lines](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev)Coverage Δ [backend/modules/prompt/domain/service/service.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fdomain%2Fservice%2Fservice.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9kb21haW4vc2VydmljZS9zZXJ2aWNlLmdv) `100.00% <100.00%> (ø)` [...ckend/modules/prompt/domain/service/tool\_config.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fdomain%2Fservice%2Ftool_config.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9kb21haW4vc2VydmljZS90b29sX2NvbmZpZy5nbw==) `100.00% <100.00%> (ø)` [...es/prompt/domain/service/tool\_results\_collector.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fdomain%2Fservice%2Ftool_results_collector.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9kb21haW4vc2VydmljZS90b29sX3Jlc3VsdHNfY29sbGVjdG9yLmdv) `100.00% <100.00%> (ø)` [...end/modules/prompt/application/convertor/prompt.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fapplication%2Fconvertor%2Fprompt.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9hcHBsaWNhdGlvbi9jb252ZXJ0b3IvcHJvbXB0Lmdv) `83.46% <84.61%> (+0.01%)` ⬆️ [...kend/modules/prompt/domain/entity/prompt\_detail.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fdomain%2Fentity%2Fprompt_detail.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9kb21haW4vZW50aXR5L3Byb21wdF9kZXRhaWwuZ28=) `85.31% <83.33%> (-0.94%)` ⬇️ [backend/modules/prompt/domain/service/execute.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fdomain%2Fservice%2Fexecute.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9kb21haW4vc2VydmljZS9leGVjdXRlLmdv) `77.21% <89.61%> (+0.50%)` ⬆️ [...nd/modules/prompt/application/convertor/openapi.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fapplication%2Fconvertor%2Fopenapi.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9hcHBsaWNhdGlvbi9jb252ZXJ0b3Ivb3BlbmFwaS5nbw==) `89.24% <77.77%> (-3.24%)` ⬇️ [backend/modules/prompt/application/openapi.go](https://app.codecov.io/gh/coze-dev/coze-loop/pull/355?src=pr&el=tree&filepath=backend%2Fmodules%2Fprompt%2Fapplication%2Fopenapi.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=coze-dev#diff-YmFja2VuZC9tb2R1bGVzL3Byb21wdC9hcHBsaWNhdGlvbi9vcGVuYXBpLmdv) `85.92% <15.78%> (-5.39%)` ⬇️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[feat][prompt] Prompt 内外场一体化改动(二期)
en:
This PR introduces the second phase of the in-context and out-of-context prompt integration.
The change further unifies the prompt structure and execution logic between in-context and out-of-context scenarios, reducing divergence and improving consistency across different prompt entry points.
Key improvements include:
• Unified prompt construction flow for both in-context and out-of-context usage
• Reduced duplicated logic and clearer responsibility boundaries
• Improved maintainability and extensibility for future prompt iterations
This change does not alter user-facing behavior but provides a more robust and scalable prompt architecture.