You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more information about the API: [orq.ai Documentation](https://docs.orq.ai)
18
18
<!-- End Summary [summary] -->
@@ -32,6 +32,7 @@ For more information about the API: [orq.ai Documentation](https://docs.orq.ai)
32
32
*[Error Handling](#error-handling)
33
33
*[Server Selection](#server-selection)
34
34
*[Custom HTTP Client](#custom-http-client)
35
+
*[Resource Management](#resource-management)
35
36
*[Debugging](#debugging)
36
37
*[Development](#development)
37
38
*[Maturity](#maturity)
@@ -42,6 +43,11 @@ For more information about the API: [orq.ai Documentation](https://docs.orq.ai)
42
43
<!-- Start SDK Installation [installation] -->
43
44
## SDK Installation
44
45
46
+
> [!NOTE]
47
+
> **Python version upgrade policy**
48
+
>
49
+
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
50
+
45
51
The SDK can be installed with either *pip* or *poetry* package managers.
46
52
47
53
### PIP
@@ -59,6 +65,37 @@ pip install orq-ai-sdk
59
65
```bash
60
66
poetry add orq-ai-sdk
61
67
```
68
+
69
+
### Shell and script usage with `uv`
70
+
71
+
You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
72
+
73
+
```shell
74
+
uvx --from orq-ai-sdk python
75
+
```
76
+
77
+
It's also possible to write a standalone Python script without needing to set up a whole project like so:
78
+
79
+
```python
80
+
#!/usr/bin/env -S uv run --script
81
+
# /// script
82
+
# requires-python = ">=3.9"
83
+
# dependencies = [
84
+
# "orq-ai-sdk",
85
+
# ]
86
+
# ///
87
+
88
+
from orq_ai_sdk import Orq
89
+
90
+
sdk = Orq(
91
+
# SDK arguments
92
+
)
93
+
94
+
# Rest of script here...
95
+
```
96
+
97
+
Once that is saved to a file, you can run it with `uv run script.py` where
98
+
`script.py` can be replaced with the actual file name.
@@ -334,7 +368,7 @@ By default, an API error will raise a models.APIError exception, which has the f
334
368
|`.raw_response`|*httpx.Response*| The raw HTTP response |
335
369
|`.body`|*str*| The response content |
336
370
337
-
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `all_async` method may raise the following exceptions:
371
+
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions:
The `Orq` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
|`use_cases`| List[[models.CreatePromptUseCases](../models/createpromptusecases.md)]|:heavy_minus_sign:| A list of use cases that the prompt is meant to be used for. Use this field to categorize the prompt for your own purpose|
9
+
|`language`|[Optional[models.CreatePromptLanguage]](../models/createpromptlanguage.md)|:heavy_minus_sign:| The language that the prompt is written in. Use this field to categorize the prompt for your own purpose |
0 commit comments