ds-api 0.2.0

A Rust client library for the DeepSeek API with support for chat completions, streaming, and tools
Documentation
[package]
name = "ds-api"
version = "0.2.0"
edition = "2024"
description = "A Rust client library for the DeepSeek API with support for chat completions, streaming, and tools"
authors = ["ozongzi <ozongzi@icloud.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/ozongzi/ds-api"
readme = "README.md"
keywords = ["deepseek", "api", "ai", "chat", "llm"]
categories = ["api-bindings", "web-programming"]

[dependencies]
eventsource-stream = "0.2.3"
futures = "0.3.31"
reqwest = { version = "0.13", features = ["json", "stream"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1.49.0", features = ["full"] }
thiserror = "1.0"

[dev-dependencies]
# Wiremock for mocking HTTP/SSE endpoints in integration tests
wiremock = "0.5"
# Tokio test support (macros + multi-thread runtime)
tokio = { version = "1.49.0", features = ["macros", "rt-multi-thread"] }

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

# NOTE:
# We include a GitHub Actions workflow YAML here in package metadata as a convenient
# copy/paste location. Please create the workflow file at:
#   .github/workflows/ci.yml
# with the contents from the `github_actions` field below.
[package.metadata.ci]
github_actions = """
name: CI

on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust toolchain (stable)
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - name: Install rustfmt & clippy
        run: rustup component add rustfmt clippy

      - name: Cache cargo registry
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
          key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo target
        uses: actions/cache@v4
        with:
          path: target
          key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}

      - name: Run cargo fmt check
        run: cargo fmt --all -- --check

      - name: Run cargo clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Run tests
        run: cargo test --workspace --all-features --verbose
"""