Skip to content

feat: 通过不同的skills技能描述规定LLM返回不同的数据格式#334

Draft
zzcr wants to merge 1 commit intodevfrom
zzc/toggle-genui-0226
Draft

feat: 通过不同的skills技能描述规定LLM返回不同的数据格式#334
zzcr wants to merge 1 commit intodevfrom
zzc/toggle-genui-0226

Conversation

@zzcr
Copy link
Member

@zzcr zzcr commented Feb 26, 2026

Pull Request (OpenTiny NEXT-SDKs)

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build-related changes
  • CI-related changes
  • Documentation-related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Added product price protection reference guide with comprehensive documentation
    • Enhanced product guide skill with listing and pricing management subsections
    • New output formatting requirements for product guidance documentation
  • Documentation

    • Expanded product guide documentation with detailed reference materials and format specifications
  • Chores

    • Updated API configuration settings for AI model provider

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Walkthrough

This pull request enhances the doc-ai application by extending the TinyRemoter component with additional props (genUiAble, fullscreen, systemPrompt), updates product guide skill documentation with new references and a price protection feature article, modifies API endpoint configuration, and adjusts configuration settings for the DeepSeek model.

Changes

Cohort / File(s) Summary
UI Component Enhancement
packages/doc-ai/src/App.vue
Added three new props to TinyRemoter component (genUiAble, fullscreen, systemPrompt) with corresponding state bindings and v-model configuration for systemPrompt.
Product Guide Documentation
packages/doc-ai/src/skills/product-guide/SKILL.md, packages/doc-ai/src/skills/product-guide/reference/product-listing.md, packages/doc-ai/src/skills/product-guide/reference/product-price-protection.md
Updated skill metadata to reference product-listing.md instead of product-shangjia.md, added new price protection sub-skill, introduced output format requirements in product-listing guide, and created comprehensive price protection documentation with process flows, scenarios, and formatting guidelines.
API & Configuration Updates
packages/next-remoter/src/composable/CustomAgentModelProvider.ts, packages/next-remoter/src/config/genui-config.ts
Updated CustomAgentModelProvider default baseURL endpoint to include /prompt suffix, updated DeepSeek model configuration with new prompt ID (53e8f602ffc54527192aabd17465442e), and removed trailing comma in customActions configuration object.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 New props and prompts in the spring air,
Product guides flourish beyond compare,
Price protection's path now clearly shown,
Configuration refined, endpoints honed—
A developer's garden begins to grow! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main objective: defining different data formats for LLM returns based on different skill descriptions, which is reflected across the changes (App.vue enhancements, SKILL.md updates, new reference documents, and config adjustments).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zzc/toggle-genui-0226

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/next-remoter/src/config/genui-config.ts (1)

3-5: Consider adding a comment explaining the prompt ID reference.

The prompt ID 53e8f602ffc54527192aabd17465442e is a magic string. Adding a brief comment about what this ID references (e.g., which prompt template version or purpose) would improve maintainability.

