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

Support openai api --json completions.create ... #315

Open
backus opened this issue Mar 17, 2023 · 4 comments
Open

Support openai api --json completions.create ... #315

backus opened this issue Mar 17, 2023 · 4 comments
Labels
CLI enhancement New feature or request

Comments

@backus
Copy link

backus commented Mar 17, 2023

Describe the feature or improvement you're requesting

I have this tool I made which I'm using day to day now: https://github.com/backus/ai.sh

It is super useful and I actually like that it is written in pure bash because it is very portable and it is also a testament to just how easy it is to add some AI magic to your application. That said, one thing I'd like to add to the tool is the ability to see why the completion finished generating (did it hit a stop token or did it hit the token limit?).

I could do this to switching to a pure cURL, but I'd love if I could just tell the client to give me JSON instead of just the .choices[0].text. Would be really easy then to use jq to manipulate the response inside of scripts.

Additional context

No response

@Arthavruksha
Copy link

The whole JSON can be accessed through completion variable

@backus
Copy link
Author

backus commented Mar 18, 2023

@Arthavruksha I'm talking about the CLI. For example:

$ openai api completions.create -p 'Say hello' -m 'text-ada-001'
Say hello

Hello!%

@rattrayalex rattrayalex added enhancement New feature or request CLI labels Dec 31, 2023
@bnkc
Copy link

bnkc commented Jan 12, 2024

On it!

@rattrayalex
Copy link
Collaborator

rattrayalex commented Feb 8, 2024

@backus does this PR do what you were hoping for? #1068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants