venice-sdk 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. venice_sdk-0.3.3/.gitignore +60 -0
  2. venice_sdk-0.3.3/CHANGELOG.md +166 -0
  3. venice_sdk-0.3.3/LICENSE +477 -0
  4. venice_sdk-0.3.3/PKG-INFO +648 -0
  5. venice_sdk-0.3.3/README.md +586 -0
  6. venice_sdk-0.3.3/docs/advanced/error_handling.md +209 -0
  7. venice_sdk-0.3.3/docs/advanced/function_calling.md +206 -0
  8. venice_sdk-0.3.3/docs/advanced/streaming.md +127 -0
  9. venice_sdk-0.3.3/docs/api/account.md +532 -0
  10. venice_sdk-0.3.3/docs/api/audio.md +426 -0
  11. venice_sdk-0.3.3/docs/api/chat.md +233 -0
  12. venice_sdk-0.3.3/docs/api/client.md +114 -0
  13. venice_sdk-0.3.3/docs/api/errors.md +116 -0
  14. venice_sdk-0.3.3/docs/api/images.md +545 -0
  15. venice_sdk-0.3.3/docs/api/models.md +134 -0
  16. venice_sdk-0.3.3/docs/api/video.md +529 -0
  17. venice_sdk-0.3.3/docs/best_practices.md +587 -0
  18. venice_sdk-0.3.3/docs/configuration.md +133 -0
  19. venice_sdk-0.3.3/docs/contributing.md +1 -0
  20. venice_sdk-0.3.3/docs/dev/API-PARITY-GAP-2026-08-13.md +81 -0
  21. venice_sdk-0.3.3/docs/dev/Venice-AI-API-Docs.md +1594 -0
  22. venice_sdk-0.3.3/docs/dev/Venice-AI-Python-SDK-Plan.md +255 -0
  23. venice_sdk-0.3.3/docs/dev/Venice-AI-SDK-100-Percent-Coverage-Plan.md +487 -0
  24. venice_sdk-0.3.3/docs/index.md +171 -0
  25. venice_sdk-0.3.3/docs/installation.md +87 -0
  26. venice_sdk-0.3.3/docs/quickstart.md +168 -0
  27. venice_sdk-0.3.3/examples/README.md +352 -0
  28. venice_sdk-0.3.3/examples/advanced/advanced_parameters.py +340 -0
  29. venice_sdk-0.3.3/examples/advanced/ai_assistant.py +548 -0
  30. venice_sdk-0.3.3/examples/advanced/image_processing_pipeline.py +379 -0
  31. venice_sdk-0.3.3/examples/advanced/streaming_chat.py +371 -0
  32. venice_sdk-0.3.3/examples/basic_chat.py +47 -0
  33. venice_sdk-0.3.3/examples/complete_api_demo.py +299 -0
  34. venice_sdk-0.3.3/examples/integrations/web_app.py +762 -0
  35. venice_sdk-0.3.3/examples/quick_start.py +82 -0
  36. venice_sdk-0.3.3/examples/tutorials/function_calling.py +615 -0
  37. venice_sdk-0.3.3/examples/tutorials/getting_started.py +409 -0
  38. venice_sdk-0.3.3/mkdocs.yml +76 -0
  39. venice_sdk-0.3.3/pyproject.toml +122 -0
  40. venice_sdk-0.3.3/scripts/mail_triage_venice_smoke.py +433 -0
  41. venice_sdk-0.3.3/tests/conftest.py +453 -0
  42. venice_sdk-0.3.3/tests/e2e/__init__.py +1 -0
  43. venice_sdk-0.3.3/tests/e2e/test_workflow_e2e.py +1099 -0
  44. venice_sdk-0.3.3/tests/integration/__init__.py +1 -0
  45. venice_sdk-0.3.3/tests/integration/test_api_integration.py +870 -0
  46. venice_sdk-0.3.3/tests/integration/test_cross_module_integration.py +720 -0
  47. venice_sdk-0.3.3/tests/live/__init__.py +10 -0
  48. venice_sdk-0.3.3/tests/live/test_account_live.py +524 -0
  49. venice_sdk-0.3.3/tests/live/test_audio_live.py +583 -0
  50. venice_sdk-0.3.3/tests/live/test_characters_live.py +508 -0
  51. venice_sdk-0.3.3/tests/live/test_chat_live.py +564 -0
  52. venice_sdk-0.3.3/tests/live/test_cli_live.py +686 -0
  53. venice_sdk-0.3.3/tests/live/test_client_live.py +311 -0
  54. venice_sdk-0.3.3/tests/live/test_config_live.py +555 -0
  55. venice_sdk-0.3.3/tests/live/test_embeddings_live.py +626 -0
  56. venice_sdk-0.3.3/tests/live/test_images_live.py +639 -0
  57. venice_sdk-0.3.3/tests/live/test_models_advanced_live.py +598 -0
  58. venice_sdk-0.3.3/tests/live/test_models_live.py +420 -0
  59. venice_sdk-0.3.3/tests/live/test_new_routes_live.py +133 -0
  60. venice_sdk-0.3.3/tests/live/test_runner.py +496 -0
  61. venice_sdk-0.3.3/tests/live/test_utils.py +116 -0
  62. venice_sdk-0.3.3/tests/live/test_venice_client_live.py +624 -0
  63. venice_sdk-0.3.3/tests/test_chat.py +192 -0
  64. venice_sdk-0.3.3/tests/test_cli.py +184 -0
  65. venice_sdk-0.3.3/tests/test_client.py +331 -0
  66. venice_sdk-0.3.3/tests/test_config.py +137 -0
  67. venice_sdk-0.3.3/tests/test_errors.py +65 -0
  68. venice_sdk-0.3.3/tests/test_models.py +469 -0
  69. venice_sdk-0.3.3/tests/test_rate_limit.py +83 -0
  70. venice_sdk-0.3.3/tests/test_utils.py +89 -0
  71. venice_sdk-0.3.3/tests/unit/__init__.py +1 -0
  72. venice_sdk-0.3.3/tests/unit/test_account_api.py +32 -0
  73. venice_sdk-0.3.3/tests/unit/test_account_comprehensive.py +1050 -0
  74. venice_sdk-0.3.3/tests/unit/test_audio_comprehensive.py +734 -0
  75. venice_sdk-0.3.3/tests/unit/test_characters_comprehensive.py +964 -0
  76. venice_sdk-0.3.3/tests/unit/test_chat_comprehensive.py +508 -0
  77. venice_sdk-0.3.3/tests/unit/test_cli_comprehensive.py +358 -0
  78. venice_sdk-0.3.3/tests/unit/test_client_comprehensive.py +300 -0
  79. venice_sdk-0.3.3/tests/unit/test_config_comprehensive.py +547 -0
  80. venice_sdk-0.3.3/tests/unit/test_coverage_100.py +221 -0
  81. venice_sdk-0.3.3/tests/unit/test_embeddings_comprehensive.py +878 -0
  82. venice_sdk-0.3.3/tests/unit/test_endpoints.py +110 -0
  83. venice_sdk-0.3.3/tests/unit/test_errors_comprehensive.py +266 -0
  84. venice_sdk-0.3.3/tests/unit/test_final_coverage_pass.py +456 -0
  85. venice_sdk-0.3.3/tests/unit/test_http_metrics_logging_coverage.py +252 -0
  86. venice_sdk-0.3.3/tests/unit/test_images_comprehensive.py +1349 -0
  87. venice_sdk-0.3.3/tests/unit/test_models.py +18 -0
  88. venice_sdk-0.3.3/tests/unit/test_models_advanced_comprehensive.py +850 -0
  89. venice_sdk-0.3.3/tests/unit/test_models_comprehensive.py +577 -0
  90. venice_sdk-0.3.3/tests/unit/test_parameter_discovery.py +111 -0
  91. venice_sdk-0.3.3/tests/unit/test_parity_0_3_3.py +343 -0
  92. venice_sdk-0.3.3/tests/unit/test_parity_coverage_extensions.py +366 -0
  93. venice_sdk-0.3.3/tests/unit/test_parity_modules_comprehensive.py +227 -0
  94. venice_sdk-0.3.3/tests/unit/test_remaining_coverage_pass.py +304 -0
  95. venice_sdk-0.3.3/tests/unit/test_typed_payloads.py +296 -0
  96. venice_sdk-0.3.3/tests/unit/test_utils_comprehensive.py +512 -0
  97. venice_sdk-0.3.3/tests/unit/test_venice_client_comprehensive.py +463 -0
  98. venice_sdk-0.3.3/tests/unit/test_video_comprehensive.py +1496 -0
  99. venice_sdk-0.3.3/venice_sdk/__init__.py +297 -0
  100. venice_sdk-0.3.3/venice_sdk/_http.py +67 -0
  101. venice_sdk-0.3.3/venice_sdk/account.py +905 -0
  102. venice_sdk-0.3.3/venice_sdk/audio.py +762 -0
  103. venice_sdk-0.3.3/venice_sdk/augment.py +221 -0
  104. venice_sdk-0.3.3/venice_sdk/characters.py +441 -0
  105. venice_sdk-0.3.3/venice_sdk/chat.py +511 -0
  106. venice_sdk-0.3.3/venice_sdk/cli.py +302 -0
  107. venice_sdk-0.3.3/venice_sdk/client.py +493 -0
  108. venice_sdk-0.3.3/venice_sdk/config.py +214 -0
  109. venice_sdk-0.3.3/venice_sdk/crypto.py +61 -0
  110. venice_sdk-0.3.3/venice_sdk/decisions.py +173 -0
  111. venice_sdk-0.3.3/venice_sdk/embeddings.py +461 -0
  112. venice_sdk-0.3.3/venice_sdk/endpoints.py +136 -0
  113. venice_sdk-0.3.3/venice_sdk/errors.py +289 -0
  114. venice_sdk-0.3.3/venice_sdk/images.py +827 -0
  115. venice_sdk-0.3.3/venice_sdk/logging_config.py +74 -0
  116. venice_sdk-0.3.3/venice_sdk/metrics.py +205 -0
  117. venice_sdk-0.3.3/venice_sdk/models.py +270 -0
  118. venice_sdk-0.3.3/venice_sdk/models_advanced.py +609 -0
  119. venice_sdk-0.3.3/venice_sdk/responses.py +165 -0
  120. venice_sdk-0.3.3/venice_sdk/tee.py +70 -0
  121. venice_sdk-0.3.3/venice_sdk/utils.py +181 -0
  122. venice_sdk-0.3.3/venice_sdk/venice_client.py +212 -0
  123. venice_sdk-0.3.3/venice_sdk/video.py +954 -0
  124. venice_sdk-0.3.3/venice_sdk/voice_changer.py +226 -0
  125. venice_sdk-0.3.3/venice_sdk/x402.py +247 -0
