scale-gp-beta 0.1.0a3__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.0a3 → scale_gp_beta-0.1.0a4}/CHANGELOG.md +30 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/PKG-INFO +24 -4
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/README.md +21 -0
- scale_gp_beta-0.1.0a4/bin/publish-pypi +6 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/pyproject.toml +2 -4
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/requirements-dev.lock +1 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/requirements.lock +1 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_base_client.py +1 -96
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_models.py +5 -2
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_version.py +1 -1
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/chat/completions.py +86 -92
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/models.py +2 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_model.py +16 -2
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/model_list_params.py +1 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_models.py +32 -0
- scale_gp_beta-0.1.0a3/.release-please-manifest.json +0 -3
- scale_gp_beta-0.1.0a3/bin/publish-pypi +0 -9
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/.gitignore +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/CONTRIBUTING.md +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/LICENSE +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/SECURITY.md +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/api.md +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/bin/check-release-environment +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/examples/.keep +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/mypy.ini +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/noxfile.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/release-please-config.json +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp/lib/.keep +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_client.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_compat.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_constants.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_exceptions.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_files.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_qs.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_resource.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_streaming.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_types.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_logs.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_proxy.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_reflection.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_streams.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_sync.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_transform.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_typing.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/_utils/_utils.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/lib/.keep +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/pagination.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/py.typed +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/chat/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/chat/chat.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/completions.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/files/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/files/content.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/files/files.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/inference.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/question_sets.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/questions.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/chat/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/chat/chat_completion.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/chat/chat_completion_chunk.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/chat/completion_create_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/chat/completion_create_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/completion.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/completion_create_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_create_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_delete_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_list.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_list_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_update_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/files/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_create_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_create_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_model_list.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_response_chunk.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/model_create_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/model_delete_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/model_update_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_create_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_list.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_list_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_create_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_delete_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_list.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_list_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_retrieve_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_update_params.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/sgp_dev/lib/.keep +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/chat/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/chat/test_completions.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/files/__init__.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/files/test_content.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_completions.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_files.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_inference.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_models.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_question_sets.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/test_questions.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/conftest.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/sample_file.txt +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_client.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_deepcopy.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_extract_files.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_files.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_qs.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_required_args.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_response.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_streaming.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_transform.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_utils/test_proxy.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/test_utils/test_typing.py +0 -0
- {scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/utils.py +0 -0
|
@@ -1,5 +1,35 @@
|
|
|
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
|
+
|
|
3
33
|
## 0.1.0-alpha.3 (2025-02-27)
|
|
4
34
|
|
|
5
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)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: scale-gp-beta
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a4
|
|
4
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
7
|
Author-email: Scale GP <anish.agrawal@scale.com>
|
|
8
|
-
License
|
|
9
|
-
License-File: LICENSE
|
|
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
|
|
@@ -230,6 +229,27 @@ for model in first_page.items:
|
|
|
230
229
|
# Remove `await` for non-async usage.
|
|
231
230
|
```
|
|
232
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
|
+
|
|
233
253
|
## File uploads
|
|
234
254
|
|
|
235
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)`.
|
|
@@ -198,6 +198,27 @@ for model in first_page.items:
|
|
|
198
198
|
# Remove `await` for non-async usage.
|
|
199
199
|
```
|
|
200
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
|
+
|
|
201
222
|
## File uploads
|
|
202
223
|
|
|
203
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)`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "scale-gp-beta"
|
|
3
|
-
version = "0.1.0-alpha.
|
|
3
|
+
version = "0.1.0-alpha.4"
|
|
4
4
|
description = "The official Python library for the Scale GP API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -38,7 +38,6 @@ Homepage = "https://github.com/scaleapi/sgp-python-beta"
|
|
|
38
38
|
Repository = "https://github.com/scaleapi/sgp-python-beta"
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
42
41
|
[tool.rye]
|
|
43
42
|
managed = true
|
|
44
43
|
# version pins are in requirements-dev.lock
|
|
@@ -87,7 +86,7 @@ typecheck = { chain = [
|
|
|
87
86
|
"typecheck:mypy" = "mypy ."
|
|
88
87
|
|
|
89
88
|
[build-system]
|
|
90
|
-
requires = ["hatchling", "hatch-fancy-pypi-readme"]
|
|
89
|
+
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
|
|
91
90
|
build-backend = "hatchling.build"
|
|
92
91
|
|
|
93
92
|
[tool.hatch.build]
|
|
@@ -152,7 +151,6 @@ reportImplicitOverride = true
|
|
|
152
151
|
reportImportCycles = false
|
|
153
152
|
reportPrivateUsage = false
|
|
154
153
|
|
|
155
|
-
|
|
156
154
|
[tool.ruff]
|
|
157
155
|
line-length = 120
|
|
158
156
|
output-format = "grouped"
|
|
@@ -9,7 +9,6 @@ import asyncio
|
|
|
9
9
|
import inspect
|
|
10
10
|
import logging
|
|
11
11
|
import platform
|
|
12
|
-
import warnings
|
|
13
12
|
import email.utils
|
|
14
13
|
from types import TracebackType
|
|
15
14
|
from random import random
|
|
@@ -36,7 +35,7 @@ import anyio
|
|
|
36
35
|
import httpx
|
|
37
36
|
import distro
|
|
38
37
|
import pydantic
|
|
39
|
-
from httpx import URL
|
|
38
|
+
from httpx import URL
|
|
40
39
|
from pydantic import PrivateAttr
|
|
41
40
|
|
|
42
41
|
from . import _exceptions
|
|
@@ -51,13 +50,10 @@ from ._types import (
|
|
|
51
50
|
Timeout,
|
|
52
51
|
NotGiven,
|
|
53
52
|
ResponseT,
|
|
54
|
-
Transport,
|
|
55
53
|
AnyMapping,
|
|
56
54
|
PostParser,
|
|
57
|
-
ProxiesTypes,
|
|
58
55
|
RequestFiles,
|
|
59
56
|
HttpxSendArgs,
|
|
60
|
-
AsyncTransport,
|
|
61
57
|
RequestOptions,
|
|
62
58
|
HttpxRequestFiles,
|
|
63
59
|
ModelBuilderProtocol,
|
|
@@ -337,9 +333,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
337
333
|
_base_url: URL
|
|
338
334
|
max_retries: int
|
|
339
335
|
timeout: Union[float, Timeout, None]
|
|
340
|
-
_limits: httpx.Limits
|
|
341
|
-
_proxies: ProxiesTypes | None
|
|
342
|
-
_transport: Transport | AsyncTransport | None
|
|
343
336
|
_strict_response_validation: bool
|
|
344
337
|
_idempotency_header: str | None
|
|
345
338
|
_default_stream_cls: type[_DefaultStreamT] | None = None
|
|
@@ -352,9 +345,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
352
345
|
_strict_response_validation: bool,
|
|
353
346
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
354
347
|
timeout: float | Timeout | None = DEFAULT_TIMEOUT,
|
|
355
|
-
limits: httpx.Limits,
|
|
356
|
-
transport: Transport | AsyncTransport | None,
|
|
357
|
-
proxies: ProxiesTypes | None,
|
|
358
348
|
custom_headers: Mapping[str, str] | None = None,
|
|
359
349
|
custom_query: Mapping[str, object] | None = None,
|
|
360
350
|
) -> None:
|
|
@@ -362,9 +352,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
362
352
|
self._base_url = self._enforce_trailing_slash(URL(base_url))
|
|
363
353
|
self.max_retries = max_retries
|
|
364
354
|
self.timeout = timeout
|
|
365
|
-
self._limits = limits
|
|
366
|
-
self._proxies = proxies
|
|
367
|
-
self._transport = transport
|
|
368
355
|
self._custom_headers = custom_headers or {}
|
|
369
356
|
self._custom_query = custom_query or {}
|
|
370
357
|
self._strict_response_validation = _strict_response_validation
|
|
@@ -800,46 +787,11 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
800
787
|
base_url: str | URL,
|
|
801
788
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
802
789
|
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
|
803
|
-
transport: Transport | None = None,
|
|
804
|
-
proxies: ProxiesTypes | None = None,
|
|
805
|
-
limits: Limits | None = None,
|
|
806
790
|
http_client: httpx.Client | None = None,
|
|
807
791
|
custom_headers: Mapping[str, str] | None = None,
|
|
808
792
|
custom_query: Mapping[str, object] | None = None,
|
|
809
793
|
_strict_response_validation: bool,
|
|
810
794
|
) -> None:
|
|
811
|
-
kwargs: dict[str, Any] = {}
|
|
812
|
-
if limits is not None:
|
|
813
|
-
warnings.warn(
|
|
814
|
-
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
|
|
815
|
-
category=DeprecationWarning,
|
|
816
|
-
stacklevel=3,
|
|
817
|
-
)
|
|
818
|
-
if http_client is not None:
|
|
819
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
|
|
820
|
-
else:
|
|
821
|
-
limits = DEFAULT_CONNECTION_LIMITS
|
|
822
|
-
|
|
823
|
-
if transport is not None:
|
|
824
|
-
kwargs["transport"] = transport
|
|
825
|
-
warnings.warn(
|
|
826
|
-
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
|
|
827
|
-
category=DeprecationWarning,
|
|
828
|
-
stacklevel=3,
|
|
829
|
-
)
|
|
830
|
-
if http_client is not None:
|
|
831
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
|
|
832
|
-
|
|
833
|
-
if proxies is not None:
|
|
834
|
-
kwargs["proxies"] = proxies
|
|
835
|
-
warnings.warn(
|
|
836
|
-
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
|
|
837
|
-
category=DeprecationWarning,
|
|
838
|
-
stacklevel=3,
|
|
839
|
-
)
|
|
840
|
-
if http_client is not None:
|
|
841
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
|
|
842
|
-
|
|
843
795
|
if not is_given(timeout):
|
|
844
796
|
# if the user passed in a custom http client with a non-default
|
|
845
797
|
# timeout set then we use that timeout.
|
|
@@ -860,12 +812,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
860
812
|
|
|
861
813
|
super().__init__(
|
|
862
814
|
version=version,
|
|
863
|
-
limits=limits,
|
|
864
815
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
865
816
|
timeout=cast(Timeout, timeout),
|
|
866
|
-
proxies=proxies,
|
|
867
817
|
base_url=base_url,
|
|
868
|
-
transport=transport,
|
|
869
818
|
max_retries=max_retries,
|
|
870
819
|
custom_query=custom_query,
|
|
871
820
|
custom_headers=custom_headers,
|
|
@@ -875,9 +824,6 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
875
824
|
base_url=base_url,
|
|
876
825
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
877
826
|
timeout=cast(Timeout, timeout),
|
|
878
|
-
limits=limits,
|
|
879
|
-
follow_redirects=True,
|
|
880
|
-
**kwargs, # type: ignore
|
|
881
827
|
)
|
|
882
828
|
|
|
883
829
|
def is_closed(self) -> bool:
|
|
@@ -1372,45 +1318,10 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1372
1318
|
_strict_response_validation: bool,
|
|
1373
1319
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
1374
1320
|
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
|
1375
|
-
transport: AsyncTransport | None = None,
|
|
1376
|
-
proxies: ProxiesTypes | None = None,
|
|
1377
|
-
limits: Limits | None = None,
|
|
1378
1321
|
http_client: httpx.AsyncClient | None = None,
|
|
1379
1322
|
custom_headers: Mapping[str, str] | None = None,
|
|
1380
1323
|
custom_query: Mapping[str, object] | None = None,
|
|
1381
1324
|
) -> None:
|
|
1382
|
-
kwargs: dict[str, Any] = {}
|
|
1383
|
-
if limits is not None:
|
|
1384
|
-
warnings.warn(
|
|
1385
|
-
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1386
|
-
category=DeprecationWarning,
|
|
1387
|
-
stacklevel=3,
|
|
1388
|
-
)
|
|
1389
|
-
if http_client is not None:
|
|
1390
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
|
|
1391
|
-
else:
|
|
1392
|
-
limits = DEFAULT_CONNECTION_LIMITS
|
|
1393
|
-
|
|
1394
|
-
if transport is not None:
|
|
1395
|
-
kwargs["transport"] = transport
|
|
1396
|
-
warnings.warn(
|
|
1397
|
-
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1398
|
-
category=DeprecationWarning,
|
|
1399
|
-
stacklevel=3,
|
|
1400
|
-
)
|
|
1401
|
-
if http_client is not None:
|
|
1402
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
|
|
1403
|
-
|
|
1404
|
-
if proxies is not None:
|
|
1405
|
-
kwargs["proxies"] = proxies
|
|
1406
|
-
warnings.warn(
|
|
1407
|
-
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1408
|
-
category=DeprecationWarning,
|
|
1409
|
-
stacklevel=3,
|
|
1410
|
-
)
|
|
1411
|
-
if http_client is not None:
|
|
1412
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
|
|
1413
|
-
|
|
1414
1325
|
if not is_given(timeout):
|
|
1415
1326
|
# if the user passed in a custom http client with a non-default
|
|
1416
1327
|
# timeout set then we use that timeout.
|
|
@@ -1432,11 +1343,8 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1432
1343
|
super().__init__(
|
|
1433
1344
|
version=version,
|
|
1434
1345
|
base_url=base_url,
|
|
1435
|
-
limits=limits,
|
|
1436
1346
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
1437
1347
|
timeout=cast(Timeout, timeout),
|
|
1438
|
-
proxies=proxies,
|
|
1439
|
-
transport=transport,
|
|
1440
1348
|
max_retries=max_retries,
|
|
1441
1349
|
custom_query=custom_query,
|
|
1442
1350
|
custom_headers=custom_headers,
|
|
@@ -1446,9 +1354,6 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1446
1354
|
base_url=base_url,
|
|
1447
1355
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
1448
1356
|
timeout=cast(Timeout, timeout),
|
|
1449
|
-
limits=limits,
|
|
1450
|
-
follow_redirects=True,
|
|
1451
|
-
**kwargs, # type: ignore
|
|
1452
1357
|
)
|
|
1453
1358
|
|
|
1454
1359
|
def is_closed(self) -> bool:
|
|
@@ -65,7 +65,7 @@ from ._compat import (
|
|
|
65
65
|
from ._constants import RAW_RESPONSE_HEADER
|
|
66
66
|
|
|
67
67
|
if TYPE_CHECKING:
|
|
68
|
-
from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema
|
|
68
|
+
from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
|
|
69
69
|
|
|
70
70
|
__all__ = ["BaseModel", "GenericModel"]
|
|
71
71
|
|
|
@@ -646,15 +646,18 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|
|
646
646
|
|
|
647
647
|
def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None:
|
|
648
648
|
schema = model.__pydantic_core_schema__
|
|
649
|
+
if schema["type"] == "definitions":
|
|
650
|
+
schema = schema["schema"]
|
|
651
|
+
|
|
649
652
|
if schema["type"] != "model":
|
|
650
653
|
return None
|
|
651
654
|
|
|
655
|
+
schema = cast("ModelSchema", schema)
|
|
652
656
|
fields_schema = schema["schema"]
|
|
653
657
|
if fields_schema["type"] != "model-fields":
|
|
654
658
|
return None
|
|
655
659
|
|
|
656
660
|
fields_schema = cast("ModelFieldsSchema", fields_schema)
|
|
657
|
-
|
|
658
661
|
field = fields_schema["fields"].get(field_name)
|
|
659
662
|
if not field:
|
|
660
663
|
return None
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/chat/completions.py
RENAMED
|
@@ -474,53 +474,50 @@ class CompletionsResource(SyncAPIResource):
|
|
|
474
474
|
extra_body: Body | None = None,
|
|
475
475
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
476
476
|
) -> CompletionCreateResponse | Stream[ChatCompletionChunk]:
|
|
477
|
-
return
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
},
|
|
513
|
-
completion_create_params.CompletionCreateParams,
|
|
514
|
-
),
|
|
515
|
-
options=make_request_options(
|
|
516
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
517
|
-
),
|
|
518
|
-
cast_to=cast(
|
|
519
|
-
Any, CompletionCreateResponse
|
|
520
|
-
), # Union types cannot be passed in as arguments in the type system
|
|
521
|
-
stream=stream or False,
|
|
522
|
-
stream_cls=Stream[ChatCompletionChunk],
|
|
477
|
+
return self._post(
|
|
478
|
+
"/v5/chat/completions",
|
|
479
|
+
body=maybe_transform(
|
|
480
|
+
{
|
|
481
|
+
"messages": messages,
|
|
482
|
+
"model": model,
|
|
483
|
+
"audio": audio,
|
|
484
|
+
"frequency_penalty": frequency_penalty,
|
|
485
|
+
"function_call": function_call,
|
|
486
|
+
"functions": functions,
|
|
487
|
+
"logit_bias": logit_bias,
|
|
488
|
+
"logprobs": logprobs,
|
|
489
|
+
"max_completion_tokens": max_completion_tokens,
|
|
490
|
+
"max_tokens": max_tokens,
|
|
491
|
+
"metadata": metadata,
|
|
492
|
+
"modalities": modalities,
|
|
493
|
+
"n": n,
|
|
494
|
+
"parallel_tool_calls": parallel_tool_calls,
|
|
495
|
+
"prediction": prediction,
|
|
496
|
+
"presence_penalty": presence_penalty,
|
|
497
|
+
"reasoning_effort": reasoning_effort,
|
|
498
|
+
"response_format": response_format,
|
|
499
|
+
"seed": seed,
|
|
500
|
+
"stop": stop,
|
|
501
|
+
"store": store,
|
|
502
|
+
"stream": stream,
|
|
503
|
+
"stream_options": stream_options,
|
|
504
|
+
"temperature": temperature,
|
|
505
|
+
"tool_choice": tool_choice,
|
|
506
|
+
"tools": tools,
|
|
507
|
+
"top_k": top_k,
|
|
508
|
+
"top_logprobs": top_logprobs,
|
|
509
|
+
"top_p": top_p,
|
|
510
|
+
},
|
|
511
|
+
completion_create_params.CompletionCreateParams,
|
|
523
512
|
),
|
|
513
|
+
options=make_request_options(
|
|
514
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
515
|
+
),
|
|
516
|
+
cast_to=cast(
|
|
517
|
+
Any, CompletionCreateResponse
|
|
518
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
519
|
+
stream=stream or False,
|
|
520
|
+
stream_cls=Stream[ChatCompletionChunk],
|
|
524
521
|
)
|
|
525
522
|
|
|
526
523
|
|
|
@@ -968,53 +965,50 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
968
965
|
extra_body: Body | None = None,
|
|
969
966
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
970
967
|
) -> CompletionCreateResponse | AsyncStream[ChatCompletionChunk]:
|
|
971
|
-
return
|
|
972
|
-
|
|
973
|
-
await
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
options=make_request_options(
|
|
1010
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1011
|
-
),
|
|
1012
|
-
cast_to=cast(
|
|
1013
|
-
Any, CompletionCreateResponse
|
|
1014
|
-
), # Union types cannot be passed in as arguments in the type system
|
|
1015
|
-
stream=stream or False,
|
|
1016
|
-
stream_cls=AsyncStream[ChatCompletionChunk],
|
|
968
|
+
return await self._post(
|
|
969
|
+
"/v5/chat/completions",
|
|
970
|
+
body=await async_maybe_transform(
|
|
971
|
+
{
|
|
972
|
+
"messages": messages,
|
|
973
|
+
"model": model,
|
|
974
|
+
"audio": audio,
|
|
975
|
+
"frequency_penalty": frequency_penalty,
|
|
976
|
+
"function_call": function_call,
|
|
977
|
+
"functions": functions,
|
|
978
|
+
"logit_bias": logit_bias,
|
|
979
|
+
"logprobs": logprobs,
|
|
980
|
+
"max_completion_tokens": max_completion_tokens,
|
|
981
|
+
"max_tokens": max_tokens,
|
|
982
|
+
"metadata": metadata,
|
|
983
|
+
"modalities": modalities,
|
|
984
|
+
"n": n,
|
|
985
|
+
"parallel_tool_calls": parallel_tool_calls,
|
|
986
|
+
"prediction": prediction,
|
|
987
|
+
"presence_penalty": presence_penalty,
|
|
988
|
+
"reasoning_effort": reasoning_effort,
|
|
989
|
+
"response_format": response_format,
|
|
990
|
+
"seed": seed,
|
|
991
|
+
"stop": stop,
|
|
992
|
+
"store": store,
|
|
993
|
+
"stream": stream,
|
|
994
|
+
"stream_options": stream_options,
|
|
995
|
+
"temperature": temperature,
|
|
996
|
+
"tool_choice": tool_choice,
|
|
997
|
+
"tools": tools,
|
|
998
|
+
"top_k": top_k,
|
|
999
|
+
"top_logprobs": top_logprobs,
|
|
1000
|
+
"top_p": top_p,
|
|
1001
|
+
},
|
|
1002
|
+
completion_create_params.CompletionCreateParams,
|
|
1003
|
+
),
|
|
1004
|
+
options=make_request_options(
|
|
1005
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1017
1006
|
),
|
|
1007
|
+
cast_to=cast(
|
|
1008
|
+
Any, CompletionCreateResponse
|
|
1009
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
1010
|
+
stream=stream or False,
|
|
1011
|
+
stream_cls=AsyncStream[ChatCompletionChunk],
|
|
1018
1012
|
)
|
|
1019
1013
|
|
|
1020
1014
|
|
|
@@ -321,6 +321,7 @@ class ModelsResource(SyncAPIResource):
|
|
|
321
321
|
"llmengine",
|
|
322
322
|
"model_zoo",
|
|
323
323
|
"bedrock",
|
|
324
|
+
"xai",
|
|
324
325
|
]
|
|
325
326
|
]
|
|
326
327
|
| NotGiven = NOT_GIVEN,
|
|
@@ -692,6 +693,7 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
|
692
693
|
"llmengine",
|
|
693
694
|
"model_zoo",
|
|
694
695
|
"bedrock",
|
|
696
|
+
"xai",
|
|
695
697
|
]
|
|
696
698
|
]
|
|
697
699
|
| NotGiven = NOT_GIVEN,
|
|
@@ -153,15 +153,29 @@ class InferenceModel(BaseModel):
|
|
|
153
153
|
api_model_type: Literal["generic", "completion", "chat_completion"] = FieldInfo(alias="model_type")
|
|
154
154
|
|
|
155
155
|
api_model_vendor: Literal[
|
|
156
|
-
"openai",
|
|
156
|
+
"openai",
|
|
157
|
+
"cohere",
|
|
158
|
+
"vertex_ai",
|
|
159
|
+
"anthropic",
|
|
160
|
+
"azure",
|
|
161
|
+
"gemini",
|
|
162
|
+
"launch",
|
|
163
|
+
"llmengine",
|
|
164
|
+
"model_zoo",
|
|
165
|
+
"bedrock",
|
|
166
|
+
"xai",
|
|
157
167
|
] = FieldInfo(alias="model_vendor")
|
|
158
168
|
|
|
159
169
|
name: str
|
|
160
170
|
|
|
161
171
|
status: Literal["failed", "ready", "deploying"]
|
|
162
172
|
|
|
163
|
-
|
|
173
|
+
description: Optional[str] = None
|
|
174
|
+
|
|
175
|
+
display_name: Optional[str] = None
|
|
164
176
|
|
|
165
177
|
api_model_metadata: Optional[Dict[str, object]] = FieldInfo(alias="model_metadata", default=None)
|
|
166
178
|
|
|
167
179
|
object: Optional[Literal["model"]] = None
|
|
180
|
+
|
|
181
|
+
vendor_configuration: Optional[VendorConfiguration] = None
|
|
@@ -854,3 +854,35 @@ def test_field_named_cls() -> None:
|
|
|
854
854
|
m = construct_type(value={"cls": "foo"}, type_=Model)
|
|
855
855
|
assert isinstance(m, Model)
|
|
856
856
|
assert isinstance(m.cls, str)
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
def test_discriminated_union_case() -> None:
|
|
860
|
+
class A(BaseModel):
|
|
861
|
+
type: Literal["a"]
|
|
862
|
+
|
|
863
|
+
data: bool
|
|
864
|
+
|
|
865
|
+
class B(BaseModel):
|
|
866
|
+
type: Literal["b"]
|
|
867
|
+
|
|
868
|
+
data: List[Union[A, object]]
|
|
869
|
+
|
|
870
|
+
class ModelA(BaseModel):
|
|
871
|
+
type: Literal["modelA"]
|
|
872
|
+
|
|
873
|
+
data: int
|
|
874
|
+
|
|
875
|
+
class ModelB(BaseModel):
|
|
876
|
+
type: Literal["modelB"]
|
|
877
|
+
|
|
878
|
+
required: str
|
|
879
|
+
|
|
880
|
+
data: Union[A, B]
|
|
881
|
+
|
|
882
|
+
# when constructing ModelA | ModelB, value data doesn't match ModelB exactly - missing `required`
|
|
883
|
+
m = construct_type(
|
|
884
|
+
value={"type": "modelB", "data": {"type": "a", "data": True}},
|
|
885
|
+
type_=cast(Any, Annotated[Union[ModelA, ModelB], PropertyInfo(discriminator="type")]),
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
assert isinstance(m, ModelB)
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -eux
|
|
4
|
-
mkdir -p dist
|
|
5
|
-
rye build --clean
|
|
6
|
-
# Patching importlib-metadata version until upstream library version is updated
|
|
7
|
-
# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
|
|
8
|
-
"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
|
|
9
|
-
rye publish --yes --token=$PYPI_TOKEN
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/chat/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/files/__init__.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/files/content.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/resources/question_sets.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/chat/chat_completion.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/completion_create_params.py
RENAMED
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_create_params.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_delete_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/file_update_params.py
RENAMED
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_create_params.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_create_response.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_model_list.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_response.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/inference_response_chunk.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/model_create_params.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/model_delete_response.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/model_update_params.py
RENAMED
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_create_params.py
RENAMED
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_list_params.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_list.py
RENAMED
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/src/scale_gp_beta/types/question_set_list_params.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scale_gp_beta-0.1.0a3 → scale_gp_beta-0.1.0a4}/tests/api_resources/chat/test_completions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|