-
Notifications
You must be signed in to change notification settings - Fork 46
Added tools - Refund analytics and filter orders by amount #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds two new analytics tools in app/agents/voice/automatic/tools/juspay/analytics.py: functions for refund analytics by time and orders filtered by amount. Introduces corresponding FunctionSchema entries, updates the tools registry, and maps function names in the tool_functions dictionary for runtime invocation and callback handling. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor VoiceAgent as Voice Agent
participant Tools as Tools Registry
participant JuspayTool as Juspay Analytics Tool
participant JuspayAPI as Juspay API
participant Callback as Result Callback
rect rgb(240, 245, 255)
Note over VoiceAgent,Tools: Invoke refund analytics by time
VoiceAgent->>Tools: call("get_refund_analytics_by_time", params)
Tools->>JuspayTool: get_refund_analytics_by_time(params)
JuspayTool->>JuspayAPI: GET /refunds/analytics?time&dimensions
JuspayAPI-->>JuspayTool: response (data or error)
alt success
JuspayTool->>Callback: on_result(data)
JuspayTool-->>Tools: data
else error
JuspayTool->>Callback: on_error(error)
JuspayTool-->>Tools: error
end
end
rect rgb(240, 255, 240)
Note over VoiceAgent,Tools: Invoke orders by amount
VoiceAgent->>Tools: call("get_orders_by_amount", params)
Tools->>JuspayTool: get_orders_by_amount(params)
JuspayTool->>JuspayAPI: GET /orders?amount&operator&time
JuspayAPI-->>JuspayTool: response (grouped by payment method)
alt success
JuspayTool->>Callback: on_result(data)
JuspayTool-->>Tools: data
else error
JuspayTool->>Callback: on_error(error)
JuspayTool-->>Tools: error
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/agents/voice/automatic/tools/juspay/analytics.py(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/agents/voice/automatic/tools/juspay/analytics.py (1)
app/agents/voice/automatic/types/models.py (1)
ApiFailure(32-35)
🪛 Ruff (0.13.1)
app/agents/voice/automatic/tools/juspay/analytics.py
544-544: Do not catch blind exception: Exception
(BLE001)
577-577: Do not catch blind exception: Exception
(BLE001)
|
@santhoshJus this needs to be added in ligthouse. we will be moving to consuming tools from lighthouse via sse |
|
Added tool in lighthouse: BZ-44883: feat: Added tool to filter orders by amount |
27565eb to
9377cf2
Compare
Added tools for refund analytics and to filter orders by amount.
Fetching details from kvrefundtxns for refund analytics similar to how it was implemented in lighthouse