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

Add cURL to view API Page and add a dedicated Guide #8445

Merged
merged 26 commits into from
Jun 5, 2024
Merged

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Jun 4, 2024

Adds cURL docs

Closes: #7331
Closes: #6471
Closes: #8237

@abidlabs abidlabs requested review from aliabd and aliabid94 June 4, 2024 03:48
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 4, 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/8dc3501417834b1599ad9bff16cfc0b72d3105b6/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@8dc3501417834b1599ad9bff16cfc0b72d3105b6#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/8dc3501417834b1599ad9bff16cfc0b72d3105b6/gradio-client-0.20.1.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 4, 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.

Add cURL to view API Page and add a dedicated Guide

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 4, 2024
@abidlabs abidlabs changed the title curl docs Add cURL to view API Page and add a dedicated Guide Jun 4, 2024
Copy link
Collaborator

@aliabd aliabd left a comment

Choose a reason for hiding this comment

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

Guide is great! just need to fix the new lines between tips and codeblocks

@abidlabs abidlabs marked this pull request as ready for review June 4, 2024 21:39
@abidlabs
Copy link
Member Author

abidlabs commented Jun 4, 2024

@aliabd I tested a few demos and the cURL commands worked but I think it would be great to test a variety of other demos just to make sure everything is working

js/app/src/api_docs/img/bash.svg Outdated Show resolved Hide resolved
js/app/src/api_docs/RecordingSnippet.svelte Show resolved Hide resolved
@@ -5,7 +5,7 @@
export let is_running: boolean;
export let endpoint_returns: any;
export let js_returns: any;
export let current_language: "python" | "javascript";
export let current_language: "python" | "javascript" | "bash";
Copy link
Collaborator

Choose a reason for hiding this comment

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

there's a problem with some types for js and bash

python:
Screen Shot 2024-06-04 at 4 27 48 PM

js:
Screen Shot 2024-06-04 at 4 27 57 PM

bash:
Screen Shot 2024-06-04 at 4 27 37 PM

Copy link
Member Author

Choose a reason for hiding this comment

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

Looked into this issue and its actually not related to this PR. For now, I've put in a temporary fix that if no type information is available, it prints any instead:

image

@abidlabs
Copy link
Member Author

abidlabs commented Jun 5, 2024

Ok @aliabd I believe I've made all of the changes! If you'd like to take another look, go ahead. I'll probably merge in ~45 min or so

Copy link
Collaborator

@aliabd aliabd left a comment

Choose a reason for hiding this comment

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

Everything looks good to me!

@@ -5,7 +5,8 @@
export let is_running: boolean;
export let endpoint_returns: any;
export let js_returns: any;
export let current_language: "python" | "javascript";
export let current_language: "python" | "javascript" | "bash";
console.log(js_returns);
Copy link
Collaborator

Choose a reason for hiding this comment

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

causing test to fail

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
console.log(js_returns);

@abidlabs
Copy link
Member Author

abidlabs commented Jun 5, 2024

Thank you so much @aliabd!

@abidlabs abidlabs enabled auto-merge (squash) June 5, 2024 01:28
@abidlabs abidlabs merged commit 5c8915b into main Jun 5, 2024
7 of 8 checks passed
@abidlabs abidlabs deleted the curl-docs branch June 5, 2024 01:32
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
3 participants