[package]
name = "sgr-agent"
version = "0.7.11"
edition = "2024"
description = "SGR LLM client + agent framework — structured output, function calling, agent loop, 3 agent variants"
license = "MIT"
repository = "https://github.com/fortunto2/rust-code"
keywords = ["llm", "structured-output", "function-calling", "sgr", "gemini"]
categories = ["development-tools"]

[features]
default = ["gemini", "openai", "oxide"]
gemini = []
openai = []
agent = ["async-trait", "indexmap", "futures", "tokio-util"]
tools = ["agent", "dep:sgr-agent-tools"]
tools-eval = ["tools", "sgr-agent-tools/eval"]
tools-shell = ["tools", "sgr-agent-tools/shell"]
tools-patch = ["tools", "sgr-agent-tools/patch"]
tools-local-fs = ["tools", "sgr-agent-tools/local-fs"]
tools-all = ["tools-eval", "tools-shell", "tools-patch", "tools-local-fs"]
session = ["agent", "dep:uuid"]
app-tools = ["session", "dep:anyhow"]
providers = ["dep:base64"]
telemetry = ["dep:tracing-subscriber", "dep:tracing-log", "dep:tracing-opentelemetry", "dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-otlp", "dep:chrono", "dep:rusqlite", "dep:dirs"]
logging = ["dep:tracing-subscriber", "dep:tracing-appender", "dep:chrono"]
search = ["dep:neo_frizbee"]
genai = ["dep:genai", "agent", "futures"]
oxide = ["agent", "futures"]
oxide-ws = ["openai-oxide/websocket"]

[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
schemars = "0.8"
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json"] }
tokio = { version = "1", features = ["rt", "macros", "sync", "time", "net", "process", "io-util", "fs"] }
strsim = "0.11"
thiserror = "2"
tracing = "0.1"
async-trait = { version = "0.1", optional = true }
indexmap = { version = "2", optional = true }
futures = { version = "0.3", optional = true }
tokio-util = { version = "0.7", optional = true }
uuid = { version = "1", optional = true, features = ["v7"] }
anyhow = { version = "1", optional = true }
toml = "0.8"
base64 = { version = "0.22", optional = true }
tracing-subscriber = { version = "0.3", optional = true, features = ["env-filter", "json"] }
tracing-appender = { version = "0.2", optional = true }
tracing-log = { version = "0.2", optional = true }
tracing-opentelemetry = { version = "0.32", optional = true }
opentelemetry = { version = "0.31", optional = true }
opentelemetry_sdk = { version = "0.31", optional = true, features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.31", optional = true, default-features = false, features = ["trace", "http-proto", "reqwest-blocking-client"] }
chrono = { version = "0.4", optional = true, default-features = false, features = ["clock"] }
rusqlite = { version = "0.32", optional = true, features = ["bundled"] }
dirs = { version = "6", optional = true }
neo_frizbee = { version = "0.10", optional = true }
sgr-agent-core = { version = "0.2.0", path = "../sgr-agent-core" }
sgr-agent-tools = { version = "0.4.1", path = "../sgr-agent-tools", optional = true }
serde_yaml = "0.9"
genai = { version = "0.6.0-beta.10", optional = true }
openai-oxide = { version = "0.14", default-features = false, features = ["chat", "responses", "structured"] }
llm_json = { version = "1.0.3", path = "../llm-json" }

# Uniffi for iOS/Android Swift/Kotlin bindings (optional)
# uniffi = { version = "0.31", optional = true }

[dev-dependencies]
base64 = "0.22"
tempfile = "3"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
async-trait = "0.1"
anyhow = "1"

[[example]]
name = "agent_demo"
required-features = ["agent", "tools-all", "tools-local-fs"]

[[example]]
name = "structured_output"
required-features = ["oxide"]

[[example]]
name = "function_calling"
required-features = ["oxide"]

[[example]]
name = "oxide_agent_test"
required-features = ["oxide", "genai"]