@@ -0,0 +1,60 @@
1
+ # Environment variables
2
+ .env
3
+ .env.*
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+ *.so
10
+ .Python
11
+ .venv/
12
+ venv/
13
+ build/
14
+ develop-eggs/
15
+ dist/
16
+ downloads/
17
+ eggs/
18
+ .eggs/
19
+ lib/
20
+ lib64/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+
29
+ # IDE
30
+ .idea/
31
+ .vscode/
32
+ *.swp
33
+ *.swo
34
+
35
+ # Testing
36
+ .coverage
37
+ htmlcov/
38
+ .pytest_cache/
39
+ .tox/
40
+
41
+ # Logs
42
+ *.log
43
+ logs/
44
+
45
+ # OS
46
+ .DS_Store
47
+ Thumbs.db
48
+
49
+ # Temporary files
50
+ tmp/
51
+
52
+ # Temporary test/debug scripts (repo root only — not tests/)
53
+ /test_*.py
54
+ /check_*.py
55
+ /get_*.py
56
+ /debug_*.py
57
+
58
+ # Local Venice benchmark output (regenerated by scripts/mail_triage_venice_smoke.py)
59
+ scripts/mail_triage_venice_smoke_last.json
60
+ .otto-githooks-installed
@@ -0,0 +1,166 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.3] - 2026-10-24
9
+
10
+ ### Added
11
+ - Jev Decisions (beta): `client.decisions.create()` → `POST /decisions`, `client.decisions.systemone()` → `POST /systemone`. Typed `DecisionResult` / `DecisionAnswer` (noul / choice / score); original JSON on `.raw`.
12
+ - Voice changer: `client.voice_changer` → `POST /audio/voice-changer/{quote,queue,retrieve,complete}`. File or `audio_url` (not both). `complete()` waits; `cleanup()` hits `/complete`. `get_valid_parameters()` quote-probes source durations.
13
+ - `ModelsAPI.list(type=...)` including `decision` / `tts` / `asr` / `music` / `upscale` / `inpaint` / `all` / `code`.
14
+ - Chat multimodal `file` content parts (PDF/DOCX/PPTX/XLSX/TXT extracted server-side).
15
+ - `ModelCapabilities` flags from live `model_spec.capabilities`: video/audio input, reasoning, E2EE, X search, multiple images.
16
+
17
+ ### Fixed
18
+ - `BillingAPI.get_usage*` no longer calls sunset `GET /billing/usage` (410 since 2026-09-16). It reads `GET /billing/usage-history` (`startTimestamp` / `endTimestamp` / `pageSize` / `cursor`).
19
+ - `VideoAPI.transcribe()` no longer POSTs retired `/video/transcriptions`. Raises `VeniceAPIError` 410 pointing at chat `video_url` + `supportsVideoInput`.
20
+ - `ModelsAPI.get()` looks up across `type=all` so image/video/decision ids resolve.
21
+
22
+ ### Tests
23
+ - Unit + integration coverage of `venice_sdk` kept at 100%.
24
+
25
+ ## [0.3.2] - 2026-08-15
26
+
27
+ ### Added
28
+ - Typed payloads: `Response` / `ResponseOutputItem`, `SearchResponse` / `ScrapeResponse` / `ParsedDocument`, `TranscriptionResult`, `X402Balance` / `X402TopUpResult` / `X402Transactions`.
29
+ - `MusicAPI.get_valid_parameters()` — quote-probe duration × `force_instrumental` combinations (video #65 twin).
30
+ - `ImageAPI.get_model_constraints()` / `get_image_model_constraints()` — read aspect/resolution/style/size allowlists from `/models` `model_spec` (no generate grind).
31
+ - x402 wallet flow: `build_payment_payload`, `encode_payment_signature` / `decode_payment_signature`, `X402API.top_up_with_signer()` (caller supplies the wallet signer; SDK never holds keys).
32
+ - Chat `Message` accepts multimodal `content` lists, `Message` instances in `complete()`, plus `text_content()` / `to_dict()` / `from_dict()`.
33
+ - Live tests for responses, augment, styles, STT, and x402 (`tests/live/test_new_routes_live.py`).
34
+
35
+ ### Fixed
36
+ - Clarified that `VideoAPI.complete()` is the sync queue+wait helper (music-parity). Venice job cleanup is `VideoAPI.cleanup()` → `POST /video/complete` (#66).
37
+
38
+ ### Changed
39
+ - `ResponsesAPI.create`, augment search/scrape/parse, JSON transcriptions, and x402 methods return typed objects (original JSON on `.raw`).
40
+ - `VideoAPI.get_valid_parameters()` now probes the full duration × aspect_ratio grid and returns `combinations` with every valid pair (#65).
41
+
42
+ ### Tests
43
+ - Unit + integration coverage of `venice_sdk` kept at 100%.
44
+
45
+ ## [0.3.1] - 2026-08-13
46
+
47
+ ### Fixed
48
+ - Image upscale/styles paths: use live Venice routes `/image/upscale` and `/image/styles` (plural `/images/...` returned 404).
49
+ - Billing summary: `/billing/summary` removed from Venice; `get_billing_summary()` now uses `/billing/balance` with usage fallback.
50
+ - Documented that `GET /models/traits` exists; added `ModelsTraitsAPI.get_trait_categories()`.
51
+
52
+ ### Added
53
+ - Multipart POST support on `HTTPClient.post_multipart` (transcriptions, voice clone, text-parser).
54
+ - `POST /responses` via `client.responses` (`ResponsesAPI`).
55
+ - `POST /audio/transcriptions` (`AudioAPI.transcribe`) and `POST /audio/voices` (`AudioAPI.clone_voice`).
56
+ - `POST /video/transcriptions` (`VideoAPI.transcribe`).
57
+ - Venice-native `POST /image/generate` (`ImageAPI.generate_native`).
58
+ - Augment tools: `client.augment.search|scrape|parse_text`.
59
+ - Billing: `get_balance`, `get_usage_analytics`, `get_usage_history`.
60
+ - Character reviews: `CharactersAPI.reviews`.
61
+ - Crypto RPC: `client.crypto.networks|rpc`.
62
+ - x402: `client.x402.balance|top_up|transactions`.
63
+ - Chat: multimodal/`tool` roles; first-class `reasoning`, `tool_choice`, `response_format`, `top_p`/`top_k`, etc.
64
+ - Parity inventory: `docs/dev/API-PARITY-GAP-2026-08-13.md`.
65
+
66
+ ## [0.3.0] - 2026-03-19
67
+
68
+ ### Added
69
+ - **Image multi-edit**: `ImageEditAPI.multi_edit()` and `multi_edit_image()` for editing with 1–3 layered images (base + masks/overlays) via `/image/multi-edit`.
70
+ - **Image background remove**: `ImageEditAPI.remove_background()` and `remove_background()` for AI background removal via `/image/background-remove`.
71
+ - **Music generation API**: `MusicAPI` with `queue()`, `retrieve()`, `quote()`, and `complete()` for async music/sound-effect generation (`/audio/queue`, `/audio/retrieve`, `/audio/quote`, `/audio/complete`). Exposed as `client.music`.
72
+ - **TEE API**: `TEEAPI` with `attestation()` and `signature()` for Trusted Execution Environment verification. Exposed as `client.tee`.
73
+ - **Chat**: Optional `prompt_cache_key` parameter for prompt caching, and expanded docstring for `venice_parameters` (e.g. `enable_web_search`, `enable_web_scraping`, `enable_x_search`, `strip_thinking_response`, `disable_thinking`, `enable_web_citations`, etc.).
74
+
75
+ ### Changed
76
+ - Endpoints: added `ImageEndpoints.MULTI_EDIT`, `BACKGROUND_REMOVE`; `AudioEndpoints.QUEUE`, `RETRIEVE`, `QUOTE`, `COMPLETE`; `TEEEndpoints.ATTESTATION`, `SIGNATURE`.
77
+
78
+ ## [0.2.1] - 2025-01-22
79
+
80
+ ### Changed
81
+ - Added explicit upper bounds to all runtime, developer, documentation, and publishing dependencies to prevent breaking changes from surprise major upgrades.
82
+ - Documented the new dependency version policy in `docs/installation.md` so contributors understand how we validate new ranges.
83
+
84
+ ### Added
85
+ - **Token Counting Encoder Override**: Added optional `encoder` and `model` parameters to `count_tokens()` function for flexible token counting
86
+ - **Centralized Endpoint Constants**: Created `venice_sdk/endpoints.py` module for consistent API endpoint management
87
+ - **Enhanced Error Handling**: Improved fallback mechanisms for invalid encoders in token counting
88
+
89
+ ### Changed
90
+ - **Image Endpoint Consistency**: Standardized all image API endpoints to use `/images/` prefix for consistency
91
+ - **Temperature Documentation**: Updated all temperature range documentation to consistently show 0-2 range
92
+ - **Test Statistics**: Updated README with accurate test count (1069 tests) and pass rate (100%)
93
+
94
+ ### Fixed
95
+ - **Unicode Compatibility**: Fixed Unicode characters in examples for Windows console compatibility
96
+ - **Documentation Accuracy**: Corrected misleading test statistics and claims in README
97
+ - **Cross-Platform Support**: Improved example compatibility across different operating systems
98
+
99
+ ## [0.2.0] - 2025-01-22
100
+
101
+ ### Added
102
+ - **Admin API Key Management**: Full support for creating, listing, and deleting API keys
103
+ - **Advanced Billing Management**: Comprehensive usage tracking, rate limiting, and billing summaries
104
+ - **Enhanced Error Handling**: Improved error messages and validation throughout the SDK
105
+ - **Streaming Chat Support**: Proper Server-Sent Events (SSE) handling for real-time chat responses
106
+ - **Image Generation Enhancements**: Support for data URLs and improved file handling
107
+ - **Comprehensive Test Suite**: 350+ tests with 90%+ pass rate including live API tests
108
+ - **Input Validation**: Robust parameter validation for all API endpoints
109
+ - **Timeout Handling**: Graceful handling of API timeouts and rate limits
110
+ - **Multiple API Key Support**: Support for both admin and inference-only API keys
111
+
112
+ ### Changed
113
+ - **API Response Parsing**: Updated to match actual Venice AI API response structures
114
+ - **Model Capabilities**: Fixed capability mapping to use correct API capability names
115
+ - **Data Structures**: Aligned all data classes with actual API response formats
116
+ - **Error Messages**: Improved error messages for better debugging and user experience
117
+ - **Test Infrastructure**: Enhanced test isolation and cleanup to prevent interference
118
+
119
+ ### Fixed
120
+ - **Connection Issues**: Resolved fake URL connection errors in test suite
121
+ - **Authentication**: Fixed admin API key authentication and permission handling
122
+ - **Rate Limiting**: Corrected rate limit parsing from nested API response structure
123
+ - **Usage Tracking**: Fixed billing and usage data parsing from array-based responses
124
+ - **Image Handling**: Fixed base64 import issues and data URL support
125
+ - **Chat Streaming**: Corrected SSE format handling for streaming responses
126
+ - **CLI Functionality**: Fixed Click command invocation and Unicode handling on Windows
127
+ - **Environment Management**: Improved .env file handling and environment variable restoration
128
+ - **Test Assertions**: Updated hundreds of test assertions to match actual API behavior
129
+
130
+ ### Security
131
+ - **API Key Validation**: Enhanced validation and error handling for API key operations
132
+ - **Input Sanitization**: Added comprehensive input validation to prevent invalid API calls
133
+ - **Error Handling**: Improved error handling to prevent sensitive information leakage
134
+
135
+ ### License
136
+ - **Dual License**: Changed from CC-BY-SA 4.0 to dual license (AGPLv3 + CC-BY-SA 4.0)
137
+ - **Code/Software**: GNU Affero General Public License v3.0 (AGPLv3) - Strong copyleft protection
138
+ - **Documentation/Examples**: Creative Commons Attribution-ShareAlike 4.0 International (CC-BY-SA) - Attribution required
139
+
140
+ ## [0.1.0] - 2024-03-20
141
+
142
+ ### Added
143
+ - Initial release of the Venice SDK
144
+ - Core HTTP client with retry logic and error handling
145
+ - Chat completion API with streaming support
146
+ - Function calling/tools support
147
+ - Model discovery functionality
148
+ - CLI for managing API credentials
149
+ - Comprehensive documentation
150
+ - Test suite with live tests
151
+ - Environment variable and .env file support
152
+
153
+ ### Changed
154
+ - N/A (initial release)
155
+
156
+ ### Deprecated
157
+ - N/A (initial release)
158
+
159
+ ### Removed
160
+ - N/A (initial release)
161
+
162
+ ### Fixed
163
+ - N/A (initial release)
164
+
165
+ ### Security
166
+ - N/A (initial release)