logging infomation when LLM response function call#1286
logging infomation when LLM response function call#1286yileicn merged 4 commits intoSciSharp:masterfrom
Conversation
Introduce a retry mechanism in RoutingService.InvokeAgent to handle cases where the FunctionName is null or whitespace. Add IsRetry property to InvokeAgentOptions to prevent infinite retry loops. If a retry still results in a missing FunctionName, log an error and return a user-facing error message. Set IsRetry default to false. This improves robustness and user feedback for invalid function call requests.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
|
reviewed |
|
reviewed |
User description
Introduce a retry mechanism in RoutingService.InvokeAgent to handle cases where the FunctionName is null or whitespace. Add IsRetry property to InvokeAgentOptions to prevent infinite retry loops. If a retry still results in a missing FunctionName, log an error and return a user-facing error message. Set IsRetry default to false. This improves robustness and user feedback for invalid function call requests.
PR Type
Bug fix, Enhancement
Description
Add retry mechanism for missing FunctionName in agent invocation
Introduce IsRetry property to InvokeAgentOptions preventing infinite loops
Log warnings/errors and return user-facing message on persistent failures
Improve robustness of function call request handling
Diagram Walkthrough
flowchart LR A["InvokeAgent called"] --> B{"FunctionName null or whitespace?"} B -->|Yes, first attempt| C["Set IsRetry=true"] C --> D["Retry InvokeAgent"] D --> B B -->|Yes, after retry| E["Log error"] E --> F["Set user-facing error message"] F --> G["Return true"] B -->|No| H["Proceed to InvokeFunction"]File Walkthrough
InvokeOptions.cs
Add IsRetry property to InvokeAgentOptionssrc/Infrastructure/BotSharp.Abstraction/Routing/Models/InvokeOptions.cs
RoutingService.InvokeAgent.cs
Implement retry logic for missing FunctionName handlingsrc/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeAgent.cs
properties
null/whitespace FunctionName
retry