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

Issue #315: Display full completion in CLI #1068

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

bnkc
Copy link

@bnkc bnkc commented Jan 12, 2024

  • I understand that this repository is auto-generated and my pull request may not be merged

Description

This PR addresses issue #315. The idea is introducing a new --verbose flag to the CLI to display the entire completion response.

Implementation

  • Added argument --verbose to CLI
  • Added verbose arg to CLIChatCompletionCreateArgs
  • Passed verbose_output flag to static method _create
  • If True, dump completion, write to console and return
 if verbose_output:
            sys.stdout.write(completion.model_dump_json(indent=2))
            return

Caveats

Since verbose is not a chat.completions.create argument, we can't pass it to CompletionCreateParams. In my opinion it seems ok to have a flag for now, but I'm sure there's a cleaner way of doing it in the future if new args are introduced that aren't parameters for completions endpoint.

Notes

Do we want this for _stream_create?

Thanks in advance 😀 @RobertCraigie

@bnkc bnkc requested a review from a team as a code owner January 12, 2024 19:15
@bnkc bnkc changed the title Fix issue #315: Display full completion in CLI Issue #315: Display full completion in CLI Jan 12, 2024
@rattrayalex
Copy link
Collaborator

@backus is this what you were looking for?

@bnkc
Copy link
Author

bnkc commented Feb 8, 2024

Any news on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants