[package]
edition = "2024"
name = "rstructor"
version = "0.2.8"
authors = ["Clifton King <cliftonk@gmail.com>"]
build = false
exclude = [
"release.sh",
"*.sh",
"CLAUDE.md",
"EXAMPLES.md",
".github/",
".gitignore",
".gitattributes",
".claude/",
"tmp/",
"*.orig",
"*.bak",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Rust equivalent of Python's Instructor + Pydantic: Extract structured, validated data from LLMs (OpenAI, Anthropic, Grok, Gemini) using type-safe Rust structs and enums"
documentation = "https://docs.rs/rstructor"
readme = "README.md"
keywords = [
"pydantic",
"instructor",
"structured-output",
"llm",
"openai",
]
categories = [
"api-bindings",
"web-programming",
"parsing",
"data-structures",
"text-processing",
]
license = "MIT"
repository = "https://github.com/clifton/rstructor"
[features]
anthropic = [
"reqwest",
"tokio",
]
default = [
"openai",
"anthropic",
"grok",
"gemini",
"derive",
"logging",
]
derive = ["rstructor_derive"]
gemini = [
"reqwest",
"tokio",
"base64",
]
grok = [
"reqwest",
"tokio",
]
logging = [
"tracing-subscriber",
"tracing-futures",
]
openai = [
"reqwest",
"tokio",
]
[lib]
name = "rstructor"
path = "src/lib.rs"
[[example]]
name = "container_attributes_example"
path = "examples/container_attributes_example.rs"
[[example]]
name = "custom_type_example"
path = "examples/custom_type_example.rs"
[[example]]
name = "enum_example"
path = "examples/enum_example.rs"
[[example]]
name = "enum_with_data_example"
path = "examples/enum_with_data_example.rs"
[[example]]
name = "event_planner"
path = "examples/event_planner.rs"
[[example]]
name = "gemini_multimodal_example"
path = "examples/gemini_multimodal_example.rs"
[[example]]
name = "logging_example"
path = "examples/logging_example.rs"
[[example]]
name = "manual_implementation"
path = "examples/manual_implementation.rs"
[[example]]
name = "medical_example"
path = "examples/medical_example.rs"
[[example]]
name = "movie_example"
path = "examples/movie_example.rs"
[[example]]
name = "nested_enum_example"
path = "examples/nested_enum_example.rs"
[[example]]
name = "nested_objects_example"
path = "examples/nested_objects_example.rs"
[[example]]
name = "news_article_categorizer"
path = "examples/news_article_categorizer.rs"
[[example]]
name = "serde_rename_example"
path = "examples/serde_rename_example.rs"
[[example]]
name = "structured_movie_info"
path = "examples/structured_movie_info.rs"
[[example]]
name = "token_usage_example"
path = "examples/token_usage_example.rs"
[[example]]
name = "validation_example"
path = "examples/validation_example.rs"
[[example]]
name = "weather_example"
path = "examples/weather_example.rs"
[[test]]
name = "anthropic_validation_test"
path = "tests/anthropic_validation_test.rs"
[[test]]
name = "complex_enum_integration_tests"
path = "tests/complex_enum_integration_tests.rs"
[[test]]
name = "container_attributes_tests"
path = "tests/container_attributes_tests.rs"
[[test]]
name = "container_description_tests"
path = "tests/container_description_tests.rs"
[[test]]
name = "conversation_history_tests"
path = "tests/conversation_history_tests.rs"
[[test]]
name = "custom_type_schema_tests"
path = "tests/custom_type_schema_tests.rs"
[[test]]
name = "derive_macro_tests"
path = "tests/derive_macro_tests.rs"
[[test]]
name = "error_tests"
path = "tests/error_tests.rs"
[[test]]
name = "example_validation_tests"
path = "tests/example_validation_tests.rs"
[[test]]
name = "gemini_multimodal_tests"
path = "tests/gemini_multimodal_tests.rs"
[[test]]
name = "grok_validation_test"
path = "tests/grok_validation_test.rs"
[[test]]
name = "hashmap_integration_tests"
path = "tests/hashmap_integration_tests.rs"
[[test]]
name = "instructor_tests"
path = "tests/instructor_tests.rs"
[[test]]
name = "integration_tests"
path = "tests/integration_tests.rs"
[[test]]
name = "llm_integration_tests"
path = "tests/llm_integration_tests.rs"
[[test]]
name = "model_string_test"
path = "tests/model_string_test.rs"
[[test]]
name = "nested_enum_tests"
path = "tests/nested_enum_tests.rs"
[[test]]
name = "nested_struct_tests"
path = "tests/nested_struct_tests.rs"
[[test]]
name = "openai_validation_test"
path = "tests/openai_validation_test.rs"
[[test]]
name = "recursive_structures_tests"
path = "tests/recursive_structures_tests.rs"
[[test]]
name = "schema_builder_tests"
path = "tests/schema_builder_tests.rs"
[[test]]
name = "schema_validation_tests"
path = "tests/schema_validation_tests.rs"
[[test]]
name = "serde_rename_tests"
path = "tests/serde_rename_tests.rs"
[[test]]
name = "timeout_tests"
path = "tests/timeout_tests.rs"
[[test]]
name = "validate_method_tests"
path = "tests/validate_method_tests.rs"
[[test]]
name = "validation_tests"
path = "tests/validation_tests.rs"
[[test]]
name = "weird_types_tests"
path = "tests/weird_types_tests.rs"
[dependencies.async-trait]
version = "0.1"
[dependencies.base64]
version = "0.22"
optional = true
[dependencies.chrono]
version = "0.4"
[dependencies.reqwest]
version = "0.13"
features = [
"json",
"query",
"default-tls",
]
optional = true
default-features = false
[dependencies.rstructor_derive]
version = "0.2.8"
optional = true
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
[dependencies.thiserror]
version = "2.0.12"
[dependencies.tokio]
version = "1.0"
features = [
"rt",
"macros",
"rt-multi-thread",
"io-std",
]
optional = true
[dependencies.tracing]
version = "0.1"
[dependencies.tracing-futures]
version = "0.2"
optional = true
[dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter"]
optional = true