scale-gp-beta 0.1.0a2__tar.gz → 0.1.0a4__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.
- scale_gp_beta-0.1.0a4/.release-please-manifest.json +3 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/CHANGELOG.md +62 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/CONTRIBUTING.md +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/LICENSE +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/PKG-INFO +144 -30
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/README.md +139 -24
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/SECURITY.md +4 -4
- scale_gp_beta-0.1.0a4/api.md +111 -0
- scale_gp_beta-0.1.0a4/bin/publish-pypi +6 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/mypy.ini +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/pyproject.toml +8 -10
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/release-please-config.json +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/requirements-dev.lock +1 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/requirements.lock +1 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/__init__.py +2 -2
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_base_client.py +10 -99
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_client.py +1 -1
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_files.py +1 -1
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_models.py +5 -2
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_response.py +6 -4
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_types.py +1 -1
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_logs.py +2 -2
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_version.py +2 -2
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/chat/completions.py +86 -92
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/models.py +26 -2
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/inference_model.py +18 -4
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/model_list_params.py +15 -1
- scale_gp_beta-0.1.0a4/src/sgp_dev/lib/.keep +4 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/chat/test_completions.py +2 -2
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/files/test_content.py +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_completions.py +2 -2
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_files.py +3 -3
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_inference.py +2 -2
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_models.py +3 -3
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_question_sets.py +3 -3
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_questions.py +3 -3
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/conftest.py +2 -2
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_client.py +26 -26
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_deepcopy.py +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_extract_files.py +2 -2
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_files.py +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_models.py +35 -3
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_qs.py +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_required_args.py +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_response.py +7 -7
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_streaming.py +2 -2
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_transform.py +4 -4
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_utils/test_proxy.py +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/test_utils/test_typing.py +1 -1
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/utils.py +4 -4
- scale_gp_beta-0.1.0a2/.release-please-manifest.json +0 -3
- scale_gp_beta-0.1.0a2/api.md +0 -111
- scale_gp_beta-0.1.0a2/bin/publish-pypi +0 -9
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/.gitignore +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/bin/check-release-environment +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/examples/.keep +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/noxfile.py +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/src/scale_gp/lib/.keep +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_compat.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_constants.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_exceptions.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_qs.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_resource.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_streaming.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_proxy.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_reflection.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_streams.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_sync.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_transform.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_typing.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/_utils/_utils.py +0 -0
- {scale_gp_beta-0.1.0a2/src/sgp_dev → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/lib/.keep +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/pagination.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/py.typed +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/chat/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/chat/chat.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/completions.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/files/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/files/content.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/files/files.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/inference.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/question_sets.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/resources/questions.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/chat/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/chat/chat_completion.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/chat/chat_completion_chunk.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/chat/completion_create_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/chat/completion_create_response.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/completion.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/completion_create_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/file.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/file_create_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/file_delete_response.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/file_list.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/file_list_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/file_update_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/files/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/inference_create_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/inference_create_response.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/inference_model_list.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/inference_response.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/inference_response_chunk.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/model_create_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/model_delete_response.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/model_update_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_create_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_list.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_list_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_set.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_set_create_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_set_delete_response.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_set_list.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_set_list_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_set_retrieve_params.py +0 -0
- {scale_gp_beta-0.1.0a2/src/scale_gp → scale_gp_beta-0.1.0a4/src/scale_gp_beta}/types/question_set_update_params.py +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/chat/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/api_resources/files/__init__.py +0 -0
- {scale_gp_beta-0.1.0a2 → scale_gp_beta-0.1.0a4}/tests/sample_file.txt +0 -0
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.4 (2025-03-17)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/scaleapi/sgp-python-beta/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([#63](https://github.com/scaleapi/sgp-python-beta/issues/63)) ([2a712d0](https://github.com/scaleapi/sgp-python-beta/commit/2a712d0e51d74b6a5e76205341b08f65d07f796e))
|
|
10
|
+
* **api:** api update ([#65](https://github.com/scaleapi/sgp-python-beta/issues/65)) ([e5c071b](https://github.com/scaleapi/sgp-python-beta/commit/e5c071ba2535eb3bae74fbf470204af85131c4c9))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **ci:** ensure pip is always available ([#69](https://github.com/scaleapi/sgp-python-beta/issues/69)) ([e054e83](https://github.com/scaleapi/sgp-python-beta/commit/e054e831f464d6644f143b02ae71e9bd41e0abfa))
|
|
16
|
+
* **ci:** remove publishing patch ([#70](https://github.com/scaleapi/sgp-python-beta/issues/70)) ([cacfacf](https://github.com/scaleapi/sgp-python-beta/commit/cacfacf2e3a869893db9a378e86d7b321ece1d3e))
|
|
17
|
+
* **types:** handle more discriminated union shapes ([#68](https://github.com/scaleapi/sgp-python-beta/issues/68)) ([3013250](https://github.com/scaleapi/sgp-python-beta/commit/3013250213505a0d5fac5af06aae97f2a50736f6))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* **internal:** bump rye to 0.44.0 ([#66](https://github.com/scaleapi/sgp-python-beta/issues/66)) ([ee4214c](https://github.com/scaleapi/sgp-python-beta/commit/ee4214c22b22d7cf529c1154c1ad517e79d40ba7))
|
|
23
|
+
* **internal:** codegen related update ([#62](https://github.com/scaleapi/sgp-python-beta/issues/62)) ([826dc22](https://github.com/scaleapi/sgp-python-beta/commit/826dc2260c20ba197e11a57ea86fded1457a6cd4))
|
|
24
|
+
* **internal:** codegen related update ([#67](https://github.com/scaleapi/sgp-python-beta/issues/67)) ([bb07a9c](https://github.com/scaleapi/sgp-python-beta/commit/bb07a9cc6887845c337fd956b2fe50a82a9896f0))
|
|
25
|
+
* **internal:** remove extra empty newlines ([#64](https://github.com/scaleapi/sgp-python-beta/issues/64)) ([d6cf4e1](https://github.com/scaleapi/sgp-python-beta/commit/d6cf4e1428717137f0cb51f7d47d2b2de2c94530))
|
|
26
|
+
* **internal:** remove unused http client options forwarding ([#58](https://github.com/scaleapi/sgp-python-beta/issues/58)) ([f5d4dbd](https://github.com/scaleapi/sgp-python-beta/commit/f5d4dbd4980aa57e649bde22f46f3c241add3ab6))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Documentation
|
|
30
|
+
|
|
31
|
+
* revise readme docs about nested params ([#60](https://github.com/scaleapi/sgp-python-beta/issues/60)) ([bf4986e](https://github.com/scaleapi/sgp-python-beta/commit/bf4986eeede8dd114f3c05280e17b76d2defaeb6))
|
|
32
|
+
|
|
33
|
+
## 0.1.0-alpha.3 (2025-02-27)
|
|
34
|
+
|
|
35
|
+
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/scaleapi/sgp-python-beta/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* **api:** api update ([#38](https://github.com/scaleapi/sgp-python-beta/issues/38)) ([2b937be](https://github.com/scaleapi/sgp-python-beta/commit/2b937be5ad88ee52c14549dea80b075dae953848))
|
|
40
|
+
* **api:** api update ([#41](https://github.com/scaleapi/sgp-python-beta/issues/41)) ([8c13bc8](https://github.com/scaleapi/sgp-python-beta/commit/8c13bc821acf116e0f4831ec6512f99563f9c17a))
|
|
41
|
+
* **api:** manual updates ([#45](https://github.com/scaleapi/sgp-python-beta/issues/45)) ([47f0b21](https://github.com/scaleapi/sgp-python-beta/commit/47f0b21f78173cda0ed957d9e64cbaf39a79befd))
|
|
42
|
+
* **api:** manual updates ([#46](https://github.com/scaleapi/sgp-python-beta/issues/46)) ([d722b15](https://github.com/scaleapi/sgp-python-beta/commit/d722b157c62561666ede72aa2a3ede32753a6fe7))
|
|
43
|
+
* **api:** manual updates ([#48](https://github.com/scaleapi/sgp-python-beta/issues/48)) ([373c6e3](https://github.com/scaleapi/sgp-python-beta/commit/373c6e31bb8d3729e7b5617082c9f6d9ede7ea82))
|
|
44
|
+
* **api:** manual updates ([#56](https://github.com/scaleapi/sgp-python-beta/issues/56)) ([7ce79e6](https://github.com/scaleapi/sgp-python-beta/commit/7ce79e6545ccd1cb49dcc7ef880b5fc059ae149a))
|
|
45
|
+
* **client:** allow passing `NotGiven` for body ([#42](https://github.com/scaleapi/sgp-python-beta/issues/42)) ([b2e3024](https://github.com/scaleapi/sgp-python-beta/commit/b2e3024c1ed0ed05f18e300cd58b0cf99658e1fd))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Bug Fixes
|
|
49
|
+
|
|
50
|
+
* **client:** mark some request bodies as optional ([b2e3024](https://github.com/scaleapi/sgp-python-beta/commit/b2e3024c1ed0ed05f18e300cd58b0cf99658e1fd))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Chores
|
|
54
|
+
|
|
55
|
+
* **internal:** codegen related update ([#40](https://github.com/scaleapi/sgp-python-beta/issues/40)) ([c9f4be1](https://github.com/scaleapi/sgp-python-beta/commit/c9f4be1c9d5688926ba1b4033cbcac66950a950f))
|
|
56
|
+
* **internal:** fix devcontainers setup ([#43](https://github.com/scaleapi/sgp-python-beta/issues/43)) ([0752322](https://github.com/scaleapi/sgp-python-beta/commit/07523229582db759392ab96d8309e467a803f48b))
|
|
57
|
+
* **internal:** properly set __pydantic_private__ ([#44](https://github.com/scaleapi/sgp-python-beta/issues/44)) ([a539736](https://github.com/scaleapi/sgp-python-beta/commit/a539736da3a00608372e6fbbdc518bae9df7eb1d))
|
|
58
|
+
* remove custom code ([b3b0db0](https://github.com/scaleapi/sgp-python-beta/commit/b3b0db07483635cdb552d42f4068ce01531c0d8f))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Documentation
|
|
62
|
+
|
|
63
|
+
* mention it is a beta client ([e8aea2a](https://github.com/scaleapi/sgp-python-beta/commit/e8aea2a70b60cb181ba5ade2c810960564e0cc84))
|
|
64
|
+
|
|
3
65
|
## 0.1.0-alpha.2 (2025-02-13)
|
|
4
66
|
|
|
5
67
|
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/scaleapi/sgp-python-beta/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
|
|
@@ -37,7 +37,7 @@ $ pip install -r requirements-dev.lock
|
|
|
37
37
|
|
|
38
38
|
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
|
|
39
39
|
result in merge conflicts between manual patches and changes from the generator. The generator will never
|
|
40
|
-
modify the contents of the `src/
|
|
40
|
+
modify the contents of the `src/scale_gp_beta/lib/` and `examples/` directories.
|
|
41
41
|
|
|
42
42
|
## Adding and running examples
|
|
43
43
|
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2025
|
|
189
|
+
Copyright 2025 Scale GP
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: scale-gp-beta
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: The official Python library for the
|
|
3
|
+
Version: 0.1.0a4
|
|
4
|
+
Summary: The official Python library for the Scale GP API
|
|
5
5
|
Project-URL: Homepage, https://github.com/scaleapi/sgp-python-beta
|
|
6
6
|
Project-URL: Repository, https://github.com/scaleapi/sgp-python-beta
|
|
7
|
-
Author-email:
|
|
8
|
-
License
|
|
9
|
-
License-File: LICENSE
|
|
7
|
+
Author-email: Scale GP <anish.agrawal@scale.com>
|
|
8
|
+
License: Apache-2.0
|
|
10
9
|
Classifier: Intended Audience :: Developers
|
|
11
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
11
|
Classifier: Operating System :: MacOS
|
|
@@ -30,15 +29,15 @@ Requires-Dist: sniffio
|
|
|
30
29
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
30
|
Description-Content-Type: text/markdown
|
|
32
31
|
|
|
33
|
-
#
|
|
32
|
+
# Scale GP Python API library
|
|
34
33
|
|
|
35
34
|
[](https://pypi.org/project/scale-gp-beta/)
|
|
36
35
|
|
|
37
|
-
The
|
|
36
|
+
The Scale GP Python library provides convenient access to the Scale GP REST API from any Python 3.8+
|
|
38
37
|
application. The library includes type definitions for all request params and response fields,
|
|
39
38
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
40
39
|
|
|
41
|
-
It is generated with [Stainless](https://www.
|
|
40
|
+
It is generated with [Stainless](https://www.stainless.com/).
|
|
42
41
|
|
|
43
42
|
## Documentation
|
|
44
43
|
|
|
@@ -57,7 +56,7 @@ The full API of this library can be found in [api.md](https://github.com/scaleap
|
|
|
57
56
|
|
|
58
57
|
```python
|
|
59
58
|
import os
|
|
60
|
-
from
|
|
59
|
+
from scale_gp_beta import SGPClient
|
|
61
60
|
|
|
62
61
|
client = SGPClient(
|
|
63
62
|
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
|
|
@@ -85,7 +84,7 @@ Simply import `AsyncSGPClient` instead of `SGPClient` and use `await` with each
|
|
|
85
84
|
```python
|
|
86
85
|
import os
|
|
87
86
|
import asyncio
|
|
88
|
-
from
|
|
87
|
+
from scale_gp_beta import AsyncSGPClient
|
|
89
88
|
|
|
90
89
|
client = AsyncSGPClient(
|
|
91
90
|
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
|
|
@@ -113,7 +112,7 @@ Functionality between the synchronous and asynchronous clients is otherwise iden
|
|
|
113
112
|
We provide support for streaming responses using Server Side Events (SSE).
|
|
114
113
|
|
|
115
114
|
```python
|
|
116
|
-
from
|
|
115
|
+
from scale_gp_beta import SGPClient
|
|
117
116
|
|
|
118
117
|
client = SGPClient(
|
|
119
118
|
account_id="My Account ID",
|
|
@@ -131,7 +130,7 @@ for completion in stream:
|
|
|
131
130
|
The async client uses the exact same interface.
|
|
132
131
|
|
|
133
132
|
```python
|
|
134
|
-
from
|
|
133
|
+
from scale_gp_beta import AsyncSGPClient
|
|
135
134
|
|
|
136
135
|
client = AsyncSGPClient(
|
|
137
136
|
account_id="My Account ID",
|
|
@@ -155,18 +154,133 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
|
|
|
155
154
|
|
|
156
155
|
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
|
157
156
|
|
|
157
|
+
## Pagination
|
|
158
|
+
|
|
159
|
+
List methods in the Scale GP API are paginated.
|
|
160
|
+
|
|
161
|
+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
from scale_gp_beta import SGPClient
|
|
165
|
+
|
|
166
|
+
client = SGPClient(
|
|
167
|
+
account_id="My Account ID",
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
all_models = []
|
|
171
|
+
# Automatically fetches more pages as needed.
|
|
172
|
+
for model in client.models.list(
|
|
173
|
+
limit=10,
|
|
174
|
+
):
|
|
175
|
+
# Do something with model here
|
|
176
|
+
all_models.append(model)
|
|
177
|
+
print(all_models)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Or, asynchronously:
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
import asyncio
|
|
184
|
+
from scale_gp_beta import AsyncSGPClient
|
|
185
|
+
|
|
186
|
+
client = AsyncSGPClient(
|
|
187
|
+
account_id="My Account ID",
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
async def main() -> None:
|
|
192
|
+
all_models = []
|
|
193
|
+
# Iterate through items across all pages, issuing requests as needed.
|
|
194
|
+
async for model in client.models.list(
|
|
195
|
+
limit=10,
|
|
196
|
+
):
|
|
197
|
+
all_models.append(model)
|
|
198
|
+
print(all_models)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
asyncio.run(main())
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
first_page = await client.models.list(
|
|
208
|
+
limit=10,
|
|
209
|
+
)
|
|
210
|
+
if first_page.has_next_page():
|
|
211
|
+
print(f"will fetch next page using these details: {first_page.next_page_info()}")
|
|
212
|
+
next_page = await first_page.get_next_page()
|
|
213
|
+
print(f"number of items we just fetched: {len(next_page.items)}")
|
|
214
|
+
|
|
215
|
+
# Remove `await` for non-async usage.
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Or just work directly with the returned data:
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
first_page = await client.models.list(
|
|
222
|
+
limit=10,
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
print(f"next page cursor: {first_page.starting_after}") # => "next page cursor: ..."
|
|
226
|
+
for model in first_page.items:
|
|
227
|
+
print(model.id)
|
|
228
|
+
|
|
229
|
+
# Remove `await` for non-async usage.
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Nested params
|
|
233
|
+
|
|
234
|
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
from scale_gp_beta import SGPClient
|
|
238
|
+
|
|
239
|
+
client = SGPClient(
|
|
240
|
+
account_id="My Account ID",
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
inference = client.inference.create(
|
|
244
|
+
model="model",
|
|
245
|
+
inference_configuration={
|
|
246
|
+
"num_retries": 0,
|
|
247
|
+
"timeout_seconds": 0,
|
|
248
|
+
},
|
|
249
|
+
)
|
|
250
|
+
print(inference.inference_configuration)
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## File uploads
|
|
254
|
+
|
|
255
|
+
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
from pathlib import Path
|
|
259
|
+
from scale_gp_beta import SGPClient
|
|
260
|
+
|
|
261
|
+
client = SGPClient(
|
|
262
|
+
account_id="My Account ID",
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
client.files.create(
|
|
266
|
+
file=Path("/path/to/file"),
|
|
267
|
+
)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
|
|
271
|
+
|
|
158
272
|
## Handling errors
|
|
159
273
|
|
|
160
|
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `
|
|
274
|
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `scale_gp_beta.APIConnectionError` is raised.
|
|
161
275
|
|
|
162
276
|
When the API returns a non-success status code (that is, 4xx or 5xx
|
|
163
|
-
response), a subclass of `
|
|
277
|
+
response), a subclass of `scale_gp_beta.APIStatusError` is raised, containing `status_code` and `response` properties.
|
|
164
278
|
|
|
165
|
-
All errors inherit from `
|
|
279
|
+
All errors inherit from `scale_gp_beta.APIError`.
|
|
166
280
|
|
|
167
281
|
```python
|
|
168
|
-
import
|
|
169
|
-
from
|
|
282
|
+
import scale_gp_beta
|
|
283
|
+
from scale_gp_beta import SGPClient
|
|
170
284
|
|
|
171
285
|
client = SGPClient(
|
|
172
286
|
account_id="My Account ID",
|
|
@@ -177,12 +291,12 @@ try:
|
|
|
177
291
|
messages=[{"foo": "bar"}],
|
|
178
292
|
model="model",
|
|
179
293
|
)
|
|
180
|
-
except
|
|
294
|
+
except scale_gp_beta.APIConnectionError as e:
|
|
181
295
|
print("The server could not be reached")
|
|
182
296
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
183
|
-
except
|
|
297
|
+
except scale_gp_beta.RateLimitError as e:
|
|
184
298
|
print("A 429 status code was received; we should back off a bit.")
|
|
185
|
-
except
|
|
299
|
+
except scale_gp_beta.APIStatusError as e:
|
|
186
300
|
print("Another non-200-range status code was received")
|
|
187
301
|
print(e.status_code)
|
|
188
302
|
print(e.response)
|
|
@@ -210,7 +324,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
|
|
|
210
324
|
You can use the `max_retries` option to configure or disable retry settings:
|
|
211
325
|
|
|
212
326
|
```python
|
|
213
|
-
from
|
|
327
|
+
from scale_gp_beta import SGPClient
|
|
214
328
|
|
|
215
329
|
# Configure the default for all requests:
|
|
216
330
|
client = SGPClient(
|
|
@@ -232,7 +346,7 @@ By default requests time out after 1 minute. You can configure this with a `time
|
|
|
232
346
|
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
|
|
233
347
|
|
|
234
348
|
```python
|
|
235
|
-
from
|
|
349
|
+
from scale_gp_beta import SGPClient
|
|
236
350
|
|
|
237
351
|
# Configure the default for all requests:
|
|
238
352
|
client = SGPClient(
|
|
@@ -289,7 +403,7 @@ if response.my_field is None:
|
|
|
289
403
|
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
|
|
290
404
|
|
|
291
405
|
```py
|
|
292
|
-
from
|
|
406
|
+
from scale_gp_beta import SGPClient
|
|
293
407
|
|
|
294
408
|
client = SGPClient(
|
|
295
409
|
account_id="My Account ID",
|
|
@@ -306,9 +420,9 @@ completion = response.parse() # get the object that `chat.completions.create()`
|
|
|
306
420
|
print(completion)
|
|
307
421
|
```
|
|
308
422
|
|
|
309
|
-
These methods return an [`APIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/
|
|
423
|
+
These methods return an [`APIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/scale_gp_beta/_response.py) object.
|
|
310
424
|
|
|
311
|
-
The async client returns an [`AsyncAPIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/
|
|
425
|
+
The async client returns an [`AsyncAPIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/scale_gp_beta/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
|
|
312
426
|
|
|
313
427
|
#### `.with_streaming_response`
|
|
314
428
|
|
|
@@ -373,7 +487,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
|
|
|
373
487
|
|
|
374
488
|
```python
|
|
375
489
|
import httpx
|
|
376
|
-
from
|
|
490
|
+
from scale_gp_beta import SGPClient, DefaultHttpxClient
|
|
377
491
|
|
|
378
492
|
client = SGPClient(
|
|
379
493
|
# Or use the `SGP_CLIENT_BASE_URL` env var
|
|
@@ -397,7 +511,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
|
|
|
397
511
|
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
|
|
398
512
|
|
|
399
513
|
```py
|
|
400
|
-
from
|
|
514
|
+
from scale_gp_beta import SGPClient
|
|
401
515
|
|
|
402
516
|
with SGPClient(
|
|
403
517
|
account_id="My Account ID",
|
|
@@ -427,8 +541,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
|
|
|
427
541
|
You can determine the version that is being used at runtime with:
|
|
428
542
|
|
|
429
543
|
```py
|
|
430
|
-
import
|
|
431
|
-
print(
|
|
544
|
+
import scale_gp_beta
|
|
545
|
+
print(scale_gp_beta.__version__)
|
|
432
546
|
```
|
|
433
547
|
|
|
434
548
|
## Requirements
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scale GP Python API library
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/scale-gp-beta/)
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The Scale GP Python library provides convenient access to the Scale GP REST API from any Python 3.8+
|
|
6
6
|
application. The library includes type definitions for all request params and response fields,
|
|
7
7
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
8
8
|
|
|
9
|
-
It is generated with [Stainless](https://www.
|
|
9
|
+
It is generated with [Stainless](https://www.stainless.com/).
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
12
|
|
|
@@ -25,7 +25,7 @@ The full API of this library can be found in [api.md](api.md).
|
|
|
25
25
|
|
|
26
26
|
```python
|
|
27
27
|
import os
|
|
28
|
-
from
|
|
28
|
+
from scale_gp_beta import SGPClient
|
|
29
29
|
|
|
30
30
|
client = SGPClient(
|
|
31
31
|
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
|
|
@@ -53,7 +53,7 @@ Simply import `AsyncSGPClient` instead of `SGPClient` and use `await` with each
|
|
|
53
53
|
```python
|
|
54
54
|
import os
|
|
55
55
|
import asyncio
|
|
56
|
-
from
|
|
56
|
+
from scale_gp_beta import AsyncSGPClient
|
|
57
57
|
|
|
58
58
|
client = AsyncSGPClient(
|
|
59
59
|
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
|
|
@@ -81,7 +81,7 @@ Functionality between the synchronous and asynchronous clients is otherwise iden
|
|
|
81
81
|
We provide support for streaming responses using Server Side Events (SSE).
|
|
82
82
|
|
|
83
83
|
```python
|
|
84
|
-
from
|
|
84
|
+
from scale_gp_beta import SGPClient
|
|
85
85
|
|
|
86
86
|
client = SGPClient(
|
|
87
87
|
account_id="My Account ID",
|
|
@@ -99,7 +99,7 @@ for completion in stream:
|
|
|
99
99
|
The async client uses the exact same interface.
|
|
100
100
|
|
|
101
101
|
```python
|
|
102
|
-
from
|
|
102
|
+
from scale_gp_beta import AsyncSGPClient
|
|
103
103
|
|
|
104
104
|
client = AsyncSGPClient(
|
|
105
105
|
account_id="My Account ID",
|
|
@@ -123,18 +123,133 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
|
|
|
123
123
|
|
|
124
124
|
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
|
125
125
|
|
|
126
|
+
## Pagination
|
|
127
|
+
|
|
128
|
+
List methods in the Scale GP API are paginated.
|
|
129
|
+
|
|
130
|
+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from scale_gp_beta import SGPClient
|
|
134
|
+
|
|
135
|
+
client = SGPClient(
|
|
136
|
+
account_id="My Account ID",
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
all_models = []
|
|
140
|
+
# Automatically fetches more pages as needed.
|
|
141
|
+
for model in client.models.list(
|
|
142
|
+
limit=10,
|
|
143
|
+
):
|
|
144
|
+
# Do something with model here
|
|
145
|
+
all_models.append(model)
|
|
146
|
+
print(all_models)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Or, asynchronously:
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
import asyncio
|
|
153
|
+
from scale_gp_beta import AsyncSGPClient
|
|
154
|
+
|
|
155
|
+
client = AsyncSGPClient(
|
|
156
|
+
account_id="My Account ID",
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
async def main() -> None:
|
|
161
|
+
all_models = []
|
|
162
|
+
# Iterate through items across all pages, issuing requests as needed.
|
|
163
|
+
async for model in client.models.list(
|
|
164
|
+
limit=10,
|
|
165
|
+
):
|
|
166
|
+
all_models.append(model)
|
|
167
|
+
print(all_models)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
asyncio.run(main())
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
first_page = await client.models.list(
|
|
177
|
+
limit=10,
|
|
178
|
+
)
|
|
179
|
+
if first_page.has_next_page():
|
|
180
|
+
print(f"will fetch next page using these details: {first_page.next_page_info()}")
|
|
181
|
+
next_page = await first_page.get_next_page()
|
|
182
|
+
print(f"number of items we just fetched: {len(next_page.items)}")
|
|
183
|
+
|
|
184
|
+
# Remove `await` for non-async usage.
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Or just work directly with the returned data:
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
first_page = await client.models.list(
|
|
191
|
+
limit=10,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
print(f"next page cursor: {first_page.starting_after}") # => "next page cursor: ..."
|
|
195
|
+
for model in first_page.items:
|
|
196
|
+
print(model.id)
|
|
197
|
+
|
|
198
|
+
# Remove `await` for non-async usage.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Nested params
|
|
202
|
+
|
|
203
|
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
from scale_gp_beta import SGPClient
|
|
207
|
+
|
|
208
|
+
client = SGPClient(
|
|
209
|
+
account_id="My Account ID",
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
inference = client.inference.create(
|
|
213
|
+
model="model",
|
|
214
|
+
inference_configuration={
|
|
215
|
+
"num_retries": 0,
|
|
216
|
+
"timeout_seconds": 0,
|
|
217
|
+
},
|
|
218
|
+
)
|
|
219
|
+
print(inference.inference_configuration)
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## File uploads
|
|
223
|
+
|
|
224
|
+
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
from pathlib import Path
|
|
228
|
+
from scale_gp_beta import SGPClient
|
|
229
|
+
|
|
230
|
+
client = SGPClient(
|
|
231
|
+
account_id="My Account ID",
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
client.files.create(
|
|
235
|
+
file=Path("/path/to/file"),
|
|
236
|
+
)
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
|
|
240
|
+
|
|
126
241
|
## Handling errors
|
|
127
242
|
|
|
128
|
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `
|
|
243
|
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `scale_gp_beta.APIConnectionError` is raised.
|
|
129
244
|
|
|
130
245
|
When the API returns a non-success status code (that is, 4xx or 5xx
|
|
131
|
-
response), a subclass of `
|
|
246
|
+
response), a subclass of `scale_gp_beta.APIStatusError` is raised, containing `status_code` and `response` properties.
|
|
132
247
|
|
|
133
|
-
All errors inherit from `
|
|
248
|
+
All errors inherit from `scale_gp_beta.APIError`.
|
|
134
249
|
|
|
135
250
|
```python
|
|
136
|
-
import
|
|
137
|
-
from
|
|
251
|
+
import scale_gp_beta
|
|
252
|
+
from scale_gp_beta import SGPClient
|
|
138
253
|
|
|
139
254
|
client = SGPClient(
|
|
140
255
|
account_id="My Account ID",
|
|
@@ -145,12 +260,12 @@ try:
|
|
|
145
260
|
messages=[{"foo": "bar"}],
|
|
146
261
|
model="model",
|
|
147
262
|
)
|
|
148
|
-
except
|
|
263
|
+
except scale_gp_beta.APIConnectionError as e:
|
|
149
264
|
print("The server could not be reached")
|
|
150
265
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
151
|
-
except
|
|
266
|
+
except scale_gp_beta.RateLimitError as e:
|
|
152
267
|
print("A 429 status code was received; we should back off a bit.")
|
|
153
|
-
except
|
|
268
|
+
except scale_gp_beta.APIStatusError as e:
|
|
154
269
|
print("Another non-200-range status code was received")
|
|
155
270
|
print(e.status_code)
|
|
156
271
|
print(e.response)
|
|
@@ -178,7 +293,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
|
|
|
178
293
|
You can use the `max_retries` option to configure or disable retry settings:
|
|
179
294
|
|
|
180
295
|
```python
|
|
181
|
-
from
|
|
296
|
+
from scale_gp_beta import SGPClient
|
|
182
297
|
|
|
183
298
|
# Configure the default for all requests:
|
|
184
299
|
client = SGPClient(
|
|
@@ -200,7 +315,7 @@ By default requests time out after 1 minute. You can configure this with a `time
|
|
|
200
315
|
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
|
|
201
316
|
|
|
202
317
|
```python
|
|
203
|
-
from
|
|
318
|
+
from scale_gp_beta import SGPClient
|
|
204
319
|
|
|
205
320
|
# Configure the default for all requests:
|
|
206
321
|
client = SGPClient(
|
|
@@ -257,7 +372,7 @@ if response.my_field is None:
|
|
|
257
372
|
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
|
|
258
373
|
|
|
259
374
|
```py
|
|
260
|
-
from
|
|
375
|
+
from scale_gp_beta import SGPClient
|
|
261
376
|
|
|
262
377
|
client = SGPClient(
|
|
263
378
|
account_id="My Account ID",
|
|
@@ -274,9 +389,9 @@ completion = response.parse() # get the object that `chat.completions.create()`
|
|
|
274
389
|
print(completion)
|
|
275
390
|
```
|
|
276
391
|
|
|
277
|
-
These methods return an [`APIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/
|
|
392
|
+
These methods return an [`APIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/scale_gp_beta/_response.py) object.
|
|
278
393
|
|
|
279
|
-
The async client returns an [`AsyncAPIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/
|
|
394
|
+
The async client returns an [`AsyncAPIResponse`](https://github.com/scaleapi/sgp-python-beta/tree/main/src/scale_gp_beta/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
|
|
280
395
|
|
|
281
396
|
#### `.with_streaming_response`
|
|
282
397
|
|
|
@@ -341,7 +456,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
|
|
|
341
456
|
|
|
342
457
|
```python
|
|
343
458
|
import httpx
|
|
344
|
-
from
|
|
459
|
+
from scale_gp_beta import SGPClient, DefaultHttpxClient
|
|
345
460
|
|
|
346
461
|
client = SGPClient(
|
|
347
462
|
# Or use the `SGP_CLIENT_BASE_URL` env var
|
|
@@ -365,7 +480,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
|
|
|
365
480
|
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
|
|
366
481
|
|
|
367
482
|
```py
|
|
368
|
-
from
|
|
483
|
+
from scale_gp_beta import SGPClient
|
|
369
484
|
|
|
370
485
|
with SGPClient(
|
|
371
486
|
account_id="My Account ID",
|
|
@@ -395,8 +510,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
|
|
|
395
510
|
You can determine the version that is being used at runtime with:
|
|
396
511
|
|
|
397
512
|
```py
|
|
398
|
-
import
|
|
399
|
-
print(
|
|
513
|
+
import scale_gp_beta
|
|
514
|
+
print(scale_gp_beta.__version__)
|
|
400
515
|
```
|
|
401
516
|
|
|
402
517
|
## Requirements
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Reporting Security Issues
|
|
4
4
|
|
|
5
|
-
This SDK is generated by [Stainless Software Inc](http://
|
|
5
|
+
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
|
|
6
6
|
|
|
7
|
-
To report a security issue, please contact the Stainless team at security@
|
|
7
|
+
To report a security issue, please contact the Stainless team at security@stainless.com.
|
|
8
8
|
|
|
9
9
|
## Responsible Disclosure
|
|
10
10
|
|
|
@@ -16,9 +16,9 @@ before making any information public.
|
|
|
16
16
|
## Reporting Non-SDK Related Security Issues
|
|
17
17
|
|
|
18
18
|
If you encounter security issues that are not directly related to SDKs but pertain to the services
|
|
19
|
-
or products provided by
|
|
19
|
+
or products provided by Scale GP please follow the respective company's security reporting guidelines.
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### Scale GP Terms and Policies
|
|
22
22
|
|
|
23
23
|
Please contact anish.agrawal@scale.com for any questions or concerns regarding security of our services.
|
|
24
24
|
|