typesafe-sdk 0.0.1a0__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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [year] [fullname]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: typesafe-sdk
|
|
3
|
+
Version: 0.0.1a0
|
|
4
|
+
Summary: Python SDK for TypeSafe AI API.
|
|
5
|
+
Keywords: typesafe,sdk,api,ai
|
|
6
|
+
Author: Daniel Gafni
|
|
7
|
+
Author-email: Daniel Gafni <daniel@typesafe.ai>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Dist: frozendict>=2.4.7
|
|
22
|
+
Requires-Dist: httpx2>=2.12.0
|
|
23
|
+
Requires-Dist: orjson>=3.12.0
|
|
24
|
+
Requires-Dist: tenacity>=9.1.4
|
|
25
|
+
Requires-Dist: typing-extensions>=4.16.0
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Project-URL: Homepage, https://typesafe.ai
|
|
28
|
+
Project-URL: Documentation, https://docs.typesafe.ai/sdk/python/
|
|
29
|
+
Project-URL: Changelog, https://docs.typesafe.ai/sdk/python/changelog/
|
|
30
|
+
Project-URL: Repository, https://github.com/typesafe-ai/typesafe-sdk-python
|
|
31
|
+
Project-URL: Issues, https://github.com/typesafe-ai/typesafe-sdk-python/issues
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# TypeSafe AI Python SDK
|
|
35
|
+
|
|
36
|
+
Python SDK for [TypeSafe AI](https://typesafe.ai).
|
|
37
|
+
|
|
38
|
+
## Quickstart
|
|
39
|
+
|
|
40
|
+
Install the SDK:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
uv add typesafe-sdk
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Set `TYPESAFE_API_KEY` in your environment, then instantiate and use the client:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from typesafe_sdk import Choice, TypesafeClient
|
|
50
|
+
|
|
51
|
+
with TypesafeClient() as client:
|
|
52
|
+
response = client.system_one(
|
|
53
|
+
state={"document": "I was charged twice. Please fix this ASAP."},
|
|
54
|
+
questions={
|
|
55
|
+
"category": Choice(
|
|
56
|
+
instructions="What is this ticket about?",
|
|
57
|
+
criteria={"billing": None, "technical": None, "other": None},
|
|
58
|
+
),
|
|
59
|
+
},
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
print(response.choices["category"].choice)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
learn what TypeSafe is, what it can do, and how to use it in [TypeSafe docs](https://docs.typesafe.ai/).
|
|
66
|
+
|
|
67
|
+
## Documentation
|
|
68
|
+
|
|
69
|
+
Learn more in [SDK docs](https://docs.typesafe.ai/sdk/python/).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# TypeSafe AI Python SDK
|
|
2
|
+
|
|
3
|
+
Python SDK for [TypeSafe AI](https://typesafe.ai).
|
|
4
|
+
|
|
5
|
+
## Quickstart
|
|
6
|
+
|
|
7
|
+
Install the SDK:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
uv add typesafe-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Set `TYPESAFE_API_KEY` in your environment, then instantiate and use the client:
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from typesafe_sdk import Choice, TypesafeClient
|
|
17
|
+
|
|
18
|
+
with TypesafeClient() as client:
|
|
19
|
+
response = client.system_one(
|
|
20
|
+
state={"document": "I was charged twice. Please fix this ASAP."},
|
|
21
|
+
questions={
|
|
22
|
+
"category": Choice(
|
|
23
|
+
instructions="What is this ticket about?",
|
|
24
|
+
criteria={"billing": None, "technical": None, "other": None},
|
|
25
|
+
),
|
|
26
|
+
},
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
print(response.choices["category"].choice)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
learn what TypeSafe is, what it can do, and how to use it in [TypeSafe docs](https://docs.typesafe.ai/).
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
Learn more in [SDK docs](https://docs.typesafe.ai/sdk/python/).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "typesafe-sdk"
|
|
3
|
+
version = "0.0.1a0"
|
|
4
|
+
description = "Python SDK for TypeSafe AI API."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.10"
|
|
9
|
+
keywords = [
|
|
10
|
+
"typesafe",
|
|
11
|
+
"sdk",
|
|
12
|
+
"api",
|
|
13
|
+
"ai",
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
26
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"frozendict>=2.4.7",
|
|
30
|
+
"httpx2>=2.12.0",
|
|
31
|
+
"orjson>=3.12.0",
|
|
32
|
+
"tenacity>=9.1.4",
|
|
33
|
+
"typing-extensions>=4.16.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[[project.authors]]
|
|
37
|
+
name = "Daniel Gafni"
|
|
38
|
+
email = "daniel@typesafe.ai"
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
Homepage = "https://typesafe.ai"
|
|
42
|
+
Documentation = "https://docs.typesafe.ai/sdk/python/"
|
|
43
|
+
Changelog = "https://docs.typesafe.ai/sdk/python/changelog/"
|
|
44
|
+
Repository = "https://github.com/typesafe-ai/typesafe-sdk-python"
|
|
45
|
+
Issues = "https://github.com/typesafe-ai/typesafe-sdk-python/issues"
|
|
46
|
+
|
|
47
|
+
[build-system]
|
|
48
|
+
requires = ["uv_build>=0.12.5,<0.13"]
|
|
49
|
+
build-backend = "uv_build"
|
|
50
|
+
|
|
51
|
+
[dependency-groups]
|
|
52
|
+
dev = [
|
|
53
|
+
"pyrefly>=1.2.0",
|
|
54
|
+
"pytest>=9.1.1",
|
|
55
|
+
"pytest-asyncio>=1.4.0",
|
|
56
|
+
"ruff>=0.16.6",
|
|
57
|
+
"sybil>=9.3.0",
|
|
58
|
+
"syrupy>=6.0.0",
|
|
59
|
+
"tach>=0.35.0",
|
|
60
|
+
]
|
|
61
|
+
docs = [
|
|
62
|
+
"mkdocstrings[python]>=1.0.6",
|
|
63
|
+
"ruff>=0.16.6",
|
|
64
|
+
"zensical>=0.0.59",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[tool.pytest.ini_options]
|
|
68
|
+
addopts = "-vv -ra --capture=tee-sys -p no:tach"
|
|
69
|
+
log_cli = true
|
|
70
|
+
log_cli_level = "DEBUG"
|
|
71
|
+
log_level = "DEBUG"
|
|
72
|
+
asyncio_mode = "auto"
|
|
73
|
+
testpaths = ["tests"]
|
|
74
|
+
markers = ["integration: live API tests requiring TYPESAFE_API_KEY"]
|
|
75
|
+
|
|
76
|
+
[[tool.uv.index]]
|
|
77
|
+
name = "testpypi"
|
|
78
|
+
url = "https://test.pypi.org/simple/"
|
|
79
|
+
publish-url = "https://test.pypi.org/legacy/"
|
|
80
|
+
explicit = true
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "typesafe-sdk"
|
|
3
|
+
version = "0.0.1a0"
|
|
4
|
+
description = "Python SDK for TypeSafe AI API."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Daniel Gafni", email = "daniel@typesafe.ai" }
|
|
10
|
+
]
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
keywords = ["typesafe", "sdk", "api", "ai"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Programming Language :: Python :: 3.14",
|
|
23
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
24
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"frozendict>=2.4.7",
|
|
28
|
+
"httpx2>=2.12.0",
|
|
29
|
+
"orjson>=3.12.0",
|
|
30
|
+
"tenacity>=9.1.4",
|
|
31
|
+
"typing-extensions>=4.16.0",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://typesafe.ai"
|
|
36
|
+
Documentation = "https://docs.typesafe.ai/sdk/python/"
|
|
37
|
+
Changelog = "https://docs.typesafe.ai/sdk/python/changelog/"
|
|
38
|
+
Repository = "https://github.com/typesafe-ai/typesafe-sdk-python"
|
|
39
|
+
Issues = "https://github.com/typesafe-ai/typesafe-sdk-python/issues"
|
|
40
|
+
|
|
41
|
+
[build-system]
|
|
42
|
+
requires = ["uv_build>=0.12.5,<0.13"]
|
|
43
|
+
build-backend = "uv_build"
|
|
44
|
+
|
|
45
|
+
[dependency-groups]
|
|
46
|
+
dev = [
|
|
47
|
+
"pyrefly>=1.2.0",
|
|
48
|
+
"pytest>=9.1.1",
|
|
49
|
+
"pytest-asyncio>=1.4.0",
|
|
50
|
+
"ruff>=0.16.6",
|
|
51
|
+
"sybil>=9.3.0",
|
|
52
|
+
"syrupy>=6.0.0",
|
|
53
|
+
"tach>=0.35.0",
|
|
54
|
+
]
|
|
55
|
+
docs = [
|
|
56
|
+
"mkdocstrings[python]>=1.0.6",
|
|
57
|
+
"ruff>=0.16.6",
|
|
58
|
+
"zensical>=0.0.59",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
addopts = "-vv -ra --capture=tee-sys -p no:tach"
|
|
63
|
+
log_cli = true
|
|
64
|
+
log_cli_level = "DEBUG"
|
|
65
|
+
log_level = "DEBUG"
|
|
66
|
+
asyncio_mode = "auto"
|
|
67
|
+
testpaths = ["tests"]
|
|
68
|
+
markers = ["integration: live API tests requiring TYPESAFE_API_KEY"]
|
|
69
|
+
|
|
70
|
+
[[tool.uv.index]]
|
|
71
|
+
name = "testpypi"
|
|
72
|
+
url = "https://test.pypi.org/simple/"
|
|
73
|
+
publish-url = "https://test.pypi.org/legacy/"
|
|
74
|
+
explicit = true
|
|
File without changes
|