📝 Suggested improvement
   'prompt': {
     strategy: 'append',
+    // Prompt template for genUI schema generation (v2 - supports customActions)
     'id': '53e8f602ffc54527192aabd17465442e',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/next-remoter/src/config/genui-config.ts` around lines 3 - 5, Add a
short inline comment next to the 'prompt' object's 'id' property that explains
what the magic string "53e8f602ffc54527192aabd17465442e" refers to (for example:
which prompt template/version or its purpose), so maintainers can understand why
this specific ID is used; update the 'prompt' object in genui-config.ts near the
'id' key to include that explanatory comment.
packages/doc-ai/src/App.vue (1)

27-27: Consider extracting the hardcoded prompt to a named constant.

The systemPrompt is defined inline with a specific instruction. For maintainability and clarity, consider extracting this to a constant with a descriptive name.

✨ Suggested refactor
+const DEFAULT_SYSTEM_PROMPT = '要求:<important>输出格式为 Markdown 格式,不要使用schemaJson格式</important>'
+
-const systemPrompt = ref('要求:<important>输出格式为 Markdown 格式,不要使用schemaJson格式</important>')
+const systemPrompt = ref(DEFAULT_SYSTEM_PROMPT)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/doc-ai/src/App.vue` at line 27, Extract the hardcoded string used to
initialize systemPrompt into a named top-level constant (e.g.,
DEFAULT_SYSTEM_PROMPT) and use that constant when creating the ref;
specifically, create a descriptive constant for the prompt near the top of the
file and replace const systemPrompt = ref('要求:<important>输出格式为 Markdown
格式,不要使用schemaJson格式</important>') with const systemPrompt =
ref(DEFAULT_SYSTEM_PROMPT) (or import the constant if you move it to a separate
module) so the prompt is easy to find and reuse; ensure the constant name
clearly indicates its purpose (like DEFAULT_SYSTEM_PROMPT or
SYSTEM_PROMPT_TEMPLATE) and update any tests or usages accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/doc-ai/src/skills/product-guide/SKILL.md`:
- Around line 12-13: Update the incorrect relative paths in SKILL.md so they
point to the existing reference directory; replace
'./product-guide/reference/product-listing.md' with
'./reference/product-listing.md' and
'./product-guide/reference/product-price-protection.md' with
'./reference/product-price-protection.md' (edit the path strings shown in the
two lines mentioning 商品上架管理 and 商品价保管理).

---

Nitpick comments:
In `@packages/doc-ai/src/App.vue`:
- Line 27: Extract the hardcoded string used to initialize systemPrompt into a
named top-level constant (e.g., DEFAULT_SYSTEM_PROMPT) and use that constant
when creating the ref; specifically, create a descriptive constant for the
prompt near the top of the file and replace const systemPrompt =
ref('要求:<important>输出格式为 Markdown 格式,不要使用schemaJson格式</important>') with const
systemPrompt = ref(DEFAULT_SYSTEM_PROMPT) (or import the constant if you move it
to a separate module) so the prompt is easy to find and reuse; ensure the
constant name clearly indicates its purpose (like DEFAULT_SYSTEM_PROMPT or
SYSTEM_PROMPT_TEMPLATE) and update any tests or usages accordingly.

In `@packages/next-remoter/src/config/genui-config.ts`:
- Around line 3-5: Add a short inline comment next to the 'prompt' object's 'id'
property that explains what the magic string "53e8f602ffc54527192aabd17465442e"
refers to (for example: which prompt template/version or its purpose), so
maintainers can understand why this specific ID is used; update the 'prompt'
object in genui-config.ts near the 'id' key to include that explanatory comment.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9127921 and cad03aa.

📒 Files selected for processing (6)
  • packages/doc-ai/src/App.vue
  • packages/doc-ai/src/skills/product-guide/SKILL.md
  • packages/doc-ai/src/skills/product-guide/reference/product-listing.md
  • packages/doc-ai/src/skills/product-guide/reference/product-price-protection.md
  • packages/next-remoter/src/composable/CustomAgentModelProvider.ts
  • packages/next-remoter/src/config/genui-config.ts

Comment on lines +12 to +13
商品上架管理: 具体的商品上架参考文档'./product-guide/reference/product-listing.md'
商品价保管理: 具体的商品价保参考文档'./product-guide/reference/product-price-protection.md'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the referenced files exist at the expected paths relative to SKILL.md
echo "Checking SKILL.md location..."
find packages/doc-ai/src/skills/product-guide/ -name "SKILL.md" -type f

echo ""
echo "Checking if referenced files exist..."
find packages/doc-ai/src/skills/product-guide/ -name "product-listing.md" -type f
find packages/doc-ai/src/skills/product-guide/ -name "product-price-protection.md" -type f

echo ""
echo "Full directory structure:"
find packages/doc-ai/src/skills/product-guide/ -type f -name "*.md" | sort

echo ""
echo "Checking if paths exist relative to SKILL.md location..."
ls -la packages/doc-ai/src/skills/product-guide/product-guide/reference/product-listing.md 2>&1 || echo "Path not found"
ls -la packages/doc-ai/src/skills/product-guide/product-guide/reference/product-price-protection.md 2>&1 || echo "Path not found"

echo ""
echo "Checking alternative path resolution (one level up)..."
ls -la packages/doc-ai/src/skills/product-guide/reference/product-listing.md 2>&1 || echo "Path not found"
ls -la packages/doc-ai/src/skills/product-guide/reference/product-price-protection.md 2>&1 || echo "Path not found"

Repository: opentiny/next-sdk

Length of output: 1216


Fix incorrect relative paths for skill document references.

The paths in lines 12-13 are incorrect. The files exist at packages/doc-ai/src/skills/product-guide/reference/, but the current paths './product-guide/reference/product-listing.md' and './product-guide/reference/product-price-protection.md' include an extra product-guide directory level that causes them to fail resolution.

Update the paths to:

  • './reference/product-listing.md'
  • './reference/product-price-protection.md'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/doc-ai/src/skills/product-guide/SKILL.md` around lines 12 - 13,
Update the incorrect relative paths in SKILL.md so they point to the existing
reference directory; replace './product-guide/reference/product-listing.md' with
'./reference/product-listing.md' and
'./product-guide/reference/product-price-protection.md' with
'./reference/product-price-protection.md' (edit the path strings shown in the
two lines mentioning 商品上架管理 and 商品价保管理).

@zzcr zzcr marked this pull request as draft March 4, 2026 06:09
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.

1 participant