api_xai 0.6.1

X.AI Grok API client for accessing large language models (LLMs).
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.70"
name = "api_xai"
version = "0.6.1"
authors = ["Kostiantyn Mysnyk <wandalen@obox.systems>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = """
X.AI Grok API client for accessing large language models (LLMs).
"""
homepage = "https://github.com/Wandalen/api_llm/tree/master/api/xai"
documentation = "https://docs.rs/api_xai"
readme = "readme.md"
keywords = [
    "fundamental",
    "general-purpose",
    "xai",
    "grok",
    "ai",
]
categories = [
    "algorithms",
    "development-tools",
]
license = "MIT"
repository = "https://github.com/Wandalen/api_llm/tree/master/api/xai"

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

[features]
batch_operations = ["tokio/sync"]
caching = ["dep:lru"]
circuit_breaker = []
count_tokens = ["dep:tiktoken-rs"]
curl_diagnostics = []
default = ["full"]
enabled = [
    "dep:api_openai_compatible",
    "api_openai_compatible/enabled",
    "dep:mod_interface",
    "dep:error_tools",
    "dep:workspace_tools",
    "dep:serde",
    "dep:serde_json",
    "dep:secrecy",
    "dep:former",
    "dep:futures-core",
    "dep:futures-util",
    "dep:tokio",
    "dep:reqwest",
    "dep:url",
]
enhanced_tools = []
failover = []
full = [
    "enabled",
    "integration",
    "streaming",
    "tool_calling",
    "retry",
    "circuit_breaker",
    "rate_limiting",
    "failover",
    "enhanced_tools",
    "health_checks",
    "structured_logging",
    "count_tokens",
    "caching",
    "input_validation",
    "curl_diagnostics",
    "batch_operations",
    "performance_metrics",
    "sync_api",
]
health_checks = []
input_validation = []
integration = []
performance_metrics = ["dep:prometheus"]
rate_limiting = ["tokio/time"]
retry = []
streaming = [
    "dep:eventsource-stream",
    "dep:bytes",
    "api_openai_compatible/streaming",
]
structured_logging = ["dep:tracing"]
sync_api = ["tokio/rt-multi-thread"]
tool_calling = []

[lib]
name = "api_xai"
path = "src/lib.rs"

[[example]]
name = "basic_chat"
path = "examples/basic_chat.rs"

[[example]]
name = "cached_interactive_chat"
path = "examples/cached_interactive_chat.rs"

[[example]]
name = "client_side_enhancements"
path = "examples/client_side_enhancements.rs"

[[example]]
name = "enhanced_tools_demo"
path = "examples/enhanced_tools_demo.rs"

[[example]]
name = "enterprise_features"
path = "examples/enterprise_features.rs"

[[example]]
name = "failover_demo"
path = "examples/failover_demo.rs"

[[example]]
name = "interactive_chat"
path = "examples/interactive_chat.rs"

[[example]]
name = "list_models"
path = "examples/list_models.rs"

[[example]]
name = "streaming_chat"
path = "examples/streaming_chat.rs"

[[example]]
name = "tool_calling"
path = "examples/tool_calling.rs"

[[test]]
name = "circuit_breaker_tests"
path = "tests/circuit_breaker_tests.rs"

[[test]]
name = "components_tests"
path = "tests/components_tests.rs"

[[test]]
name = "enhanced_tools_tests"
path = "tests/enhanced_tools_tests.rs"

[[test]]
name = "environment_tests"
path = "tests/environment_tests.rs"

[[test]]
name = "error_tests"
path = "tests/error_tests.rs"

[[test]]
name = "failover_tests"
path = "tests/failover_tests.rs"

[[test]]
name = "integration_chat"
path = "tests/integration_chat.rs"

[[test]]
name = "integration_models"
path = "tests/integration_models.rs"

[[test]]
name = "integration_streaming"
path = "tests/integration_streaming.rs"

[[test]]
name = "integration_tool_calling"
path = "tests/integration_tool_calling.rs"

[[test]]
name = "secret_tests"
path = "tests/secret_tests.rs"

[dependencies.api_openai_compatible]
version = "=0.5.1"
optional = true
default-features = false

[dependencies.bytes]
version = "^1.10"
optional = true

[dependencies.error_tools]
version = "^0.40"
features = ["error_typed"]
optional = true

[dependencies.eventsource-stream]
version = "^0.2"
optional = true

[dependencies.former]
version = "^2.48"
optional = true

[dependencies.futures-core]
version = "^0.3"
optional = true

[dependencies.futures-util]
version = "^0.3"
optional = true

[dependencies.lru]
version = "^0.18"
optional = true

[dependencies.mod_interface]
version = "^0.64"
optional = true

[dependencies.prometheus]
version = "^0.14"
optional = true

[dependencies.reqwest]
version = "^0.13"
features = [
    "json",
    "rustls",
    "stream",
]
optional = true
default-features = false

[dependencies.secrecy]
version = "^0.10"
optional = true

[dependencies.serde]
version = "^1.0"
features = ["derive"]
optional = true

[dependencies.serde_json]
version = "^1.0"
optional = true

[dependencies.tiktoken-rs]
version = "^0.12"
optional = true

[dependencies.tokio]
version = "^1.52"
features = ["macros"]
optional = true

[dependencies.tracing]
version = "^0.1"
optional = true

[dependencies.url]
version = "^2.5"
optional = true

[dependencies.workspace_tools]
version = "^0.14"
features = ["secrets"]
optional = true

[dev-dependencies.futures-util]
version = "^0.3"

[dev-dependencies.serde_json]
version = "^1.0"

[dev-dependencies.tokio]
version = "^1.52"
features = [
    "rt-multi-thread",
    "macros",
]

[lints.clippy]
absolute_paths = "allow"
arbitrary_source_item_ordering = "allow"
cast_precision_loss = "allow"
doc_include_without_cfg = "warn"
implicit_return = "allow"
inline_always = "allow"
items_after_statements = "allow"
missing_docs_in_private_items = "allow"
missing_inline_in_public_items = "warn"
mod_module_files = "allow"
module_name_repetitions = "allow"
pub_use = "allow"
question_mark_used = "allow"
single_call_fn = "allow"
std_instead_of_alloc = "allow"
std_instead_of_core = "warn"
undocumented_unsafe_blocks = "deny"
wildcard_imports = "allow"

[lints.clippy.pedantic]
level = "warn"
priority = -1

[lints.rust]
missing_debug_implementations = "warn"
missing_docs = "warn"
unsafe-code = "deny"

[lints.rust.future_incompatible]
level = "warn"
priority = -1

[lints.rust.rust_2018_idioms]
level = "warn"
priority = -1