Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds a LlamaIndex refund tool example that validates input, checks gnt policy before a mock refund, supports direct execution, and tests allowed and blocked verdicts. It also adds the package script, dependency, README command, and pnpm build-script setting. ChangesLlamaIndex refund example
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR adds a localized LlamaIndex refund-order example and related tests and package wiring; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant runExample
participant refund_order
participant GntChecker
participant runGuardedAction
participant mockRefund
runExample->>refund_order: execute orderId and amount
refund_order->>GntChecker: checkAction(description, context)
GntChecker-->>refund_order: policy verdict
refund_order->>runGuardedAction: execute with verdict
runGuardedAction->>mockRefund: run when allowed
mockRefund-->>refund_order: refund result
refund_order-->>runExample: JSON-stringified result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The PR satisfies issue Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@kkkhs the LlamaIndex demo is still marked draft. If it's ready, flip it out of draft and I'll review and run CI on it. #205 (Pydantic AI) and #229 just landed if you want a recently-merged example to line the shape up against. Unrelated ask: I noticed you forked the repo but haven't starred it. If gnt has been useful to you, a star genuinely helps. It's most of how people find this thing, and the people who need a policy check in front of their agent mostly aren't searching for it yet. |
Signed-off-by: Huangshuo Kuang <141250392+kkkhs@users.noreply.github.com>
5e90367 to
d0b3ad2
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new llamaindex dependency pulls in deprecated workflow packages and native-parser transitive deps, and the PR should either narrow the dependency surface or document/justify the choice.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new LlamaIndex-based example to the @gnt-ai/examples package demonstrating a refund_order tool that performs check_action before executing a mock refund, aligning LlamaIndex with the existing framework examples (LangChain, Vercel AI SDK, OpenAI Agents).
Changes:
- Add
examples/src/llamaindex-check-action.tsimplementing a LlamaIndex tool that gates refund execution oncheck_action. - Wire a new
example:llamaindexscript and document it in the examples README. - Extend the examples test suite to cover allowed/blocked outcomes for the LlamaIndex tool and update the workspace to keep
tree-sitterbuilds disabled.
File summaries
| File | Description |
|---|---|
| pnpm-workspace.yaml | Disables tree-sitter builds in the workspace to avoid native compilation. |
| pnpm-lock.yaml | Adds/updates lock entries for the new llamaindex dependency and its transitive deps. |
| examples/test/guard.test.ts | Adds tests validating the LlamaIndex refund tool checks gnt and respects blocked verdicts. |
| examples/src/llamaindex-check-action.ts | New LlamaIndex refund_order tool example using check_action + runGuardedAction. |
| examples/README.md | Documents the new example:llamaindex command. |
| examples/package.json | Adds the example:llamaindex script and the llamaindex dependency. |
Review details
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
- Files reviewed: 5/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "@modelcontextprotocol/sdk": "^1.30.0", | ||
| "@openai/agents": "^0.17.0", | ||
| "ai": "^7.0.58", | ||
| "llamaindex": "^0.12.1", |
Signed-off-by: Huangshuo Kuang <141250392+kkkhs@users.noreply.github.com>
|
Done. I flipped the PR out of draft and narrowed the LlamaIndex import/dependency to |
What & why
Closes #204.
Adds a LlamaIndex
refund_ordertool example that runscheck_actionbefore the mock refund, wires it into the examples package, and covers allowed/blocked verdicts in the local examples test. The example importstoolfrom@llamaindex/core/toolsinstead of the top-levelllamaindexpackage, so the examples package does not pull in LlamaIndex's workflow or parser/native dependency chains.Test plan
pnpm install --frozen-lockfilepnpm --filter @gnt-ai/examples lintpnpm --filter @gnt-ai/examples typecheckpnpm --filter @gnt-ai/examples buildpnpm --filter @gnt-ai/examples testpnpm turbo run lint typecheck build --filter=@gnt-ai/examplespnpm audit --audit-level moderategit diff --checkBefore you open this
Reviewers here hold PRs to the same bar the maintainers hold their own changes to. Check these
before requesting review, not after:
git commit -s) — seeCONTRIBUTING.md's DCO section.apps/apiorapps/store, you ran the relevant test suite locally.behind.
test. A one-line change doesn't need one; a new code path does.
org/tenant isolation — no query or check that could leak one org's data to another.
problem — see
CONTRIBUTING.md's code conventions.apps/cli/src/prebrain/extraction/, the PR description includes therecall/precision numbers from
bun run eval:extraction -- --mode cloud.