-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix: include universal patterns in bindings #431
Conversation
WalkthroughWalkthroughThe recent changes enhance the codebase by integrating AI placeholder functions and improving encapsulation through modified visibility. When the "ai_builtins" feature is disabled, the system now provides placeholder functions instead of returning Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant MarzanoCore
participant BuiltIns
User->>CLI: Request to analyze with AI built-ins
alt AI built-ins enabled
CLI->>BuiltIns: Retrieve built-in functions
else AI built-ins not enabled
CLI->>MarzanoCore: Get AI placeholder functions
MarzanoCore-->>CLI: Return AI placeholders
end
CLI-->>User: Provide analysis results
Recent review detailsConfiguration used: .coderabbit.yaml Files ignored due to path filters (5)
Files selected for processing (3)
Files skipped from review as they are similar to previous changes (1)
Additional context usedLearnings (1)
Additional comments not posted (6)
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
View earlier commitsOn commit 3e3652d, Grit tried to heal these tests:
On commit 4a46c95, Grit tried to heal these tests:
On commit 1dd6b81, Grit tried to heal these tests:
Tip You can view and edit CI healing settings on the Grit App. |
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.
5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
BuiltInFunction::new( | ||
"llm_chat", | ||
vec!["model", "messages", "pattern"], | ||
Box::new(ai_fn_placholder), |
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.
Spelling: Typo in function name ai_fn_placholder
. Should be ai_fn_placeholder
.
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
fn ai_fn_placholder<'a>( | ||
_args: &'a [Option<Pattern<MarzanoQueryContext>>], | ||
_context: &'a MarzanoContext<'a>, | ||
_state: &mut State<'a, MarzanoQueryContext>, | ||
_logs: &mut AnalysisLogs, | ||
) -> Result<MarzanoResolvedPattern<'a>> { | ||
bail!("AI features are not supported in your GritQL distribution. Please upgrade to the Enterprise version to use AI features.") | ||
} |
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.
Fix the typo in the function name.
The function name ai_fn_placholder
contains a typo. It should be ai_fn_placeholder
.
-fn ai_fn_placholder<'a>(
+fn ai_fn_placeholder<'a>(
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.
fn ai_fn_placholder<'a>( | |
_args: &'a [Option<Pattern<MarzanoQueryContext>>], | |
_context: &'a MarzanoContext<'a>, | |
_state: &mut State<'a, MarzanoQueryContext>, | |
_logs: &mut AnalysisLogs, | |
) -> Result<MarzanoResolvedPattern<'a>> { | |
bail!("AI features are not supported in your GritQL distribution. Please upgrade to the Enterprise version to use AI features.") | |
} | |
fn ai_fn_placeholder<'a>( | |
_args: &'a [Option<Pattern<MarzanoQueryContext>>], | |
_context: &'a MarzanoContext<'a>, | |
_state: &mut State<'a, MarzanoQueryContext>, | |
_logs: &mut AnalysisLogs, | |
) -> Result<MarzanoResolvedPattern<'a>> { | |
bail!("AI features are not supported in your GritQL distribution. Please upgrade to the Enterprise version to use AI features.") | |
} |
pub fn get_ai_placeholder_functions() -> Option<BuiltIns> { | ||
Some( | ||
vec![ | ||
BuiltInFunction::new( | ||
"llm_chat", | ||
vec!["model", "messages", "pattern"], | ||
Box::new(ai_fn_placholder), | ||
), | ||
BuiltInFunction::new("embedding", vec!["target"], Box::new(ai_fn_placholder)), | ||
] | ||
.into(), | ||
) | ||
} |
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.
Fix the typo in the function name.
The function name ai_fn_placholder
contains a typo. It should be ai_fn_placeholder
.
- Box::new(ai_fn_placholder),
+ Box::new(ai_fn_placeholder),
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.
pub fn get_ai_placeholder_functions() -> Option<BuiltIns> { | |
Some( | |
vec![ | |
BuiltInFunction::new( | |
"llm_chat", | |
vec!["model", "messages", "pattern"], | |
Box::new(ai_fn_placholder), | |
), | |
BuiltInFunction::new("embedding", vec!["target"], Box::new(ai_fn_placholder)), | |
] | |
.into(), | |
) | |
} | |
pub fn get_ai_placeholder_functions() -> Option<BuiltIns> { | |
Some( | |
vec![ | |
BuiltInFunction::new( | |
"llm_chat", | |
vec!["model", "messages", "pattern"], | |
Box::new(ai_fn_placeholder), | |
), | |
BuiltInFunction::new("embedding", vec!["target"], Box::new(ai_fn_placeholder)), | |
] | |
.into(), | |
) | |
} |
Greptile Summary
This is an auto-generated summary
The pull request introduces AI placeholder functions and improves the handling of universal patterns in various modules.
compile
method ofRichPattern
struct.llm_chat
andembedding
placeholder functions; introducedget_ai_placeholder_functions
.get_universal
method; updatedget_language_and_universal_directory
andget
methods.get_ai_built_in_functions_for_feature
to return AI placeholder functions whenai_builtins
is disabled.Summary by CodeRabbit
New Features
Improvements
Refactor