-
Notifications
You must be signed in to change notification settings - Fork 10
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
ENG-879 ENG-882 Move cli logic into its own folder #198
Conversation
log10/completions/completions.py
Outdated
if not response: | ||
tool_calls = first_choice["message"].get("tool_calls", []) | ||
if tool_calls: | ||
last_tool_call = tool_calls[-1] | ||
response = last_tool_call.get("function", {}).get("arguments", "") |
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.
could we simplify the if
s within if "message" in first_choice
?
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.
Updated. Does it look better?
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.
I found function _render_completions_table
is used for cli. so could be moved to cli/completions.py
. Then we could remove the import rich
, pandas, etc. in log10/completions/completions.py.
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.
I also moved _render_comparison_table
and _create_dataframe_from_comparison_data
function because they also use rich
and pandas
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.
LGTM
Description:
When accessing the Feedback, FeedbackTask, or Autofeedback objects in the SDK, users currently need to install CLI-related modules due to the existing code structure. To streamline this and keep the package lightweight, we can move the CLI code logic into its own folder.
pyproject.toml
to make it easy to install the modules