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 async http client #760

Merged
merged 1 commit into from
Aug 29, 2024
Merged

add async http client #760

merged 1 commit into from
Aug 29, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Aug 29, 2024

🚀 This description was created by Ellipsis for commit e9972e7

Summary:

Introduces AsyncHttpClient using httpx for asynchronous HTTP requests with GET, POST methods, proxy support, and asynchronous closing.

Key points:

  • Introduces AsyncHttpClient in skyvern/forge/sdk/core/async_http_client.py.
  • Uses httpx.AsyncClient for asynchronous HTTP requests.
  • Provides get and post methods for making requests.
  • Allows setting a proxy during initialization.
  • Includes close method to close the client asynchronously.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to e9972e7 in 19 seconds

More details
  • Looked at 31 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_4Knirns100YwaJCk


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

A wrapper of httpx client.
Functionalities:
1. It comes with a default httpx.AsyncClient instance.
2. The httx client could be replaced by a set_client method.
Copy link
Contributor

Choose a reason for hiding this comment

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

The docstring mentions a set_client method, but it is not implemented. Either implement this method or update the docstring to reflect the current functionality.

"""

def __init__(self, proxy: str | None = None) -> None:
self.client = httpx.AsyncClient(proxy=proxy)
Copy link
Contributor

Choose a reason for hiding this comment

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

The proxy parameter should be proxies in httpx.AsyncClient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wintonzheng wintonzheng merged commit 1ef67f9 into main Aug 29, 2024
2 checks passed
@wintonzheng wintonzheng deleted the shu/add_async_http_client branch August 29, 2024 22:38
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.

1 participant