mirror of
https://github.com/langgenius/dify.git
synced 2026-04-01 13:36:52 +00:00
Some checks failed
autofix.ci / autofix (push) Has been cancelled
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Has been cancelled
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Has been cancelled
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Has been cancelled
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Has been cancelled
Main CI Pipeline / Check Changed Files (push) Has been cancelled
Main CI Pipeline / API Tests (push) Has been cancelled
Main CI Pipeline / Web Tests (push) Has been cancelled
Main CI Pipeline / Style Check (push) Has been cancelled
Main CI Pipeline / VDB Tests (push) Has been cancelled
Main CI Pipeline / DB Migration Test (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
from collections.abc import Generator
|
|
from typing import Any, Protocol
|
|
|
|
import httpx
|
|
|
|
from dify_graph.file import File
|
|
from dify_graph.file.models import ToolFile
|
|
|
|
|
|
class HttpClientProtocol(Protocol):
|
|
@property
|
|
def max_retries_exceeded_error(self) -> type[Exception]: ...
|
|
|
|
@property
|
|
def request_error(self) -> type[Exception]: ...
|
|
|
|
def get(self, url: str, max_retries: int = ..., **kwargs: Any) -> httpx.Response: ...
|
|
|
|
def head(self, url: str, max_retries: int = ..., **kwargs: Any) -> httpx.Response: ...
|
|
|
|
def post(self, url: str, max_retries: int = ..., **kwargs: Any) -> httpx.Response: ...
|
|
|
|
def put(self, url: str, max_retries: int = ..., **kwargs: Any) -> httpx.Response: ...
|
|
|
|
def delete(self, url: str, max_retries: int = ..., **kwargs: Any) -> httpx.Response: ...
|
|
|
|
def patch(self, url: str, max_retries: int = ..., **kwargs: Any) -> httpx.Response: ...
|
|
|
|
|
|
class FileManagerProtocol(Protocol):
|
|
def download(self, f: File, /) -> bytes: ...
|
|
|
|
|
|
class ToolFileManagerProtocol(Protocol):
|
|
def create_file_by_raw(
|
|
self,
|
|
*,
|
|
user_id: str,
|
|
tenant_id: str,
|
|
conversation_id: str | None,
|
|
file_binary: bytes,
|
|
mimetype: str,
|
|
filename: str | None = None,
|
|
) -> Any: ...
|
|
|
|
def get_file_generator_by_tool_file_id(self, tool_file_id: str) -> tuple[Generator | None, ToolFile | None]: ...
|