Skip to content

Commit 25598aa

Browse files
committed
feat(core): update sdk documentation
1 parent 2d54e9b commit 25598aa

File tree

5 files changed

+61
-9
lines changed

5 files changed

+61
-9
lines changed

cases.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from orquesta_sdk.helpers import orquesta_openai_parameters_mapper
2+
3+
import os
4+
5+
from orquesta_sdk import OrquestaClient, OrquestaClientOptions
6+
from orquesta_sdk.prompts import OrquestaPromptRequest
7+
from orquesta_sdk.remoteconfigs import OrquestaRemoteConfigRequest
8+
9+
api_key = os.environ.get("ORQUESTA_API_KEY", "__API_KEY__")
10+
11+
options = OrquestaClientOptions(api_key=api_key, ttl=3600, environment="production")
12+
13+
client = OrquestaClient(options)
14+
15+
request = OrquestaPromptRequest(
16+
key="prompt_key",
17+
context={"environments": "production", "workspaceId": "soql1odAABC2"},
18+
variables={"firstname": "John", "city": "New York"},
19+
metadata={"chain_id": "ad1231xsdaABw"},
20+
)
21+
22+
request = OrquestaRemoteConfigRequest(
23+
key="prompt_key",
24+
context={"environments": "production", "workspaceId": "soql1odAABC2"},
25+
metadata={"chain_id": "ad1231xsdaABw"},
26+
)
27+
28+
prompt = client.prompts.query(
29+
request=request,
30+
)
31+
32+
print(prompt.value)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
project = "orquesta_sdk"
1313
copyright = "2023, orquesta"
1414
author = "orquesta"
15-
release = "1.11.2"
15+
release = "1.11.4"
1616

1717
# -- General configuration ---------------------------------------------------
1818
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

orquesta_sdk/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.11.2"
1+
__version__ = "1.11.4"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "orquesta_sdk"
3-
version = "1.11.2"
3+
version = "1.11.4"
44
description = "_LLM Operations and Integration Platform_"
55
authors = ["Orquesta <info@orquesta.dev>"]
66
classifiers = [

readme.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,17 @@ The `query` method receives an object of type `OrquestaPromptRequest` as paramet
156156

157157
from orquesta_sdk.helpers import orquesta_openai_parameters_mapper
158158

159-
prompt = client.prompts.query(
159+
request = OrquestaPromptRequest(
160160
key="prompt_key",
161161
context={"environments": "production", "workspaceId": "soql1odAABC2"},
162162
variables={"firstname": "John", "city": "New York"},
163163
metadata={"chain_id": "ad1231xsdaABw"},
164164
)
165165

166+
prompt = client.prompts.query(
167+
request=request,
168+
)
169+
166170
openai_api_parameters = orquesta_openai_parameters_mapper(prompt.value)
167171
```
168172

@@ -236,45 +240,61 @@ config = client.remoteconfigs.query(
236240

237241
```python
238242

239-
240-
config = client.remoteconfigs.query(
243+
request = OrquestaRemoteConfigRequest(
241244
key="str_config",
242245
default_value="str_value",
243246
context={"environments": "production", "country": "NL"},
244247
metadata={"timestamp": 1623345600}
245248
)
249+
250+
config = client.remoteconfigs.query(
251+
request=request
252+
)
246253
```
247254

248255
#### Example: Querying a configuration of type int
249256

250257
```python
251-
config = client.remoteconfigs.query(
258+
request = OrquestaRemoteConfigRequest(
252259
key="int_config",
253260
default_value=1990,
254261
context={"environments": "production", "market": "US" },
255262
metadata={"domain": "ecommerce"}
256263
)
264+
265+
config = client.remoteconfigs.query(
266+
request=request
267+
)
268+
257269
```
258270

259271
#### Example: Querying a configuration of type array
260272

261273
```python
262-
config = client.remoteconfigs.query(
274+
request = OrquestaRemoteConfigRequest(
263275
key="list_config",
264276
default_value=["USA", "NL"],
265277
context={"environments": "acceptance", "is_enable": True},
266278
metadata={"domain": "ecommerce"}
267279
)
280+
281+
config = client.remoteconfigs.query(
282+
request=request
283+
)
268284
```
269285

270286
#### Example: Querying a configuration of type JSON
271287

272288
```python
273-
config = client.remoteconfigs.query(
289+
request = OrquestaRemoteConfigRequest(
274290
key="json_config",
275291
default_value=dict,
276292
contenxt={"environments": "develop", "platform": "mobile"},
277293
)
294+
295+
config = client.remoteconfigs.query(
296+
request=request
297+
)
278298
```
279299

280300
### Additional metadata logging

0 commit comments

Comments
 (0)