├── .env.example ├── .gitignore ├── CHANGELOG.md ├── src ├── server │ ├── helper.rs │ ├── mod.rs │ └── v1_handlers.rs └── main.rs ├── Cargo.toml ├── README_CN.md ├── README.md ├── .github └── workflows │ └── release-plz.yml └── Cargo.lock /.env.example: -------------------------------------------------------------------------------- 1 | HOST=127.0.0.1 2 | PORT=3000 3 | DIFY_BASE_URL=https://api.dify.ai 4 | DIFY_API_KEY=your_api_key 5 | DIFY_TIMEOUT=10 6 | WORKERS_NUM=4 7 | RUST_LOG=error 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | .env 12 | .DS_* 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [0.1.8] - 2024-06-03 4 | 5 | ### Bug Fixes 6 | 7 | - Set the minimum Rust version to `1.71.1` in `Cargo.toml` 8 | 9 | ### New Features 10 | 11 | - Add a welcome message showing the server address and Dify configuration 12 | - Enhance documentation and logging, including request logs when `RUST_LOG` is set to `debug` 13 | -------------------------------------------------------------------------------- /src/server/helper.rs: -------------------------------------------------------------------------------- 1 | use axum::{ 2 | http::{header, StatusCode}, 3 | response::{IntoResponse, Response}, 4 | }; 5 | use dify_client::Client as DifyClient; 6 | 7 | #[derive(Clone)] 8 | pub struct AppState { 9 | pub dify: DifyClient, 10 | } 11 | 12 | pub struct AppError(anyhow::Error); 13 | impl IntoResponse for AppError { 14 | fn into_response(self) -> Response { 15 | log::error!("{}", self.0); 16 | ( 17 | StatusCode::INTERNAL_SERVER_ERROR, 18 | [(header::CONTENT_TYPE, "application/json")], 19 | format!("{{\"error\": \"{}\"}}", self.0.to_string()), 20 | ) 21 | .into_response() 22 | } 23 | } 24 | 25 | impl From for AppError 26 | where 27 | E: Into, 28 | { 29 | fn from(err: E) -> Self { 30 | Self(err.into()) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/server/mod.rs: -------------------------------------------------------------------------------- 1 | mod helper; 2 | mod v1_handlers; 3 | 4 | use axum::{ 5 | http::HeaderMap, 6 | middleware, 7 | routing::{get, post}, 8 | Router, 9 | }; 10 | use dify_client::http::Method; 11 | use std::collections::HashMap; 12 | use tower::ServiceBuilder; 13 | use tower_http::cors::{Any, CorsLayer}; 14 | use v1_handlers::*; 15 | 16 | pub use helper::AppState; 17 | 18 | async fn html_handler() -> (HeaderMap, &'static [u8]) { 19 | let headers = HashMap::from([("Content-Type".to_string(), "application/json".to_string())]); 20 | ((&headers).try_into().unwrap(), "{}".as_bytes()) 21 | } 22 | 23 | pub fn app_routes() -> Router { 24 | let cors = CorsLayer::new() 25 | .allow_headers(Any) 26 | .allow_methods([Method::GET, Method::POST, Method::DELETE, Method::OPTIONS]) 27 | .allow_origin(Any); 28 | 29 | let v1_routes = Router::new() 30 | .route("/chat/completions", post(chat_completions_handler)) 31 | .route_layer(middleware::from_fn(check_method)) 32 | .layer(ServiceBuilder::new().layer(cors)); 33 | 34 | let app_routes = Router::new() 35 | .route("/", get(html_handler)) 36 | .nest("/v1", v1_routes); 37 | app_routes 38 | } 39 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dify-openai-apis" 3 | version = "0.1.8" 4 | edition = "2021" 5 | description = "OpenAI-compatible APIs for Dify platform services" 6 | license = "Apache-2.0" 7 | repository = "https://github.com/rming/dify-openai-apis" 8 | homepage = "https://github.com/rming/dify-openai-apis" 9 | documentation = "https://docs.rs/dify-openai-apis" 10 | categories = ["command-line-utilities", "web-programming::http-server"] 11 | keywords = ["dify", "openai", "llm", "api", "server"] 12 | rust-version = "1.71.1" 13 | 14 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 15 | 16 | [dependencies] 17 | dify-client = { version = "0.3", default-features = false, features = [ 18 | "rustls-tls", 19 | ] } 20 | axum = { version = "0.7", features = ["multipart", "macros"] } 21 | anyhow = "1" 22 | dotenvy = "0.15" 23 | env_logger = "0.11" 24 | log = "0.4" 25 | serde = "1" 26 | serde_json = "1" 27 | serde_repr = "0.1" 28 | tokio = { version = "1", features = ["macros", "rt-multi-thread"] } 29 | num_cpus = "1" 30 | strum = { version = "0.26", features = ["derive"] } 31 | futures = "0.3" 32 | tokio-stream = "0.1" 33 | tower-http = { version = "0.5", features = ["cors"] } 34 | tower = "0.4" 35 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | [English](./README.md) | 中文 2 | 3 | # dify-openai-apis 4 | 5 | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 6 | 7 | ## Description 8 | 9 | 适用于 Dify 平台服务的 OpenAI 兼容 API。 10 | 这个库提供了一套与 OpenAI 的 GPT-3 API 兼容的 API,可以用来与 Dify 的平台服务和工具进行交互。 11 | 12 | **注意:** 该应用程序目前不支持 OpenAI 的[Legacy Completions API](https://platform.openai.com/docs/api-reference/completions/create)。请使用[Chat Completion API](https://platform.openai.com/docs/api-reference/chat/create)。 13 | 14 | ## Config 15 | 16 | 配置可以通过 .env 文件或环境变量进行设置: 17 | 18 | - `HOST`:绑定服务器的主机。默认值:`127.0.0.1` 19 | - `PORT`:绑定服务器的端口。默认值:`3000` 20 | - `DIFY_BASE_URL`:Dify API 的基础 URL。默认值:`https://api.dify.ai` 21 | - `DIFY_API_KEY`:Dify API 的 API 密钥。默认值:`your_api_key` 22 | - `DIFY_TIMEOUT`:向 Dify API 发送请求的超时时间。默认值:`10` 23 | - `WORKERS_NUM`:要使用的工作线程数量。默认值:`4` 24 | - `RUST_LOG`:服务器的日志级别。默认值:`error` 25 | 26 | **注意:** 27 | 28 | - `DIFY_API_KEY` 是默认 API 密钥,如果用户在请求 API `/v1/chat/completions` 时通过 Bearer Token 传递了 API 密钥,则将覆盖此默认值。 29 | - `RUST_LOG` 是日志级别,默认值为 `error`,即只输出错误日志。如果要调试运行,建议设置为 `debug` 或 `trace`。 30 | 31 | ## Install 32 | 33 | 请到发布页面下载预编译版本:[Release page](https://github.com/rming/dify-openai-apis/releases) 34 | 35 | 也可以通过 `cargo` 命令安装 36 | 37 | ```sh 38 | # require cargo installed 39 | cargo install dify-openai-apis 40 | ``` 41 | 42 | ## Usage 43 | 44 | 要启动服务器,请运行: 45 | 46 | ```sh 47 | # require cargo bin directory in PATH 48 | # export PATH=$HOME/.cargo/bin:$PATH 49 | dify-openai-apis 50 | ``` 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | English | [中文](./README_CN.md) 2 | 3 | # dify-openai-apis 4 | 5 | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 6 | 7 | ## Description 8 | 9 | OpenAI-compatible APIs for Dify platform services. 10 | This crate provides a set of APIs that are compatible with OpenAI's GPT-3 API, and can be used to interact with Dify's platform services and tools. 11 | 12 | **Note:** The app currently does not support OpenAI's [Legacy Completions API](https://platform.openai.com/docs/api-reference/completions/create). Please use the [Chat Completion API](https://platform.openai.com/docs/api-reference/chat/create) instead. 13 | 14 | ## Config 15 | 16 | Configurations can be set via .env file or environment variables: 17 | 18 | - `HOST`: The host to bind the server to. Default: `127.0.0.1` 19 | - `PORT`: The port to bind the server to. Default: `3000` 20 | - `DIFY_BASE_URL`: The base URL of Dify's API. Default: `https://api.dify.ai` 21 | - `DIFY_API_KEY`: Your API key for Dify's API. Default: `your_api_key` 22 | - `DIFY_TIMEOUT`: The timeout for requests to Dify's API. Default: `10` 23 | - `WORKERS_NUM`: The number of worker threads to use. Default: `4` 24 | - `RUST_LOG`: The log level for the server. Default: `error` 25 | 26 | **Note:** 27 | 28 | - `DIFY_API_KEY` is the default API key. If a user provides an API key via Bearer Token when requesting the API `/v1/chat/completions`, it will override this default value. 29 | - `RUST_LOG` is the log level, with a default value of `error`, meaning only error logs will be output. If you want to debug, it is recommended to set it to `debug` or `trace`. 30 | 31 | ## Install 32 | 33 | Please download the precompiled binary from : [Release page](https://github.com/rming/dify-openai-apis/releases) 34 | 35 | You can also install it using the `cargo` command. 36 | 37 | ```sh 38 | # require cargo installed 39 | cargo install dify-openai-apis 40 | ``` 41 | 42 | ## Usage 43 | 44 | To start the server, run: 45 | 46 | ```sh 47 | # require cargo bin directory in PATH 48 | # export PATH=$HOME/.cargo/bin:$PATH 49 | dify-openai-apis 50 | ``` 51 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod server; 2 | use axum::Router; 3 | use dify_client::{Client as DifyClient, Config as DifyConfig}; 4 | use std::env; 5 | use std::time::Duration; 6 | use tokio::{net::TcpListener, runtime}; 7 | 8 | fn main() { 9 | let _ = dotenvy::dotenv(); 10 | env_logger::init(); 11 | 12 | let workers_num = env::var("WORKERS_NUM") 13 | .ok() 14 | .and_then(|f| f.parse::().ok()) 15 | .unwrap_or(num_cpus::get()); 16 | runtime::Builder::new_multi_thread() 17 | .worker_threads(workers_num) 18 | .enable_all() 19 | .build() 20 | .unwrap() 21 | .block_on(init_server()); 22 | } 23 | 24 | async fn init_server() { 25 | let host = env::var("HOST").unwrap_or("127.0.0.1".into()); 26 | let port = env::var("PORT").unwrap_or("3000".into()); 27 | let server_url = format!("{host}:{port}"); 28 | let dify_base_url = env::var("DIFY_BASE_URL").unwrap_or("https://api.dify.ai".into()); 29 | let dify_api_key = env::var("DIFY_API_KEY").unwrap_or("your_api_key".into()); 30 | let dify_timeout = env::var("DIFY_TIMEOUT") 31 | .ok() 32 | .and_then(|f| f.parse::().ok()) 33 | .unwrap_or(10); 34 | 35 | // dify client 36 | let dify = DifyClient::new_with_config(DifyConfig { 37 | base_url: dify_base_url.clone(), 38 | api_key: dify_api_key.clone(), 39 | timeout: Duration::from_secs(dify_timeout), 40 | }); 41 | 42 | // shared state 43 | let state = server::AppState { dify }; 44 | let app = Router::new().merge(server::app_routes()).with_state(state); 45 | 46 | let listener = TcpListener::bind(&server_url) 47 | .await 48 | .expect("Failed to bind to address"); 49 | 50 | show_welcome(&server_url, &dify_base_url, &dify_api_key, dify_timeout); 51 | 52 | axum::serve(listener, app).await.expect("Server Error"); 53 | } 54 | 55 | fn show_welcome(server_url: &str, dify_base_url: &str, dify_api_key: &str, dify_timeout: u64) { 56 | println!( 57 | r#"Welcome to the Dify OpenAI API Server! 58 | 59 | - Address Listen: {} 60 | - Dify Base URL: {} 61 | - Dify API Key: {} 62 | - Dify Timeout: {} seconds"#, 63 | server_url, dify_base_url, dify_api_key, dify_timeout 64 | ) 65 | } 66 | -------------------------------------------------------------------------------- /.github/workflows/release-plz.yml: -------------------------------------------------------------------------------- 1 | name: Release crate 2 | 3 | permissions: 4 | pull-requests: write 5 | contents: write 6 | 7 | on: 8 | push: 9 | branches: 10 | - main 11 | 12 | env: 13 | CARGO_INCREMENTAL: 0 14 | CARGO_NET_GIT_FETCH_WITH_CLI: true 15 | CARGO_NET_RETRY: 10 16 | CARGO_TERM_COLOR: always 17 | RUST_BACKTRACE: 1 18 | RUSTFLAGS: -D warnings 19 | RUSTUP_MAX_RETRIES: 10 20 | 21 | defaults: 22 | run: 23 | shell: bash 24 | 25 | jobs: 26 | release: 27 | name: Release-plz 28 | runs-on: ubuntu-latest 29 | outputs: 30 | releases_created: ${{ steps.release-plz.outputs.releases_created }} 31 | tag: ${{ fromJSON(steps.release-plz.outputs.releases)[0].tag }} 32 | steps: 33 | - name: Checkout repository 34 | uses: actions/checkout@v4 35 | with: 36 | fetch-depth: 0 37 | - name: Install Rust toolchain 38 | uses: dtolnay/rust-toolchain@stable 39 | - name: Run release-plz 40 | id: release-plz 41 | uses: MarcoIeni/release-plz-action@v0.5 42 | with: 43 | command: release 44 | manifest_path: Cargo.toml 45 | env: 46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 47 | CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} 48 | - name: Read release output 49 | env: 50 | TAG: ${{ fromJSON(steps.release-plz.outputs.releases)[0].tag }} 51 | RELEASES_CREATED: ${{ steps.release-plz.outputs.releases_created }} 52 | run: | 53 | set -e 54 | echo "releases_created: $RELEASES_CREATED" 55 | echo "release_tag: $TAG" 56 | 57 | upload-assets: 58 | name: ${{ matrix.target }} 59 | needs: release 60 | if: github.repository_owner == 'rming' && needs.release.outputs.releases_created == 'true' 61 | runs-on: ${{ matrix.os }} 62 | strategy: 63 | matrix: 64 | include: 65 | - target: aarch64-unknown-linux-gnu 66 | os: ubuntu-latest 67 | - target: aarch64-apple-darwin 68 | os: macos-latest 69 | - target: aarch64-pc-windows-msvc 70 | os: windows-latest 71 | - target: x86_64-unknown-linux-gnu 72 | os: ubuntu-latest 73 | - target: x86_64-apple-darwin 74 | os: macos-latest 75 | - target: x86_64-pc-windows-msvc 76 | os: windows-latest 77 | timeout-minutes: 60 78 | steps: 79 | - name: Checkout repository 80 | uses: actions/checkout@v4 81 | - name: Install Rust toolchain 82 | uses: dtolnay/rust-toolchain@stable 83 | - uses: taiki-e/setup-cross-toolchain-action@v1 84 | with: 85 | target: ${{ matrix.target }} 86 | if: startsWith(matrix.os, 'ubuntu') 87 | 88 | - name: RUSTFLAGS for Windows 89 | if: endsWith(matrix.target, 'windows-msvc') 90 | run: | 91 | echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}" 92 | 93 | - uses: taiki-e/upload-rust-binary-action@v1 94 | with: 95 | bin: dify-openai-apis 96 | target: ${{ matrix.target }} 97 | tar: all 98 | zip: windows 99 | token: ${{ secrets.GITHUB_TOKEN }} 100 | ref: "refs/tags/${{ needs.release.outputs.tag }}" 101 | -------------------------------------------------------------------------------- /src/server/v1_handlers.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | use super::helper::*; 4 | use anyhow::{anyhow, Error as AnyError}; 5 | use axum::{ 6 | extract::{Json, Request, State}, 7 | http::{HeaderMap, Method, StatusCode}, 8 | middleware::Next, 9 | response::{ 10 | sse::{Event as SseEvent, KeepAlive, Sse}, 11 | IntoResponse, Response, 12 | }, 13 | }; 14 | use dify_client::{ 15 | api::Api, 16 | http::{header, Request as HttpRequest}, 17 | request::ChatMessagesRequest, 18 | response::{ErrorResponse, SseMessageEvent}, 19 | }; 20 | use futures::stream; 21 | use serde::{Deserialize, Serialize}; 22 | use serde_json::Value as JsonValue; 23 | use tokio_stream::StreamExt; 24 | 25 | /// Checks if the request method is OPTIONS. 26 | /// If the request method is OPTIONS, it returns a 204 No Content response. 27 | /// If the request method is not OPTIONS, it calls the next middleware. 28 | /// This function is called before the chat completions handler. 29 | /// It is used to handle preflight requests. 30 | pub async fn check_method(req: Request, next: Next) -> Result { 31 | if req.method() == Method::OPTIONS { 32 | Err(StatusCode::NO_CONTENT) 33 | } else { 34 | Ok(next.run(req).await) 35 | } 36 | } 37 | 38 | #[allow(dead_code)] 39 | #[derive(Deserialize, Debug)] 40 | pub struct ChatCompletionRequest { 41 | /// The messages 42 | /// A list of messages comprising the conversation so far. 43 | /// Example: [ 44 | /// {"role": "user", "content": "Hello, how are you?"}, 45 | /// {"role": "system", "content": "I'm doing well, thank you."}, 46 | /// {"role": "user", "content": "That's great to hear. How can I help you today?"} 47 | /// ] 48 | messages: Vec, 49 | /// ID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API. 50 | /// Example: "gpt-3.5-turbo" 51 | model: String, 52 | /// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. 53 | /// Default: 0.0 54 | frequency_penalty: Option, 55 | /// Modify the likelihood of specified tokens appearing in the completion. 56 | logit_bias: Option, 57 | /// Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. 58 | /// Default: false 59 | logprobs: Option, 60 | /// An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. 61 | /// Default: 0 62 | top_logprobs: Option, 63 | /// The maximum number of tokens that can be generated in the chat completion. 64 | /// The total length of input tokens and generated tokens is limited by the model's context length. 65 | max_tokens: Option, 66 | /// How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs. 67 | /// Default: 1 68 | n: Option, 69 | /// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. 70 | /// Default: 0.0 71 | presence_penalty: Option, 72 | /// An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. 73 | /// Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON. 74 | /// Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length. 75 | /// Example: {"type": "json_object"} 76 | response_format: Option, 77 | /// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend. 78 | /// Default: null 79 | seed: Option, 80 | /// Up to 4 sequences where the API will stop generating further tokens. 81 | stop: Option, 82 | /// If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. 83 | /// Default: false 84 | stream: Option, 85 | /// Options for streaming response. Only set this when you set stream: true. 86 | /// Default: null 87 | stream_options: Option, 88 | /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. 89 | /// Default: 1.0 90 | temperature: Option, 91 | /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. 92 | /// Default: 1.0 93 | top_p: Option, 94 | /// A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. 95 | tools: Option, 96 | /// Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool. 97 | /// none is the default when no tools are present. auto is the default if tools are present. 98 | tool_choice: Option, 99 | /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more. 100 | /// Example: "apiuser" 101 | user: Option, 102 | /// Deprecated in favor of tool_choice. 103 | /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. Specifying a particular function via {"name": "my_function"} forces the model to call that function. 104 | function_call: Option, 105 | /// Deprecated in favor of tools. 106 | /// A list of functions the model may generate JSON inputs for. 107 | functions: Option, 108 | } 109 | 110 | /// An object specifying the format that the model must output. 111 | #[allow(dead_code)] 112 | #[derive(Debug, Deserialize)] 113 | pub struct ResponseFormat { 114 | #[serde(rename = "type")] 115 | type_: ResponseFormatType, 116 | } 117 | 118 | /// The format that the model must output. 119 | /// Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON. 120 | #[derive(Debug, Deserialize)] 121 | #[serde(rename_all = "snake_case")] 122 | pub enum ResponseFormatType { 123 | JsonObject, 124 | Text, 125 | } 126 | 127 | /// Options for streaming response. 128 | #[allow(dead_code)] 129 | #[derive(Deserialize, Debug)] 130 | pub struct StreamOptions { 131 | include_usage: Option, 132 | } 133 | 134 | /// A message in the conversation. 135 | #[derive(Serialize, Deserialize, Debug, Default)] 136 | pub struct Message { 137 | /// The role of the message. 138 | role: Role, 139 | /// The content of the message. 140 | content: String, 141 | } 142 | 143 | #[derive(Serialize, Deserialize, Debug, Default, strum::Display)] 144 | #[strum(serialize_all = "snake_case")] 145 | #[serde(rename_all = "snake_case")] 146 | pub enum Role { 147 | User, 148 | System, 149 | #[default] 150 | Assistant, 151 | Tool, 152 | Function, 153 | } 154 | 155 | /// The chat completion struct 156 | /// Represents a chat completion response returned by model, based on the provided input. 157 | #[derive(Serialize, Debug, Default)] 158 | pub struct ChatCompletionResponse { 159 | /// A unique identifier for the chat completion. 160 | id: String, 161 | /// A list of chat completion choices. Can be more than one if n is greater than 1. 162 | choices: Vec, 163 | /// The Unix timestamp (in seconds) of when the chat completion was created. 164 | created: u64, 165 | /// The model used for the chat completion. 166 | model: String, 167 | /// This fingerprint represents the backend configuration that the model runs with. 168 | /// Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism. 169 | system_fingerprint: String, 170 | /// The object type, which is always chat.completion. 171 | object: ObjectKind, 172 | /// Usage statistics for the completion request. 173 | usage: Usage, 174 | } 175 | 176 | #[derive(Serialize, Deserialize, Debug, Default)] 177 | pub enum ObjectKind { 178 | #[default] 179 | #[serde(rename = "chat.completion")] 180 | ChatCompletion, 181 | #[serde(rename = "chat.completion.chunk")] 182 | ChatCompletionChunk, 183 | } 184 | 185 | /// A chat completion choice. 186 | /// Represents a chat completion choice returned by the model. 187 | #[derive(Serialize, Debug, Default)] 188 | pub struct ChatCompletionChoice { 189 | /// The index of the choice in the list of choices. 190 | index: u64, 191 | /// The reason the model stopped generating tokens. 192 | finish_reason: FinishReason, 193 | /// The log probability of the choice. 194 | logprobs: Option, 195 | /// The text of the choice. 196 | message: Message, 197 | } 198 | 199 | /// The reason the model stopped generating tokens. 200 | #[allow(dead_code)] 201 | #[derive(Serialize, Debug, Default)] 202 | #[serde(rename_all = "snake_case")] 203 | pub enum FinishReason { 204 | /// If the model hit a natural stop point or a provided stop sequence. 205 | #[default] 206 | Stop, 207 | /// If the maximum number of tokens specified in the request was reached. 208 | Length, 209 | /// If content was omitted due to a flag from our content filters. 210 | ContentFilter, 211 | /// If the model called a tool. 212 | ToolCalls, 213 | /// (deprecated) If the model called a function. 214 | FunctionCall, 215 | } 216 | 217 | /// Usage statistics for the completion request. 218 | /// Represents the usage statistics for a chat completion request. 219 | #[derive(Serialize, Debug, Default)] 220 | pub struct Usage { 221 | /// Number of tokens in the generated completion. 222 | completion_tokens: u64, 223 | /// Number of tokens in the prompt. 224 | prompt_tokens: u64, 225 | /// Total number of tokens used in the request (prompt + completion). 226 | total_tokens: u64, 227 | } 228 | 229 | // The chat completion chunk object 230 | // Represents a streamed chunk of a chat completion response returned by model, based on the provided input. 231 | #[derive(Serialize, Debug, Default)] 232 | pub struct ChatCompletionChunkResponse { 233 | /// A unique identifier for the chat completion. Each chunk has the same ID. 234 | id: String, 235 | /// A list of chat completion choices. Can contain more than one elements if n is greater than 1. Can also be empty for the last chunk if you set stream_options: {"include_usage": true}. 236 | choices: Vec, 237 | /// The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. 238 | created: u64, 239 | /// The model to generate the completion. 240 | model: String, 241 | /// This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism. 242 | system_fingerprint: String, 243 | /// The object type, which is always chat.completion.chunk. 244 | object: ObjectKind, 245 | /// An optional field that will only be present when you set stream_options: {"include_usage": true} in your request. When present, it contains a null value except for the last chunk which contains the token usage statistics for the entire request. 246 | usage: Option, 247 | } 248 | 249 | #[derive(Serialize, Debug, Default)] 250 | pub struct ChatCompletionChunkChoice { 251 | /// The index of the choice in the list of choices. 252 | index: u64, 253 | /// The reason the model stopped generating tokens. 254 | finish_reason: Option, 255 | /// The log probability of the choice. 256 | logprobs: Option, 257 | /// A chat completion delta generated by streamed model responses. 258 | delta: JsonValue, 259 | } 260 | 261 | /// Extracts the Bearer token from the Authorization header. 262 | fn get_bearer_token(headers: &HeaderMap) -> Result { 263 | let auth_header = headers.get(header::AUTHORIZATION); 264 | let token = auth_header 265 | .ok_or(anyhow!("Authorization header not found"))? 266 | .to_str() 267 | .map_err(|_| anyhow!("Authorization header is not a valid string"))? 268 | .split(' ') 269 | .nth(1) 270 | .ok_or(anyhow!("Bearer Token not found"))?; 271 | Ok(token.to_owned()) 272 | } 273 | 274 | /// Sets the Authorization header with a Bearer token. 275 | fn set_bearer_auth(mut req: HttpRequest, token: &str) -> HttpRequest { 276 | let mut bearer_auth = header::HeaderValue::from_str(&format!("Bearer {}", token)).unwrap(); 277 | bearer_auth.set_sensitive(true); 278 | req.headers_mut().insert(header::AUTHORIZATION, bearer_auth); 279 | req 280 | } 281 | 282 | /// Parses a JSON value as a u64. 283 | /// If the value is not a number, it returns 0. 284 | fn parse_as_u64(value: Option<&JsonValue>) -> u64 { 285 | value.and_then(|v| v.as_u64()).unwrap_or_default() 286 | } 287 | 288 | /// Handles the chat completions request. 289 | /// This function is called when the client sends a POST request to /chat_completions. 290 | pub async fn chat_completions_handler( 291 | headers: HeaderMap, 292 | State(state): State, 293 | Json(payload): Json, 294 | ) -> Result { 295 | // Constructs a query string that includes the talk history and a question. 296 | let messages = payload.messages; 297 | let last_message = messages.last().ok_or(anyhow!("No messages provided"))?; 298 | let query_string = format!( 299 | "here is our talk history:\n'''\n{}\n'''\n\nhere is my question:\n{}", 300 | messages 301 | .iter() 302 | .take(messages.len() - 1) 303 | .map(|message| format!("{}: {}", message.role, message.content)) 304 | .collect::>() 305 | .join("\n"), 306 | last_message.content 307 | ); 308 | 309 | let req_data = ChatMessagesRequest { 310 | query: query_string, 311 | user: payload.user.unwrap_or("unknow_user".into()), 312 | auto_generate_name: false, 313 | ..Default::default() 314 | }; 315 | let mut api = state.dify.api(); 316 | let token = get_bearer_token(&headers).ok(); 317 | if let Some(token) = token { 318 | log::debug!("User Custom Token: {}", token); 319 | api.before_send(move |req| set_bearer_auth(req, token.as_str())); 320 | } 321 | 322 | if payload.stream.is_none() || !payload.stream.unwrap() { 323 | // Blocking chat completions 324 | chat_completions(&api, req_data.clone(), payload.model.as_str()).await 325 | } else { 326 | // Stream the chat completions 327 | chat_completions_stream(&api, req_data.clone(), payload.model.as_str()).await 328 | } 329 | } 330 | 331 | /// Handles the chat completions request. 332 | /// It uses the `Api` instance from the `AppState` to send a request to the OpenAI API. 333 | /// It returns a response with the chat completions. 334 | async fn chat_completions<'a>( 335 | api: &Api<'a>, 336 | req_data: ChatMessagesRequest, 337 | model: &'a str, 338 | ) -> Result { 339 | log::debug!("Chat Completions Block Request: {:?}", req_data); 340 | let system_fingerprint = String::from("fp_44709d6fcb"); 341 | let resp = api.chat_messages(req_data).await.map_err(|e| { 342 | e.downcast::() 343 | .and_then(|err_resp| Err(anyhow!(err_resp.message))) 344 | .unwrap_or_else(|e| anyhow!(e)) 345 | })?; 346 | let usage = resp.metadata.get("usage").unwrap_or(&JsonValue::Null); 347 | let response = ChatCompletionResponse { 348 | id: resp.base.message_id, 349 | choices: vec![ChatCompletionChoice { 350 | message: Message { 351 | role: Role::Assistant, 352 | content: resp.answer, 353 | }, 354 | ..Default::default() 355 | }], 356 | created: resp.base.created_at, 357 | model: model.to_owned(), 358 | system_fingerprint, 359 | object: ObjectKind::ChatCompletion, 360 | usage: Usage { 361 | completion_tokens: parse_as_u64(usage.get("completion_tokens")), 362 | prompt_tokens: parse_as_u64(usage.get("prompt_tokens")), 363 | total_tokens: parse_as_u64(usage.get("total_tokens")), 364 | }, 365 | }; 366 | return Ok(serde_json::to_string(&response)?.into_response()); 367 | } 368 | 369 | /// Handles the chat completions stream request. 370 | /// It streams the chat completions to the client. 371 | /// The client can use the stream to display the chat completions in real-time. 372 | async fn chat_completions_stream<'a>( 373 | api: &Api<'a>, 374 | req_data: ChatMessagesRequest, 375 | model: &'a str, 376 | ) -> Result { 377 | log::debug!("Chat Completions Streaming Request: {:?}", req_data); 378 | let system_fingerprint = String::from("fp_44709d6fcb"); 379 | let stream = api.chat_messages_stream(req_data).await?; 380 | let model = model.to_owned(); 381 | 382 | let alive_duration = Duration::from_secs(30); 383 | let stream_default = stream::iter([SseEvent::default() 384 | .comment("streaming chat completions") 385 | .retry(alive_duration)]); 386 | let stream_msg = stream.map(move |result| match result { 387 | Ok(event) => match event { 388 | SseMessageEvent::Message { 389 | answer, id, base, .. 390 | } 391 | | SseMessageEvent::AgentMessage { 392 | answer, id, base, .. 393 | } => { 394 | let base_ref = base.as_ref(); 395 | let message_id = base_ref.map(|b| b.message_id.clone()).unwrap_or(id); 396 | let created_at = base_ref.map(|b| b.created_at.clone()).unwrap_or(0); 397 | let response = ChatCompletionChunkResponse { 398 | id: message_id, 399 | choices: vec![ChatCompletionChunkChoice { 400 | delta: serde_json::json!(Message { 401 | role: Role::Assistant, 402 | content: answer, 403 | }), 404 | ..Default::default() 405 | }], 406 | created: created_at, 407 | model: model.clone(), 408 | system_fingerprint: system_fingerprint.clone(), 409 | object: ObjectKind::ChatCompletionChunk, 410 | usage: None, 411 | }; 412 | SseEvent::default().json_data(response).unwrap() 413 | } 414 | SseMessageEvent::MessageEnd { 415 | id, base, metadata, .. 416 | } => { 417 | let base_ref = base.as_ref(); 418 | let message_id = base_ref.map(|b| b.message_id.clone()).unwrap_or(id); 419 | let created_at = base_ref.map(|b| b.created_at.clone()).unwrap_or(0); 420 | let usage = metadata.get("usage").unwrap_or(&JsonValue::Null); 421 | let response = ChatCompletionChunkResponse { 422 | id: message_id, 423 | choices: vec![ChatCompletionChunkChoice { 424 | delta: serde_json::json!({}), 425 | finish_reason: Some(FinishReason::Stop), 426 | ..Default::default() 427 | }], 428 | created: created_at, 429 | model: model.clone(), 430 | system_fingerprint: system_fingerprint.clone(), 431 | object: ObjectKind::ChatCompletionChunk, 432 | usage: Some(Usage { 433 | completion_tokens: parse_as_u64(usage.get("completion_tokens")), 434 | prompt_tokens: parse_as_u64(usage.get("prompt_tokens")), 435 | total_tokens: parse_as_u64(usage.get("total_tokens")), 436 | }), 437 | }; 438 | SseEvent::default().json_data(response).unwrap() 439 | } 440 | SseMessageEvent::Error { message, .. } => { 441 | let message = format!("upstream: {message}"); 442 | let err = serde_json::json!({ "error": {"message":message} }); 443 | SseEvent::default().json_data(err).unwrap() 444 | } 445 | _ => { 446 | let event_name = serde_json::json!(event) 447 | .get("event") 448 | .map(|v| v.to_string()) 449 | .unwrap_or("unknown".into()); 450 | let comment = format!("skip dify message event: {}", event_name.trim_matches('"')); 451 | SseEvent::default().comment(comment) 452 | } 453 | }, 454 | Err(e) => { 455 | let message = format!("upstream: {}", e.to_string()); 456 | let err = serde_json::json!({ "error": {"message": message }}); 457 | SseEvent::default().json_data(err).unwrap() 458 | } 459 | }); 460 | let stream_end = stream::iter([SseEvent::default().data("[DONE]")]); 461 | let stream = stream_default.chain(stream_msg).chain(stream_end); 462 | Ok(Sse::new(stream.map(Ok::<_, AnyError>)) 463 | .keep_alive(KeepAlive::default().interval(alive_duration)) 464 | .into_response()) 465 | } 466 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.22.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.1.3" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "android-tzdata" 31 | version = "0.1.1" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 34 | 35 | [[package]] 36 | name = "android_system_properties" 37 | version = "0.1.5" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 40 | dependencies = [ 41 | "libc", 42 | ] 43 | 44 | [[package]] 45 | name = "anstream" 46 | version = "0.6.14" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" 49 | dependencies = [ 50 | "anstyle", 51 | "anstyle-parse", 52 | "anstyle-query", 53 | "anstyle-wincon", 54 | "colorchoice", 55 | "is_terminal_polyfill", 56 | "utf8parse", 57 | ] 58 | 59 | [[package]] 60 | name = "anstyle" 61 | version = "1.0.7" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" 64 | 65 | [[package]] 66 | name = "anstyle-parse" 67 | version = "0.2.4" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" 70 | dependencies = [ 71 | "utf8parse", 72 | ] 73 | 74 | [[package]] 75 | name = "anstyle-query" 76 | version = "1.0.3" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" 79 | dependencies = [ 80 | "windows-sys 0.52.0", 81 | ] 82 | 83 | [[package]] 84 | name = "anstyle-wincon" 85 | version = "3.0.3" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" 88 | dependencies = [ 89 | "anstyle", 90 | "windows-sys 0.52.0", 91 | ] 92 | 93 | [[package]] 94 | name = "anyhow" 95 | version = "1.0.86" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" 98 | 99 | [[package]] 100 | name = "async-trait" 101 | version = "0.1.80" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" 104 | dependencies = [ 105 | "proc-macro2", 106 | "quote", 107 | "syn", 108 | ] 109 | 110 | [[package]] 111 | name = "autocfg" 112 | version = "1.3.0" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 115 | 116 | [[package]] 117 | name = "axum" 118 | version = "0.7.5" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" 121 | dependencies = [ 122 | "async-trait", 123 | "axum-core", 124 | "axum-macros", 125 | "bytes", 126 | "futures-util", 127 | "http", 128 | "http-body", 129 | "http-body-util", 130 | "hyper", 131 | "hyper-util", 132 | "itoa", 133 | "matchit", 134 | "memchr", 135 | "mime", 136 | "multer", 137 | "percent-encoding", 138 | "pin-project-lite", 139 | "rustversion", 140 | "serde", 141 | "serde_json", 142 | "serde_path_to_error", 143 | "serde_urlencoded", 144 | "sync_wrapper 1.0.1", 145 | "tokio", 146 | "tower", 147 | "tower-layer", 148 | "tower-service", 149 | "tracing", 150 | ] 151 | 152 | [[package]] 153 | name = "axum-core" 154 | version = "0.4.3" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" 157 | dependencies = [ 158 | "async-trait", 159 | "bytes", 160 | "futures-util", 161 | "http", 162 | "http-body", 163 | "http-body-util", 164 | "mime", 165 | "pin-project-lite", 166 | "rustversion", 167 | "sync_wrapper 0.1.2", 168 | "tower-layer", 169 | "tower-service", 170 | "tracing", 171 | ] 172 | 173 | [[package]] 174 | name = "axum-macros" 175 | version = "0.4.1" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" 178 | dependencies = [ 179 | "heck", 180 | "proc-macro2", 181 | "quote", 182 | "syn", 183 | ] 184 | 185 | [[package]] 186 | name = "backtrace" 187 | version = "0.3.72" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" 190 | dependencies = [ 191 | "addr2line", 192 | "cc", 193 | "cfg-if", 194 | "libc", 195 | "miniz_oxide", 196 | "object", 197 | "rustc-demangle", 198 | ] 199 | 200 | [[package]] 201 | name = "base64" 202 | version = "0.22.1" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 205 | 206 | [[package]] 207 | name = "bitflags" 208 | version = "2.5.0" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 211 | 212 | [[package]] 213 | name = "bumpalo" 214 | version = "3.16.0" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 217 | 218 | [[package]] 219 | name = "byteorder" 220 | version = "1.5.0" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 223 | 224 | [[package]] 225 | name = "bytes" 226 | version = "1.6.0" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" 229 | 230 | [[package]] 231 | name = "cc" 232 | version = "1.0.98" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" 235 | 236 | [[package]] 237 | name = "cfb" 238 | version = "0.7.3" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" 241 | dependencies = [ 242 | "byteorder", 243 | "fnv", 244 | "uuid", 245 | ] 246 | 247 | [[package]] 248 | name = "cfg-if" 249 | version = "1.0.0" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 252 | 253 | [[package]] 254 | name = "chrono" 255 | version = "0.4.38" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" 258 | dependencies = [ 259 | "android-tzdata", 260 | "iana-time-zone", 261 | "num-traits", 262 | "serde", 263 | "windows-targets 0.52.5", 264 | ] 265 | 266 | [[package]] 267 | name = "colorchoice" 268 | version = "1.0.1" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" 271 | 272 | [[package]] 273 | name = "core-foundation-sys" 274 | version = "0.8.6" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 277 | 278 | [[package]] 279 | name = "darling" 280 | version = "0.20.9" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" 283 | dependencies = [ 284 | "darling_core", 285 | "darling_macro", 286 | ] 287 | 288 | [[package]] 289 | name = "darling_core" 290 | version = "0.20.9" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" 293 | dependencies = [ 294 | "fnv", 295 | "ident_case", 296 | "proc-macro2", 297 | "quote", 298 | "strsim", 299 | "syn", 300 | ] 301 | 302 | [[package]] 303 | name = "darling_macro" 304 | version = "0.20.9" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" 307 | dependencies = [ 308 | "darling_core", 309 | "quote", 310 | "syn", 311 | ] 312 | 313 | [[package]] 314 | name = "deranged" 315 | version = "0.3.11" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 318 | dependencies = [ 319 | "powerfmt", 320 | "serde", 321 | ] 322 | 323 | [[package]] 324 | name = "dify-client" 325 | version = "0.3.1" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "4b1c979979e964a49ff73781776f9f9999343a0ab6f7e5676b966f98a2e95bc9" 328 | dependencies = [ 329 | "anyhow", 330 | "bytes", 331 | "eventsource-stream", 332 | "futures", 333 | "infer", 334 | "pin-project-lite", 335 | "reqwest", 336 | "serde", 337 | "serde_json", 338 | "serde_with", 339 | ] 340 | 341 | [[package]] 342 | name = "dify-openai-apis" 343 | version = "0.1.8" 344 | dependencies = [ 345 | "anyhow", 346 | "axum", 347 | "dify-client", 348 | "dotenvy", 349 | "env_logger", 350 | "futures", 351 | "log", 352 | "num_cpus", 353 | "serde", 354 | "serde_json", 355 | "serde_repr", 356 | "strum", 357 | "tokio", 358 | "tokio-stream", 359 | "tower", 360 | "tower-http", 361 | ] 362 | 363 | [[package]] 364 | name = "dotenvy" 365 | version = "0.15.7" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" 368 | 369 | [[package]] 370 | name = "encoding_rs" 371 | version = "0.8.34" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" 374 | dependencies = [ 375 | "cfg-if", 376 | ] 377 | 378 | [[package]] 379 | name = "env_filter" 380 | version = "0.1.0" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" 383 | dependencies = [ 384 | "log", 385 | "regex", 386 | ] 387 | 388 | [[package]] 389 | name = "env_logger" 390 | version = "0.11.3" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" 393 | dependencies = [ 394 | "anstream", 395 | "anstyle", 396 | "env_filter", 397 | "humantime", 398 | "log", 399 | ] 400 | 401 | [[package]] 402 | name = "equivalent" 403 | version = "1.0.1" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 406 | 407 | [[package]] 408 | name = "eventsource-stream" 409 | version = "0.2.3" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" 412 | dependencies = [ 413 | "futures-core", 414 | "nom", 415 | "pin-project-lite", 416 | ] 417 | 418 | [[package]] 419 | name = "fnv" 420 | version = "1.0.7" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 423 | 424 | [[package]] 425 | name = "form_urlencoded" 426 | version = "1.2.1" 427 | source = "registry+https://github.com/rust-lang/crates.io-index" 428 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 429 | dependencies = [ 430 | "percent-encoding", 431 | ] 432 | 433 | [[package]] 434 | name = "futures" 435 | version = "0.3.30" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" 438 | dependencies = [ 439 | "futures-channel", 440 | "futures-core", 441 | "futures-executor", 442 | "futures-io", 443 | "futures-sink", 444 | "futures-task", 445 | "futures-util", 446 | ] 447 | 448 | [[package]] 449 | name = "futures-channel" 450 | version = "0.3.30" 451 | source = "registry+https://github.com/rust-lang/crates.io-index" 452 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 453 | dependencies = [ 454 | "futures-core", 455 | "futures-sink", 456 | ] 457 | 458 | [[package]] 459 | name = "futures-core" 460 | version = "0.3.30" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 463 | 464 | [[package]] 465 | name = "futures-executor" 466 | version = "0.3.30" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" 469 | dependencies = [ 470 | "futures-core", 471 | "futures-task", 472 | "futures-util", 473 | ] 474 | 475 | [[package]] 476 | name = "futures-io" 477 | version = "0.3.30" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" 480 | 481 | [[package]] 482 | name = "futures-macro" 483 | version = "0.3.30" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" 486 | dependencies = [ 487 | "proc-macro2", 488 | "quote", 489 | "syn", 490 | ] 491 | 492 | [[package]] 493 | name = "futures-sink" 494 | version = "0.3.30" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 497 | 498 | [[package]] 499 | name = "futures-task" 500 | version = "0.3.30" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 503 | 504 | [[package]] 505 | name = "futures-util" 506 | version = "0.3.30" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 509 | dependencies = [ 510 | "futures-channel", 511 | "futures-core", 512 | "futures-io", 513 | "futures-macro", 514 | "futures-sink", 515 | "futures-task", 516 | "memchr", 517 | "pin-project-lite", 518 | "pin-utils", 519 | "slab", 520 | ] 521 | 522 | [[package]] 523 | name = "getrandom" 524 | version = "0.2.15" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 527 | dependencies = [ 528 | "cfg-if", 529 | "libc", 530 | "wasi", 531 | ] 532 | 533 | [[package]] 534 | name = "gimli" 535 | version = "0.29.0" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" 538 | 539 | [[package]] 540 | name = "hashbrown" 541 | version = "0.12.3" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 544 | 545 | [[package]] 546 | name = "hashbrown" 547 | version = "0.14.5" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 550 | 551 | [[package]] 552 | name = "heck" 553 | version = "0.4.1" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 556 | 557 | [[package]] 558 | name = "hermit-abi" 559 | version = "0.3.9" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 562 | 563 | [[package]] 564 | name = "hex" 565 | version = "0.4.3" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 568 | 569 | [[package]] 570 | name = "http" 571 | version = "1.1.0" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 574 | dependencies = [ 575 | "bytes", 576 | "fnv", 577 | "itoa", 578 | ] 579 | 580 | [[package]] 581 | name = "http-body" 582 | version = "1.0.0" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" 585 | dependencies = [ 586 | "bytes", 587 | "http", 588 | ] 589 | 590 | [[package]] 591 | name = "http-body-util" 592 | version = "0.1.1" 593 | source = "registry+https://github.com/rust-lang/crates.io-index" 594 | checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" 595 | dependencies = [ 596 | "bytes", 597 | "futures-core", 598 | "http", 599 | "http-body", 600 | "pin-project-lite", 601 | ] 602 | 603 | [[package]] 604 | name = "httparse" 605 | version = "1.8.0" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 608 | 609 | [[package]] 610 | name = "httpdate" 611 | version = "1.0.3" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 614 | 615 | [[package]] 616 | name = "humantime" 617 | version = "2.1.0" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 620 | 621 | [[package]] 622 | name = "hyper" 623 | version = "1.3.1" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" 626 | dependencies = [ 627 | "bytes", 628 | "futures-channel", 629 | "futures-util", 630 | "http", 631 | "http-body", 632 | "httparse", 633 | "httpdate", 634 | "itoa", 635 | "pin-project-lite", 636 | "smallvec", 637 | "tokio", 638 | "want", 639 | ] 640 | 641 | [[package]] 642 | name = "hyper-rustls" 643 | version = "0.26.0" 644 | source = "registry+https://github.com/rust-lang/crates.io-index" 645 | checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" 646 | dependencies = [ 647 | "futures-util", 648 | "http", 649 | "hyper", 650 | "hyper-util", 651 | "rustls", 652 | "rustls-pki-types", 653 | "tokio", 654 | "tokio-rustls", 655 | "tower-service", 656 | ] 657 | 658 | [[package]] 659 | name = "hyper-util" 660 | version = "0.1.5" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" 663 | dependencies = [ 664 | "bytes", 665 | "futures-channel", 666 | "futures-util", 667 | "http", 668 | "http-body", 669 | "hyper", 670 | "pin-project-lite", 671 | "socket2", 672 | "tokio", 673 | "tower", 674 | "tower-service", 675 | "tracing", 676 | ] 677 | 678 | [[package]] 679 | name = "iana-time-zone" 680 | version = "0.1.60" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 683 | dependencies = [ 684 | "android_system_properties", 685 | "core-foundation-sys", 686 | "iana-time-zone-haiku", 687 | "js-sys", 688 | "wasm-bindgen", 689 | "windows-core", 690 | ] 691 | 692 | [[package]] 693 | name = "iana-time-zone-haiku" 694 | version = "0.1.2" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 697 | dependencies = [ 698 | "cc", 699 | ] 700 | 701 | [[package]] 702 | name = "ident_case" 703 | version = "1.0.1" 704 | source = "registry+https://github.com/rust-lang/crates.io-index" 705 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 706 | 707 | [[package]] 708 | name = "idna" 709 | version = "0.5.0" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 712 | dependencies = [ 713 | "unicode-bidi", 714 | "unicode-normalization", 715 | ] 716 | 717 | [[package]] 718 | name = "indexmap" 719 | version = "1.9.3" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 722 | dependencies = [ 723 | "autocfg", 724 | "hashbrown 0.12.3", 725 | "serde", 726 | ] 727 | 728 | [[package]] 729 | name = "indexmap" 730 | version = "2.2.6" 731 | source = "registry+https://github.com/rust-lang/crates.io-index" 732 | checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" 733 | dependencies = [ 734 | "equivalent", 735 | "hashbrown 0.14.5", 736 | "serde", 737 | ] 738 | 739 | [[package]] 740 | name = "infer" 741 | version = "0.15.0" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" 744 | dependencies = [ 745 | "cfb", 746 | ] 747 | 748 | [[package]] 749 | name = "ipnet" 750 | version = "2.9.0" 751 | source = "registry+https://github.com/rust-lang/crates.io-index" 752 | checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" 753 | 754 | [[package]] 755 | name = "is_terminal_polyfill" 756 | version = "1.70.0" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" 759 | 760 | [[package]] 761 | name = "itoa" 762 | version = "1.0.11" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 765 | 766 | [[package]] 767 | name = "js-sys" 768 | version = "0.3.69" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 771 | dependencies = [ 772 | "wasm-bindgen", 773 | ] 774 | 775 | [[package]] 776 | name = "libc" 777 | version = "0.2.155" 778 | source = "registry+https://github.com/rust-lang/crates.io-index" 779 | checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 780 | 781 | [[package]] 782 | name = "log" 783 | version = "0.4.21" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 786 | 787 | [[package]] 788 | name = "matchit" 789 | version = "0.7.3" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 792 | 793 | [[package]] 794 | name = "memchr" 795 | version = "2.7.2" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 798 | 799 | [[package]] 800 | name = "mime" 801 | version = "0.3.17" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 804 | 805 | [[package]] 806 | name = "mime_guess" 807 | version = "2.0.4" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" 810 | dependencies = [ 811 | "mime", 812 | "unicase", 813 | ] 814 | 815 | [[package]] 816 | name = "minimal-lexical" 817 | version = "0.2.1" 818 | source = "registry+https://github.com/rust-lang/crates.io-index" 819 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 820 | 821 | [[package]] 822 | name = "miniz_oxide" 823 | version = "0.7.3" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" 826 | dependencies = [ 827 | "adler", 828 | ] 829 | 830 | [[package]] 831 | name = "mio" 832 | version = "0.8.11" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" 835 | dependencies = [ 836 | "libc", 837 | "wasi", 838 | "windows-sys 0.48.0", 839 | ] 840 | 841 | [[package]] 842 | name = "multer" 843 | version = "3.1.0" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" 846 | dependencies = [ 847 | "bytes", 848 | "encoding_rs", 849 | "futures-util", 850 | "http", 851 | "httparse", 852 | "memchr", 853 | "mime", 854 | "spin", 855 | "version_check", 856 | ] 857 | 858 | [[package]] 859 | name = "nom" 860 | version = "7.1.3" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 863 | dependencies = [ 864 | "memchr", 865 | "minimal-lexical", 866 | ] 867 | 868 | [[package]] 869 | name = "num-conv" 870 | version = "0.1.0" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 873 | 874 | [[package]] 875 | name = "num-traits" 876 | version = "0.2.19" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 879 | dependencies = [ 880 | "autocfg", 881 | ] 882 | 883 | [[package]] 884 | name = "num_cpus" 885 | version = "1.16.0" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 888 | dependencies = [ 889 | "hermit-abi", 890 | "libc", 891 | ] 892 | 893 | [[package]] 894 | name = "object" 895 | version = "0.35.0" 896 | source = "registry+https://github.com/rust-lang/crates.io-index" 897 | checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" 898 | dependencies = [ 899 | "memchr", 900 | ] 901 | 902 | [[package]] 903 | name = "once_cell" 904 | version = "1.19.0" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 907 | 908 | [[package]] 909 | name = "percent-encoding" 910 | version = "2.3.1" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 913 | 914 | [[package]] 915 | name = "pin-project" 916 | version = "1.1.5" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" 919 | dependencies = [ 920 | "pin-project-internal", 921 | ] 922 | 923 | [[package]] 924 | name = "pin-project-internal" 925 | version = "1.1.5" 926 | source = "registry+https://github.com/rust-lang/crates.io-index" 927 | checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" 928 | dependencies = [ 929 | "proc-macro2", 930 | "quote", 931 | "syn", 932 | ] 933 | 934 | [[package]] 935 | name = "pin-project-lite" 936 | version = "0.2.14" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 939 | 940 | [[package]] 941 | name = "pin-utils" 942 | version = "0.1.0" 943 | source = "registry+https://github.com/rust-lang/crates.io-index" 944 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 945 | 946 | [[package]] 947 | name = "powerfmt" 948 | version = "0.2.0" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 951 | 952 | [[package]] 953 | name = "proc-macro2" 954 | version = "1.0.84" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" 957 | dependencies = [ 958 | "unicode-ident", 959 | ] 960 | 961 | [[package]] 962 | name = "quote" 963 | version = "1.0.36" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 966 | dependencies = [ 967 | "proc-macro2", 968 | ] 969 | 970 | [[package]] 971 | name = "regex" 972 | version = "1.10.4" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" 975 | dependencies = [ 976 | "aho-corasick", 977 | "memchr", 978 | "regex-automata", 979 | "regex-syntax", 980 | ] 981 | 982 | [[package]] 983 | name = "regex-automata" 984 | version = "0.4.6" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" 987 | dependencies = [ 988 | "aho-corasick", 989 | "memchr", 990 | "regex-syntax", 991 | ] 992 | 993 | [[package]] 994 | name = "regex-syntax" 995 | version = "0.8.3" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" 998 | 999 | [[package]] 1000 | name = "reqwest" 1001 | version = "0.12.4" 1002 | source = "registry+https://github.com/rust-lang/crates.io-index" 1003 | checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" 1004 | dependencies = [ 1005 | "base64", 1006 | "bytes", 1007 | "futures-core", 1008 | "futures-util", 1009 | "http", 1010 | "http-body", 1011 | "http-body-util", 1012 | "hyper", 1013 | "hyper-rustls", 1014 | "hyper-util", 1015 | "ipnet", 1016 | "js-sys", 1017 | "log", 1018 | "mime", 1019 | "mime_guess", 1020 | "once_cell", 1021 | "percent-encoding", 1022 | "pin-project-lite", 1023 | "rustls", 1024 | "rustls-pemfile", 1025 | "rustls-pki-types", 1026 | "serde", 1027 | "serde_json", 1028 | "serde_urlencoded", 1029 | "sync_wrapper 0.1.2", 1030 | "tokio", 1031 | "tokio-rustls", 1032 | "tokio-util", 1033 | "tower-service", 1034 | "url", 1035 | "wasm-bindgen", 1036 | "wasm-bindgen-futures", 1037 | "wasm-streams", 1038 | "web-sys", 1039 | "webpki-roots", 1040 | "winreg", 1041 | ] 1042 | 1043 | [[package]] 1044 | name = "ring" 1045 | version = "0.17.8" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" 1048 | dependencies = [ 1049 | "cc", 1050 | "cfg-if", 1051 | "getrandom", 1052 | "libc", 1053 | "spin", 1054 | "untrusted", 1055 | "windows-sys 0.52.0", 1056 | ] 1057 | 1058 | [[package]] 1059 | name = "rustc-demangle" 1060 | version = "0.1.24" 1061 | source = "registry+https://github.com/rust-lang/crates.io-index" 1062 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 1063 | 1064 | [[package]] 1065 | name = "rustls" 1066 | version = "0.22.4" 1067 | source = "registry+https://github.com/rust-lang/crates.io-index" 1068 | checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" 1069 | dependencies = [ 1070 | "log", 1071 | "ring", 1072 | "rustls-pki-types", 1073 | "rustls-webpki", 1074 | "subtle", 1075 | "zeroize", 1076 | ] 1077 | 1078 | [[package]] 1079 | name = "rustls-pemfile" 1080 | version = "2.1.2" 1081 | source = "registry+https://github.com/rust-lang/crates.io-index" 1082 | checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" 1083 | dependencies = [ 1084 | "base64", 1085 | "rustls-pki-types", 1086 | ] 1087 | 1088 | [[package]] 1089 | name = "rustls-pki-types" 1090 | version = "1.7.0" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" 1093 | 1094 | [[package]] 1095 | name = "rustls-webpki" 1096 | version = "0.102.4" 1097 | source = "registry+https://github.com/rust-lang/crates.io-index" 1098 | checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" 1099 | dependencies = [ 1100 | "ring", 1101 | "rustls-pki-types", 1102 | "untrusted", 1103 | ] 1104 | 1105 | [[package]] 1106 | name = "rustversion" 1107 | version = "1.0.17" 1108 | source = "registry+https://github.com/rust-lang/crates.io-index" 1109 | checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" 1110 | 1111 | [[package]] 1112 | name = "ryu" 1113 | version = "1.0.18" 1114 | source = "registry+https://github.com/rust-lang/crates.io-index" 1115 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 1116 | 1117 | [[package]] 1118 | name = "serde" 1119 | version = "1.0.203" 1120 | source = "registry+https://github.com/rust-lang/crates.io-index" 1121 | checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" 1122 | dependencies = [ 1123 | "serde_derive", 1124 | ] 1125 | 1126 | [[package]] 1127 | name = "serde_derive" 1128 | version = "1.0.203" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" 1131 | dependencies = [ 1132 | "proc-macro2", 1133 | "quote", 1134 | "syn", 1135 | ] 1136 | 1137 | [[package]] 1138 | name = "serde_json" 1139 | version = "1.0.117" 1140 | source = "registry+https://github.com/rust-lang/crates.io-index" 1141 | checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" 1142 | dependencies = [ 1143 | "itoa", 1144 | "ryu", 1145 | "serde", 1146 | ] 1147 | 1148 | [[package]] 1149 | name = "serde_path_to_error" 1150 | version = "0.1.16" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" 1153 | dependencies = [ 1154 | "itoa", 1155 | "serde", 1156 | ] 1157 | 1158 | [[package]] 1159 | name = "serde_repr" 1160 | version = "0.1.19" 1161 | source = "registry+https://github.com/rust-lang/crates.io-index" 1162 | checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" 1163 | dependencies = [ 1164 | "proc-macro2", 1165 | "quote", 1166 | "syn", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "serde_urlencoded" 1171 | version = "0.7.1" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1174 | dependencies = [ 1175 | "form_urlencoded", 1176 | "itoa", 1177 | "ryu", 1178 | "serde", 1179 | ] 1180 | 1181 | [[package]] 1182 | name = "serde_with" 1183 | version = "3.8.1" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" 1186 | dependencies = [ 1187 | "base64", 1188 | "chrono", 1189 | "hex", 1190 | "indexmap 1.9.3", 1191 | "indexmap 2.2.6", 1192 | "serde", 1193 | "serde_derive", 1194 | "serde_json", 1195 | "serde_with_macros", 1196 | "time", 1197 | ] 1198 | 1199 | [[package]] 1200 | name = "serde_with_macros" 1201 | version = "3.8.1" 1202 | source = "registry+https://github.com/rust-lang/crates.io-index" 1203 | checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" 1204 | dependencies = [ 1205 | "darling", 1206 | "proc-macro2", 1207 | "quote", 1208 | "syn", 1209 | ] 1210 | 1211 | [[package]] 1212 | name = "slab" 1213 | version = "0.4.9" 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" 1215 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1216 | dependencies = [ 1217 | "autocfg", 1218 | ] 1219 | 1220 | [[package]] 1221 | name = "smallvec" 1222 | version = "1.13.2" 1223 | source = "registry+https://github.com/rust-lang/crates.io-index" 1224 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1225 | 1226 | [[package]] 1227 | name = "socket2" 1228 | version = "0.5.7" 1229 | source = "registry+https://github.com/rust-lang/crates.io-index" 1230 | checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 1231 | dependencies = [ 1232 | "libc", 1233 | "windows-sys 0.52.0", 1234 | ] 1235 | 1236 | [[package]] 1237 | name = "spin" 1238 | version = "0.9.8" 1239 | source = "registry+https://github.com/rust-lang/crates.io-index" 1240 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1241 | 1242 | [[package]] 1243 | name = "strsim" 1244 | version = "0.11.1" 1245 | source = "registry+https://github.com/rust-lang/crates.io-index" 1246 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1247 | 1248 | [[package]] 1249 | name = "strum" 1250 | version = "0.26.2" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" 1253 | dependencies = [ 1254 | "strum_macros", 1255 | ] 1256 | 1257 | [[package]] 1258 | name = "strum_macros" 1259 | version = "0.26.2" 1260 | source = "registry+https://github.com/rust-lang/crates.io-index" 1261 | checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" 1262 | dependencies = [ 1263 | "heck", 1264 | "proc-macro2", 1265 | "quote", 1266 | "rustversion", 1267 | "syn", 1268 | ] 1269 | 1270 | [[package]] 1271 | name = "subtle" 1272 | version = "2.5.0" 1273 | source = "registry+https://github.com/rust-lang/crates.io-index" 1274 | checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" 1275 | 1276 | [[package]] 1277 | name = "syn" 1278 | version = "2.0.66" 1279 | source = "registry+https://github.com/rust-lang/crates.io-index" 1280 | checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" 1281 | dependencies = [ 1282 | "proc-macro2", 1283 | "quote", 1284 | "unicode-ident", 1285 | ] 1286 | 1287 | [[package]] 1288 | name = "sync_wrapper" 1289 | version = "0.1.2" 1290 | source = "registry+https://github.com/rust-lang/crates.io-index" 1291 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1292 | 1293 | [[package]] 1294 | name = "sync_wrapper" 1295 | version = "1.0.1" 1296 | source = "registry+https://github.com/rust-lang/crates.io-index" 1297 | checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" 1298 | 1299 | [[package]] 1300 | name = "time" 1301 | version = "0.3.36" 1302 | source = "registry+https://github.com/rust-lang/crates.io-index" 1303 | checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" 1304 | dependencies = [ 1305 | "deranged", 1306 | "itoa", 1307 | "num-conv", 1308 | "powerfmt", 1309 | "serde", 1310 | "time-core", 1311 | "time-macros", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "time-core" 1316 | version = "0.1.2" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 1319 | 1320 | [[package]] 1321 | name = "time-macros" 1322 | version = "0.2.18" 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" 1324 | checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" 1325 | dependencies = [ 1326 | "num-conv", 1327 | "time-core", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "tinyvec" 1332 | version = "1.6.0" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1335 | dependencies = [ 1336 | "tinyvec_macros", 1337 | ] 1338 | 1339 | [[package]] 1340 | name = "tinyvec_macros" 1341 | version = "0.1.1" 1342 | source = "registry+https://github.com/rust-lang/crates.io-index" 1343 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1344 | 1345 | [[package]] 1346 | name = "tokio" 1347 | version = "1.37.0" 1348 | source = "registry+https://github.com/rust-lang/crates.io-index" 1349 | checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" 1350 | dependencies = [ 1351 | "backtrace", 1352 | "bytes", 1353 | "libc", 1354 | "mio", 1355 | "num_cpus", 1356 | "pin-project-lite", 1357 | "socket2", 1358 | "tokio-macros", 1359 | "windows-sys 0.48.0", 1360 | ] 1361 | 1362 | [[package]] 1363 | name = "tokio-macros" 1364 | version = "2.2.0" 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" 1366 | checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" 1367 | dependencies = [ 1368 | "proc-macro2", 1369 | "quote", 1370 | "syn", 1371 | ] 1372 | 1373 | [[package]] 1374 | name = "tokio-rustls" 1375 | version = "0.25.0" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" 1378 | dependencies = [ 1379 | "rustls", 1380 | "rustls-pki-types", 1381 | "tokio", 1382 | ] 1383 | 1384 | [[package]] 1385 | name = "tokio-stream" 1386 | version = "0.1.15" 1387 | source = "registry+https://github.com/rust-lang/crates.io-index" 1388 | checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" 1389 | dependencies = [ 1390 | "futures-core", 1391 | "pin-project-lite", 1392 | "tokio", 1393 | ] 1394 | 1395 | [[package]] 1396 | name = "tokio-util" 1397 | version = "0.7.11" 1398 | source = "registry+https://github.com/rust-lang/crates.io-index" 1399 | checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" 1400 | dependencies = [ 1401 | "bytes", 1402 | "futures-core", 1403 | "futures-sink", 1404 | "pin-project-lite", 1405 | "tokio", 1406 | ] 1407 | 1408 | [[package]] 1409 | name = "tower" 1410 | version = "0.4.13" 1411 | source = "registry+https://github.com/rust-lang/crates.io-index" 1412 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1413 | dependencies = [ 1414 | "futures-core", 1415 | "futures-util", 1416 | "pin-project", 1417 | "pin-project-lite", 1418 | "tokio", 1419 | "tower-layer", 1420 | "tower-service", 1421 | "tracing", 1422 | ] 1423 | 1424 | [[package]] 1425 | name = "tower-http" 1426 | version = "0.5.2" 1427 | source = "registry+https://github.com/rust-lang/crates.io-index" 1428 | checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" 1429 | dependencies = [ 1430 | "bitflags", 1431 | "bytes", 1432 | "http", 1433 | "http-body", 1434 | "http-body-util", 1435 | "pin-project-lite", 1436 | "tower-layer", 1437 | "tower-service", 1438 | ] 1439 | 1440 | [[package]] 1441 | name = "tower-layer" 1442 | version = "0.3.2" 1443 | source = "registry+https://github.com/rust-lang/crates.io-index" 1444 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1445 | 1446 | [[package]] 1447 | name = "tower-service" 1448 | version = "0.3.2" 1449 | source = "registry+https://github.com/rust-lang/crates.io-index" 1450 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1451 | 1452 | [[package]] 1453 | name = "tracing" 1454 | version = "0.1.40" 1455 | source = "registry+https://github.com/rust-lang/crates.io-index" 1456 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1457 | dependencies = [ 1458 | "log", 1459 | "pin-project-lite", 1460 | "tracing-core", 1461 | ] 1462 | 1463 | [[package]] 1464 | name = "tracing-core" 1465 | version = "0.1.32" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1468 | dependencies = [ 1469 | "once_cell", 1470 | ] 1471 | 1472 | [[package]] 1473 | name = "try-lock" 1474 | version = "0.2.5" 1475 | source = "registry+https://github.com/rust-lang/crates.io-index" 1476 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1477 | 1478 | [[package]] 1479 | name = "unicase" 1480 | version = "2.7.0" 1481 | source = "registry+https://github.com/rust-lang/crates.io-index" 1482 | checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" 1483 | dependencies = [ 1484 | "version_check", 1485 | ] 1486 | 1487 | [[package]] 1488 | name = "unicode-bidi" 1489 | version = "0.3.15" 1490 | source = "registry+https://github.com/rust-lang/crates.io-index" 1491 | checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" 1492 | 1493 | [[package]] 1494 | name = "unicode-ident" 1495 | version = "1.0.12" 1496 | source = "registry+https://github.com/rust-lang/crates.io-index" 1497 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1498 | 1499 | [[package]] 1500 | name = "unicode-normalization" 1501 | version = "0.1.23" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" 1504 | dependencies = [ 1505 | "tinyvec", 1506 | ] 1507 | 1508 | [[package]] 1509 | name = "untrusted" 1510 | version = "0.9.0" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 1513 | 1514 | [[package]] 1515 | name = "url" 1516 | version = "2.5.0" 1517 | source = "registry+https://github.com/rust-lang/crates.io-index" 1518 | checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" 1519 | dependencies = [ 1520 | "form_urlencoded", 1521 | "idna", 1522 | "percent-encoding", 1523 | ] 1524 | 1525 | [[package]] 1526 | name = "utf8parse" 1527 | version = "0.2.1" 1528 | source = "registry+https://github.com/rust-lang/crates.io-index" 1529 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 1530 | 1531 | [[package]] 1532 | name = "uuid" 1533 | version = "1.8.0" 1534 | source = "registry+https://github.com/rust-lang/crates.io-index" 1535 | checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" 1536 | 1537 | [[package]] 1538 | name = "version_check" 1539 | version = "0.9.4" 1540 | source = "registry+https://github.com/rust-lang/crates.io-index" 1541 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1542 | 1543 | [[package]] 1544 | name = "want" 1545 | version = "0.3.1" 1546 | source = "registry+https://github.com/rust-lang/crates.io-index" 1547 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1548 | dependencies = [ 1549 | "try-lock", 1550 | ] 1551 | 1552 | [[package]] 1553 | name = "wasi" 1554 | version = "0.11.0+wasi-snapshot-preview1" 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" 1556 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1557 | 1558 | [[package]] 1559 | name = "wasm-bindgen" 1560 | version = "0.2.92" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 1563 | dependencies = [ 1564 | "cfg-if", 1565 | "wasm-bindgen-macro", 1566 | ] 1567 | 1568 | [[package]] 1569 | name = "wasm-bindgen-backend" 1570 | version = "0.2.92" 1571 | source = "registry+https://github.com/rust-lang/crates.io-index" 1572 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 1573 | dependencies = [ 1574 | "bumpalo", 1575 | "log", 1576 | "once_cell", 1577 | "proc-macro2", 1578 | "quote", 1579 | "syn", 1580 | "wasm-bindgen-shared", 1581 | ] 1582 | 1583 | [[package]] 1584 | name = "wasm-bindgen-futures" 1585 | version = "0.4.42" 1586 | source = "registry+https://github.com/rust-lang/crates.io-index" 1587 | checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" 1588 | dependencies = [ 1589 | "cfg-if", 1590 | "js-sys", 1591 | "wasm-bindgen", 1592 | "web-sys", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "wasm-bindgen-macro" 1597 | version = "0.2.92" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 1600 | dependencies = [ 1601 | "quote", 1602 | "wasm-bindgen-macro-support", 1603 | ] 1604 | 1605 | [[package]] 1606 | name = "wasm-bindgen-macro-support" 1607 | version = "0.2.92" 1608 | source = "registry+https://github.com/rust-lang/crates.io-index" 1609 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 1610 | dependencies = [ 1611 | "proc-macro2", 1612 | "quote", 1613 | "syn", 1614 | "wasm-bindgen-backend", 1615 | "wasm-bindgen-shared", 1616 | ] 1617 | 1618 | [[package]] 1619 | name = "wasm-bindgen-shared" 1620 | version = "0.2.92" 1621 | source = "registry+https://github.com/rust-lang/crates.io-index" 1622 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1623 | 1624 | [[package]] 1625 | name = "wasm-streams" 1626 | version = "0.4.0" 1627 | source = "registry+https://github.com/rust-lang/crates.io-index" 1628 | checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" 1629 | dependencies = [ 1630 | "futures-util", 1631 | "js-sys", 1632 | "wasm-bindgen", 1633 | "wasm-bindgen-futures", 1634 | "web-sys", 1635 | ] 1636 | 1637 | [[package]] 1638 | name = "web-sys" 1639 | version = "0.3.69" 1640 | source = "registry+https://github.com/rust-lang/crates.io-index" 1641 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" 1642 | dependencies = [ 1643 | "js-sys", 1644 | "wasm-bindgen", 1645 | ] 1646 | 1647 | [[package]] 1648 | name = "webpki-roots" 1649 | version = "0.26.1" 1650 | source = "registry+https://github.com/rust-lang/crates.io-index" 1651 | checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" 1652 | dependencies = [ 1653 | "rustls-pki-types", 1654 | ] 1655 | 1656 | [[package]] 1657 | name = "windows-core" 1658 | version = "0.52.0" 1659 | source = "registry+https://github.com/rust-lang/crates.io-index" 1660 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1661 | dependencies = [ 1662 | "windows-targets 0.52.5", 1663 | ] 1664 | 1665 | [[package]] 1666 | name = "windows-sys" 1667 | version = "0.48.0" 1668 | source = "registry+https://github.com/rust-lang/crates.io-index" 1669 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1670 | dependencies = [ 1671 | "windows-targets 0.48.5", 1672 | ] 1673 | 1674 | [[package]] 1675 | name = "windows-sys" 1676 | version = "0.52.0" 1677 | source = "registry+https://github.com/rust-lang/crates.io-index" 1678 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1679 | dependencies = [ 1680 | "windows-targets 0.52.5", 1681 | ] 1682 | 1683 | [[package]] 1684 | name = "windows-targets" 1685 | version = "0.48.5" 1686 | source = "registry+https://github.com/rust-lang/crates.io-index" 1687 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1688 | dependencies = [ 1689 | "windows_aarch64_gnullvm 0.48.5", 1690 | "windows_aarch64_msvc 0.48.5", 1691 | "windows_i686_gnu 0.48.5", 1692 | "windows_i686_msvc 0.48.5", 1693 | "windows_x86_64_gnu 0.48.5", 1694 | "windows_x86_64_gnullvm 0.48.5", 1695 | "windows_x86_64_msvc 0.48.5", 1696 | ] 1697 | 1698 | [[package]] 1699 | name = "windows-targets" 1700 | version = "0.52.5" 1701 | source = "registry+https://github.com/rust-lang/crates.io-index" 1702 | checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 1703 | dependencies = [ 1704 | "windows_aarch64_gnullvm 0.52.5", 1705 | "windows_aarch64_msvc 0.52.5", 1706 | "windows_i686_gnu 0.52.5", 1707 | "windows_i686_gnullvm", 1708 | "windows_i686_msvc 0.52.5", 1709 | "windows_x86_64_gnu 0.52.5", 1710 | "windows_x86_64_gnullvm 0.52.5", 1711 | "windows_x86_64_msvc 0.52.5", 1712 | ] 1713 | 1714 | [[package]] 1715 | name = "windows_aarch64_gnullvm" 1716 | version = "0.48.5" 1717 | source = "registry+https://github.com/rust-lang/crates.io-index" 1718 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1719 | 1720 | [[package]] 1721 | name = "windows_aarch64_gnullvm" 1722 | version = "0.52.5" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" 1725 | 1726 | [[package]] 1727 | name = "windows_aarch64_msvc" 1728 | version = "0.48.5" 1729 | source = "registry+https://github.com/rust-lang/crates.io-index" 1730 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1731 | 1732 | [[package]] 1733 | name = "windows_aarch64_msvc" 1734 | version = "0.52.5" 1735 | source = "registry+https://github.com/rust-lang/crates.io-index" 1736 | checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" 1737 | 1738 | [[package]] 1739 | name = "windows_i686_gnu" 1740 | version = "0.48.5" 1741 | source = "registry+https://github.com/rust-lang/crates.io-index" 1742 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1743 | 1744 | [[package]] 1745 | name = "windows_i686_gnu" 1746 | version = "0.52.5" 1747 | source = "registry+https://github.com/rust-lang/crates.io-index" 1748 | checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" 1749 | 1750 | [[package]] 1751 | name = "windows_i686_gnullvm" 1752 | version = "0.52.5" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" 1755 | 1756 | [[package]] 1757 | name = "windows_i686_msvc" 1758 | version = "0.48.5" 1759 | source = "registry+https://github.com/rust-lang/crates.io-index" 1760 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1761 | 1762 | [[package]] 1763 | name = "windows_i686_msvc" 1764 | version = "0.52.5" 1765 | source = "registry+https://github.com/rust-lang/crates.io-index" 1766 | checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" 1767 | 1768 | [[package]] 1769 | name = "windows_x86_64_gnu" 1770 | version = "0.48.5" 1771 | source = "registry+https://github.com/rust-lang/crates.io-index" 1772 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1773 | 1774 | [[package]] 1775 | name = "windows_x86_64_gnu" 1776 | version = "0.52.5" 1777 | source = "registry+https://github.com/rust-lang/crates.io-index" 1778 | checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" 1779 | 1780 | [[package]] 1781 | name = "windows_x86_64_gnullvm" 1782 | version = "0.48.5" 1783 | source = "registry+https://github.com/rust-lang/crates.io-index" 1784 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1785 | 1786 | [[package]] 1787 | name = "windows_x86_64_gnullvm" 1788 | version = "0.52.5" 1789 | source = "registry+https://github.com/rust-lang/crates.io-index" 1790 | checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" 1791 | 1792 | [[package]] 1793 | name = "windows_x86_64_msvc" 1794 | version = "0.48.5" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1797 | 1798 | [[package]] 1799 | name = "windows_x86_64_msvc" 1800 | version = "0.52.5" 1801 | source = "registry+https://github.com/rust-lang/crates.io-index" 1802 | checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" 1803 | 1804 | [[package]] 1805 | name = "winreg" 1806 | version = "0.52.0" 1807 | source = "registry+https://github.com/rust-lang/crates.io-index" 1808 | checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" 1809 | dependencies = [ 1810 | "cfg-if", 1811 | "windows-sys 0.48.0", 1812 | ] 1813 | 1814 | [[package]] 1815 | name = "zeroize" 1816 | version = "1.8.1" 1817 | source = "registry+https://github.com/rust-lang/crates.io-index" 1818 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 1819 | --------------------------------------------------------------------------------