-
Notifications
You must be signed in to change notification settings - Fork 79
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
added exception to track complete error #1662
Conversation
WalkthroughThe pull request introduces two distinct changes across different files in the Kairon project. In the Changes
Sequence DiagramsequenceDiagram
participant User
participant LLMClassifier
participant LLM
User->>LLMClassifier: Send message
LLMClassifier->>LLM: Classify intent
LLM-->>LLMClassifier: Intent result
LLMClassifier->>LLM: Extract entities
LLM-->>LLMClassifier: Entity results
LLMClassifier->>User: Return processed message
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
kairon/events/definitions/model_testing.py
(1 hunks)kairon/nlu/classifiers/llm.py
(1 hunks)
🔇 Additional comments (1)
kairon/nlu/classifiers/llm.py (1)
34-38
: Extending LLMClassifier
to Support Entity Extraction
The addition of EntityExtractorMixin
to the class inheritance and registering the component as both an INTENT_CLASSIFIER
and an ENTITY_EXTRACTOR
appropriately extends the LLMClassifier
to handle entity extraction alongside intent classification.
@@ -58,6 +58,6 @@ def execute(self, **kwargs): | |||
nlu_result=nlu_results, | |||
event_status=EVENT_STATUS.COMPLETED.value) | |||
except Exception as e: | |||
logger.error(str(e)) | |||
logger.exception(str(e)) |
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.
🛠️ Refactor suggestion
Simplify logger.exception
Usage
When using logger.exception()
, you don't need to pass str(e)
as it automatically includes the exception information and stack trace. Consider updating the code as follows:
- logger.exception(str(e))
+ logger.exception("An error occurred during model testing execution")
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
logger.exception(str(e)) | |
logger.exception("An error occurred during model testing execution") |
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.
approved
Summary by CodeRabbit
New Features
Bug Fixes