[package]
edition = "2021"
rust-version = "1.70"
name = "api_openai"
version = "0.6.1"
authors = ["Kostiantyn Mysnyk <wandalen@obox.systems>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = """
OpenAI's API for accessing large language models (LLMs).
"""
homepage = "https://github.com/Wandalen/api_llm/tree/master/api/openai"
documentation = "https://docs.rs/api_openai"
readme = "readme.md"
keywords = [
"fundamental",
"general-purpose",
]
categories = [
"algorithms",
"development-tools",
]
license = "MIT"
repository = "https://github.com/Wandalen/api_llm/tree/master/api/openai"
[package.metadata.cargo-udeps.ignore]
development = ["tracing-subscriber"]
[package.metadata.docs.rs]
features = ["full"]
all-features = false
[features]
audio = []
batching = ["blake3"]
buffered_streaming = []
caching = [
"sha2",
"blake3",
]
circuit_breaker = []
compression = ["flate2"]
default = ["full"]
dev-optimized = [
"retry",
"circuit_breaker",
"caching",
]
enabled = [
"dep:mod_interface",
"dep:former",
"dep:error_tools",
"dep:derive_tools",
"dep:workspace_tools",
"dep:async-trait",
"dep:url",
"dep:rand",
"dep:chrono",
"dep:uuid",
"dep:regex",
"dep:serde",
"dep:serde_json",
"dep:serde_yml",
"dep:base64",
"dep:secrecy",
"dep:futures-core",
"dep:futures-util",
"dep:futures",
"dep:backoff",
"dep:tokio",
"dep:bytes",
"dep:eventsource-stream",
"dep:reqwest",
"dep:tracing",
]
enterprise = []
failover = []
full = [
"enabled",
"integration",
"retry",
"circuit_breaker",
"rate_limiting",
"failover",
"health_checks",
"enterprise",
"caching",
"batching",
"compression",
"streaming_control",
"audio",
"moderation",
"input_validation",
"model_comparison",
"request_templates",
"buffered_streaming",
"websocket",
]
health_checks = []
input_validation = []
integration = []
minimal = []
model_comparison = []
moderation = []
optimized = [
"performance",
"compression",
"enterprise",
]
performance = [
"retry",
"circuit_breaker",
"rate_limiting",
"failover",
"health_checks",
"caching",
"batching",
]
rate_limiting = []
request_templates = []
retry = []
streaming_control = []
websocket = ["dep:tokio-tungstenite"]
[lib]
name = "api_openai"
path = "src/lib.rs"
[[example]]
name = "openai_chat"
path = "examples/openai_chat.rs"
[[example]]
name = "openai_multi_turn_conversation"
path = "examples/openai_multi_turn_conversation.rs"
[[example]]
name = "openai_interactive_chat"
path = "examples/openai_interactive_chat.rs"
[[example]]
name = "openai_responses_create_with_tools"
path = "examples/openai_responses_create_with_tools.rs"
[[example]]
name = "openai_responses_create_image_input"
path = "examples/openai_responses_create_image_input.rs"
[[example]]
name = "openai_ai_code_reviewer"
path = "examples/openai_ai_code_reviewer.rs"
[[example]]
name = "openai_web_research_assistant"
path = "examples/openai_web_research_assistant.rs"
[[example]]
name = "openai_document_analyzer_vision"
path = "examples/openai_document_analyzer_vision.rs"
[[example]]
name = "openai_batch_content_processor"
path = "examples/openai_batch_content_processor.rs"
[[example]]
name = "openai_cached_interactive_chat"
path = "examples/openai_cached_interactive_chat.rs"
[[example]]
name = "openai_request_batching_demo"
path = "examples/openai_request_batching_demo.rs"
[[example]]
name = "openai_responses_get"
path = "examples/openai_responses_get.rs"
[[example]]
name = "openai_responses_delete"
path = "examples/openai_responses_delete.rs"
[[example]]
name = "openai_responses_list_input_items"
path = "examples/openai_responses_list_input_items.rs"
[[example]]
name = "openai_responses_cancel"
path = "examples/openai_responses_cancel.rs"
[[example]]
name = "openai_responses_update"
path = "examples/openai_responses_update.rs"
required-features = ["enabled"]
[[example]]
name = "openai_realtime_conversation_item_create"
path = "examples/openai_realtime_conversation_item_create.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_conversation_item_delete"
path = "examples/openai_realtime_conversation_item_delete.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_conversation_item_retrieve"
path = "examples/openai_realtime_conversation_item_retrieve.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_conversation_item_truncate"
path = "examples/openai_realtime_conversation_item_truncate.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_input_audio_buffer_append"
path = "examples/openai_realtime_input_audio_buffer_append.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_input_audio_buffer_clear"
path = "examples/openai_realtime_input_audio_buffer_clear.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_input_audio_buffer_commit"
path = "examples/openai_realtime_input_audio_buffer_commit.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_response_cancel"
path = "examples/openai_realtime_response_cancel.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_response_create"
path = "examples/openai_realtime_response_create.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_session_update"
path = "examples/openai_realtime_session_update.rs"
required-features = ["websocket"]
[[example]]
name = "openai_realtime_transcription_session_update"
path = "examples/openai_realtime_transcription_session_update.rs"
required-features = ["websocket"]
[[test]]
name = "advanced_auth_tests"
path = "tests/advanced_auth_tests.rs"
[[test]]
name = "batch_content_processor_compilation_test"
path = "tests/batch_content_processor_compilation_test.rs"
[[test]]
name = "builder_patterns_enhanced_tests"
path = "tests/builder_patterns_enhanced_tests.rs"
[[test]]
name = "builder_validation_enhanced_tests"
path = "tests/builder_validation_enhanced_tests.rs"
[[test]]
name = "curl_generation_comprehensive_tests"
path = "tests/curl_generation_comprehensive_tests.rs"
[[test]]
name = "doc_spec_coverage"
path = "tests/doc_spec_coverage.rs"
[[test]]
name = "document_analyzer_vision_url_test"
path = "tests/document_analyzer_vision_url_test.rs"
[[test]]
name = "dynamic_configuration_tests"
path = "tests/dynamic_configuration_tests.rs"
[[test]]
name = "embeddings_comprehensive_tests"
path = "tests/embeddings_comprehensive_tests.rs"
[[test]]
name = "enhanced_batch_operations_tests"
path = "tests/enhanced_batch_operations_tests.rs"
[[test]]
name = "enhanced_circuit_breaker_integration_test"
path = "tests/enhanced_circuit_breaker_integration_test.rs"
[[test]]
name = "enhanced_model_details_comprehensive_tests"
path = "tests/enhanced_model_details_comprehensive_tests.rs"
[[test]]
name = "enhanced_rate_limiting_integration_test"
path = "tests/enhanced_rate_limiting_integration_test.rs"
[[test]]
name = "enhanced_rate_limiting_tests"
path = "tests/enhanced_rate_limiting_tests.rs"
[[test]]
name = "enhanced_retry_integration_test"
path = "tests/enhanced_retry_integration_test.rs"
[[test]]
name = "enterprise_cost_management_tests"
path = "tests/enterprise_cost_management_tests.rs"
[[test]]
name = "enterprise_quota_management_tests"
path = "tests/enterprise_quota_management_tests.rs"
[[test]]
name = "enterprise_region_management_tests"
path = "tests/enterprise_region_management_tests.rs"
[[test]]
name = "environment_config_unit_tests"
path = "tests/environment_config_unit_tests.rs"
[[test]]
name = "error_handling_consistency_test"
path = "tests/error_handling_consistency_test.rs"
[[test]]
name = "failover_tests"
path = "tests/failover_tests.rs"
[[test]]
name = "general_diagnostics_comprehensive_tests"
path = "tests/general_diagnostics_comprehensive_tests.rs"
[[test]]
name = "health_checks_tests"
path = "tests/health_checks_tests.rs"
[[test]]
name = "image_input_request_test"
path = "tests/image_input_request_test.rs"
[[test]]
name = "integration"
path = "tests/integration.rs"
[[test]]
name = "integration_reorganized"
path = "tests/integration_reorganized.rs"
[[test]]
name = "minimal_secret_tests"
path = "tests/minimal_secret_tests.rs"
[[test]]
name = "model_deployment_tests"
path = "tests/model_deployment_tests.rs"
[[test]]
name = "model_tuning_tests"
path = "tests/model_tuning_tests.rs"
[[test]]
name = "performance_monitoring_tests"
path = "tests/performance_monitoring_tests.rs"
[[test]]
name = "platform_specific_tests"
path = "tests/platform_specific_tests.rs"
[[test]]
name = "request_caching_enhanced_tests"
path = "tests/request_caching_enhanced_tests.rs"
[[test]]
name = "responses_create_example_test"
path = "tests/responses_create_example_test.rs"
[[test]]
name = "responses_create_stream_example_test"
path = "tests/responses_create_stream_example_test.rs"
[[test]]
name = "responses_create_with_tools_example_test"
path = "tests/responses_create_with_tools_example_test.rs"
[[test]]
name = "retry"
path = "tests/retry.rs"
[[test]]
name = "sse_parsing_robustness_tests"
path = "tests/sse_parsing_robustness_tests.rs"
[[test]]
name = "streaming_chatbot_compilation_test"
path = "tests/streaming_chatbot_compilation_test.rs"
[[test]]
name = "streaming_chatbot_history_test"
path = "tests/streaming_chatbot_history_test.rs"
[[test]]
name = "streaming_control_tests"
path = "tests/streaming_control_tests.rs"
[[test]]
name = "streaming_performance_enhanced_tests"
path = "tests/streaming_performance_enhanced_tests.rs"
[[test]]
name = "sync_api_comprehensive_tests"
path = "tests/sync_api_comprehensive_tests.rs"
[[test]]
name = "sync_api_enhanced_tests"
path = "tests/sync_api_enhanced_tests.rs"
[[test]]
name = "sync_streaming_tests"
path = "tests/sync_streaming_tests.rs"
[[test]]
name = "test_isolation"
path = "tests/test_isolation.rs"
[[test]]
name = "unified_performance_dashboard_tests"
path = "tests/unified_performance_dashboard_tests.rs"
[[test]]
name = "websearch_tool_deserialization_test"
path = "tests/websearch_tool_deserialization_test.rs"
[[test]]
name = "websocket_reliability_enhanced_tests"
path = "tests/websocket_reliability_enhanced_tests.rs"
[[test]]
name = "websocket_streaming_tests"
path = "tests/websocket_streaming_tests.rs"
[[test]]
name = "workspace_secrets_integration_test"
path = "tests/workspace_secrets_integration_test.rs"
[dependencies.async-trait]
version = "^0.1"
optional = true
[dependencies.backoff]
version = "^0.4"
features = ["tokio"]
optional = true
[dependencies.base64]
version = "^0.22"
optional = true
[dependencies.blake3]
version = "^1.8"
optional = true
[dependencies.bytes]
version = "^1.10"
optional = true
[dependencies.chrono]
version = "^0.4"
optional = true
[dependencies.derive_tools]
version = "^0.68"
optional = true
[dependencies.error_tools]
version = "^0.40"
features = ["error_typed"]
optional = true
[dependencies.eventsource-stream]
version = "^0.2"
optional = true
[dependencies.flate2]
version = "^1.1"
optional = true
[dependencies.former]
version = "^2.48"
optional = true
[dependencies.futures]
version = "^0.3"
optional = true
[dependencies.futures-core]
version = "^0.3"
optional = true
[dependencies.futures-util]
version = "^0.3"
optional = true
[dependencies.mod_interface]
version = "^0.64"
optional = true
[dependencies.rand]
version = "^0.10"
optional = true
[dependencies.regex]
version = "^1.12"
optional = true
[dependencies.reqwest]
version = "^0.13"
features = [
"json",
"query",
"stream",
"multipart",
"rustls",
]
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.serde_yml]
version = "^0.0.13"
optional = true
[dependencies.sha2]
version = "^0.11"
optional = true
[dependencies.tokio]
version = "^1.52"
features = [
"macros",
"sync",
"time",
"rt-multi-thread",
]
optional = true
[dependencies.tokio-tungstenite]
version = "^0.29"
optional = true
[dependencies.tracing]
version = "^0.1"
optional = true
[dependencies.url]
version = "^2.5"
optional = true
[dependencies.uuid]
version = "^1.23"
features = ["v4"]
optional = true
[dependencies.workspace_tools]
version = "^0.14"
features = ["secrets"]
optional = true
[dev-dependencies.tempfile]
version = "^3.27"
[dev-dependencies.tracing-subscriber]
version = "^0.3"
[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