Skip to content
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

refactor(2665): send system message once in InferTypeName generation #2676

Conversation

onyedikachi-david
Copy link

@onyedikachi-david onyedikachi-david commented Aug 12, 2024

Summary:
Refactored the InferTypeName logic to optimize the system message handling. System messages are now sent only once during the type name generation process, and user messages are sent individually for each type, reducing redundant message transmission.

Issue Reference(s):
Fixes #2665
/claim #2665

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

@github-actions github-actions bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Aug 12, 2024
src/cli/llm/wizard.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 52 lines in your changes missing coverage. Please review.

Project coverage is 85.94%. Comparing base (e7fc1ce) to head (c6c7e24).
Report is 4 commits behind head on main.

Files Patch % Lines
src/cli/llm/infer_type_name.rs 0.00% 50 Missing ⚠️
src/cli/llm/wizard.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2676      +/-   ##
==========================================
- Coverage   86.09%   85.94%   -0.16%     
==========================================
  Files         254      254              
  Lines       24486    24529      +43     
==========================================
  Hits        21081    21081              
- Misses       3405     3448      +43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


async fn ask_with_context(
&self,
system_messages: &[ChatMessage],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove system_messages if we are not using it.

question: &Question,
) -> Result<Answer> {
// Remove the conversion to ChatRequest
self.wizard.as_ref().unwrap().ask(question.clone()).await
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our goal was to send system message only once but question itself contains the system message.

@@ -10,6 +10,7 @@ use crate::core::config::Config;
#[derive(Default)]
pub struct InferTypeName {
secret: Option<String>,
wizard: Option<Wizard<Question, Answer>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why it's optional?

@tusharmath tusharmath marked this pull request as draft August 14, 2024 13:32
@tusharmath
Copy link
Contributor

Moving to draft to reduce noise and improve CI efficiency. Once you are ready just mark it as "ready to review". Feel free to give a shoutout on the #contributors channel on Discord if you want immediate attention.

Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Aug 19, 2024
@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Aug 21, 2024
Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Aug 26, 2024
Copy link

github-actions bot commented Sep 5, 2024

PR closed after 10 days of inactivity.

@github-actions github-actions bot closed this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 Bounty claim state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. type: chore Routine tasks like conversions, reorganization, and maintenance work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send system message only once in infer_type_names
3 participants