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 Bash in Api Recorder #8460

Merged
merged 15 commits into from
Jun 5, 2024
Merged

Support Bash in Api Recorder #8460

merged 15 commits into from
Jun 5, 2024

Conversation

aliabd
Copy link
Collaborator

@aliabd aliabd commented Jun 5, 2024

Creates API recording snippets for bash like with js and python. There was a bit of a challenge given two requests are required and the event_id is needed for the second. To keep the snippet copy-paste-able without changes I opted for using jq but i'm not sure that was the right call since the user may not have it installed already. Open to removing that.

Screen Shot 2024-06-04 at 8 56 49 PM

Also noticed a bug with the copy button on recording snippets. It would always just copy the last of the three languages to mount. Very weird. I fixed it in a bit of a roundabout way but it works as expected now.

closes: #8457

@aliabd aliabd requested a review from abidlabs June 5, 2024 03:53
@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jun 5, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/213428d96af92300dc4ae3abf54b8c22d92d86c8/gradio-4.33.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@213428d96af92300dc4ae3abf54b8c22d92d86c8#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/213428d96af92300dc4ae3abf54b8c22d92d86c8/gradio-client-0.20.1.tgz

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jun 5, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/app patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Support Bash in Api Recorder

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@abidlabs abidlabs added the v: patch A change that requires a patch release label Jun 5, 2024
@abidlabs
Copy link
Member

abidlabs commented Jun 5, 2024

Thanks for taking care of this @aliabd! I like the suggestion of saving the event_id to a variable so that the snippet is completely copy-able. Could we make the regular code snippet like that as wells? I do think we should avoid jq but it should be pretty easy to do this with awk which is installed by default in most OS-es

@aliabd
Copy link
Collaborator Author

aliabd commented Jun 5, 2024

Made the changes if you can take another look @abidlabs

Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

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

LGTM @aliabd! I tweaked the code snippets so that each command appears on a separate line

image

but otherwise, this is working great!

@aliabd aliabd enabled auto-merge (squash) June 5, 2024 23:09
@aliabd aliabd merged commit 8628899 into main Jun 5, 2024
7 of 8 checks passed
@aliabd aliabd deleted the aliabd/api-recorder-changes branch June 5, 2024 23:17
This was referenced Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add API Recorder support for curl
3 participants