api_gemini 0.7.1

Gemini's API for accessing large language models (LLMs).
Documentation
[package]
name = "api_gemini"
version = "0.7.1"
edition = "2021"
rust-version.workspace = true
authors = [
  "Kostiantyn Mysnyk <wandalen@obox.systems>",
]
license = "MIT"
readme = "readme.md"
documentation = "https://docs.rs/api_gemini"
repository = "https://github.com/Wandalen/api_llm/tree/master/api/gemini"
homepage = "https://github.com/Wandalen/api_llm/tree/master/api/gemini"
description = """
Gemini's API for accessing large language models (LLMs).
"""
categories = [ "algorithms", "development-tools" ]
keywords = [ "fundamental", "general-purpose" ]

# Exception to workspace [lints] inheritance: api_gemini cannot use `workspace = true`
# because Cargo 1.95 forbids combining workspace = true with local overrides in [lints].
# This section replicates workspace [workspace.lints.rust] and omits workspace pedantic
# (clippy::pedantic) intentionally — too many TDD-cleanup-debt violations exist to enable
# it. Resolve overrides in task/ before enabling pedantic and switching to workspace = true.

[lints.rust]
rust_2018_idioms = { level = "warn", priority = -1 }
future_incompatible = { level = "warn", priority = -1 }
missing_docs = "warn"
missing_debug_implementations = "warn"
unsafe-code = "deny"

[lints.clippy]
# workspace clippy baseline (minus pedantic group — see comment above)
undocumented_unsafe_blocks = "deny"
std_instead_of_core = "allow"
doc_include_without_cfg = "warn"
single_call_fn = "allow"
inline_always = "allow"
module_name_repetitions = "allow"
absolute_paths = "allow"
wildcard_imports = "allow"
std_instead_of_alloc = "allow"
items_after_statements = "allow"
cast_precision_loss = "allow"
pub_use = "allow"
question_mark_used = "allow"
implicit_return = "allow"
arbitrary_source_item_ordering = "allow"

[package.metadata.docs.rs]
features = [ "full" ]
all-features = false

[features]
# Default enables everything for ease of use
default = [ "full" ]
# 'full' enables all features, including the base 'enabled'
full = [ "enabled", "integration", "diagnostics_curl", "logging", "streaming", "websocket_streaming", "streaming_control", "chat", "retry", "circuit_breaker", "rate_limiting", "failover", "health_checks", "builder_patterns", "caching", "dynamic_configuration", "batch_operations", "compression", "enterprise_quota", "model_comparison", "request_templates", "buffered_streaming" ]
# 'enabled' is the master switch for the crate's core functionality
enabled = [
  # Core dependencies
  "dep:mod_interface",
  "dep:error_tools",
  "dep:workspace_tools",
  "dep:former",
  # Utilities
  "dep:rand",
  "dep:uuid",
  # Serialization
  "dep:regex",
  "dep:serde",
  "dep:serde_with",
  "dep:serde_json",
  "dep:base64",
  "dep:secrecy",
  "dep:urlencoding",
  # Async
  "dep:futures-core",
  "dep:futures-util",
  "dep:futures",
  "dep:async-stream",
  "dep:backoff",
  "dep:tokio",
  "dep:tokio-stream",
  "dep:bytes",
  # Web
  "dep:reqwest",
  "dep:tracing",
]
# Feature for running integration tests with real API
integration = []
# Feature for diagnostics curl command generation
diagnostics_curl = []
# Feature for structured logging with tracing
logging = [ "dep:tracing-subscriber" ]
# Feature for streaming response support with JSON array buffering
streaming = []
# Feature for WebSocket streaming with bidirectional real-time communication
websocket_streaming = [ "dep:tokio-tungstenite" ]
# Feature for streaming control with pause, resume, and cancel operations
streaming_control = []
# Feature for chat completion functionality with conversation management
chat = []
# Feature for retry logic with exponential backoff
retry = []
# Planned for v2.4 - circuit breaker pattern with failure threshold management
circuit_breaker = []
# Planned for v2.4 - rate limiting with token bucket and sliding window algorithms
rate_limiting = []
# Planned for v2.4 - failover support with multi-endpoint configuration
failover = []
# Planned for v2.4 - health checks with periodic endpoint monitoring
health_checks = []
# Feature for advanced builder patterns with fluent API design
builder_patterns = []
# Feature for request caching functionality (planned)
caching = []
# Feature for stress testing (planned)
stress = []
# Feature for performance testing (planned)
performance = []
# Feature for dynamic configuration management with hot-reloading and multiple sources
dynamic_configuration = [ "notify", "async-trait" ]
# Feature for batch operations with async job-based processing (mock implementation awaiting API)
batch_operations = []
# Feature for request/response compression (gzip, deflate, brotli)
compression = [ "flate2", "brotli", "async-compression" ]
# Feature for model comparison and A/B testing
model_comparison = []
# Feature for request templates and presets
request_templates = []
# Feature for buffered streaming with smoother UX
buffered_streaming = []
# Feature for cost-based enterprise quota management with usage tracking
enterprise_quota = [ "parking_lot", "chrono" ]

[dependencies]

## peers

mod_interface = { workspace = true, optional = true }
error_tools = { workspace = true, optional = true }
workspace_tools = { workspace = true, features = [ "secrets" ], optional = true }
former = { workspace = true, optional = true }

## unsorted

rand = { workspace = true, optional = true }
uuid = { workspace = true, features = ["v4"], optional = true }

## serialization

regex = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"], optional = true }
serde_with = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
base64 = { workspace = true, optional = true }
secrecy = { workspace = true, features = ["serde"], optional = true }
urlencoding = { workspace = true, optional = true }

## async

futures-core = { workspace = true, optional = true }
futures-util = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
async-stream = { workspace = true, optional = true }
backoff = { workspace = true, features = [ "tokio" ], optional = true }
tokio = { workspace = true, features = [ "macros", "sync", "time", "rt-multi-thread" ], optional = true }
tokio-stream = { workspace = true, optional = true }
bytes = { workspace = true, optional = true }

## web

reqwest = { workspace = true, features = [
  "json",
  "query",
  "stream",
  "multipart",
  "rustls",
], default-features = false, optional = true }
tracing = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, features = [ "env-filter", "fmt" ], optional = true }
tokio-tungstenite = { workspace = true, features = [ "rustls-tls-webpki-roots" ], optional = true }
# tracing-capture = { workspace = true }

## dynamic configuration (optional)
notify = { workspace = true, optional = true, features = [ "macos_fsevent" ] }
async-trait = { workspace = true, optional = true }

## compression (optional)
flate2 = { workspace = true, optional = true }
brotli = { workspace = true, optional = true }
async-compression = { workspace = true, optional = true, features = [ "tokio", "gzip", "deflate", "brotli" ] }

## enterprise quota (optional)
parking_lot = { workspace = true, optional = true }
chrono = { workspace = true, optional = true }

[dev-dependencies]
criterion = { workspace = true }
reqwest = { workspace = true, default-features = false }
tokio-stream = { workspace = true }
# test_tools = { workspace = true }
# mockito = { workspace = true } # Mock functionality merged into integration tests

[[bench]]
name = "client_overhead"
harness = false

[[bench]]
name = "retry_logic_overhead"
harness = false

[[bench]]
name = "circuit_breaker_overhead"
harness = false

[[bench]]
name = "rate_limiting_overhead"
harness = false

[[bench]]
name = "streaming_overhead"
harness = false