Skip to content

Commit 1d8cb3b

Browse files
committed
Release 0.0.3
1 parent 00e7ba5 commit 1d8cb3b

File tree

11 files changed

+47
-54
lines changed

11 files changed

+47
-54
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ from axiomatic import Axiomatic
2424

2525
client = Axiomatic(
2626
api_key="YOUR_API_KEY",
27-
base_url="https://yourhost.com/path/to/api",
2827
)
2928
client.pic.extract()
3029
```
@@ -40,7 +39,6 @@ from axiomatic import AsyncAxiomatic
4039

4140
client = AsyncAxiomatic(
4241
api_key="YOUR_API_KEY",
43-
base_url="https://yourhost.com/path/to/api",
4442
)
4543

4644

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 = "axiomatic"
3-
version = "0.0.2"
3+
version = "0.0.3"
44
description = ""
55
readme = "README.md"
66
authors = []

reference.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ from axiomatic import Axiomatic
1616

1717
client = Axiomatic(
1818
api_key="YOUR_API_KEY",
19-
base_url="https://yourhost.com/path/to/api",
2019
)
2120
client.health_check_health_check_get()
2221

@@ -78,7 +77,6 @@ from axiomatic import Axiomatic
7877

7978
client = Axiomatic(
8079
api_key="YOUR_API_KEY",
81-
base_url="https://yourhost.com/path/to/api",
8280
)
8381
client.pic.extract()
8482

@@ -149,7 +147,6 @@ from axiomatic import Axiomatic
149147

150148
client = Axiomatic(
151149
api_key="YOUR_API_KEY",
152-
base_url="https://yourhost.com/path/to/api",
153150
)
154151
client.pic.extract_from_text(
155152
query="query",
@@ -220,7 +217,6 @@ from axiomatic import Axiomatic
220217

221218
client = Axiomatic(
222219
api_key="YOUR_API_KEY",
223-
base_url="https://yourhost.com/path/to/api",
224220
)
225221
client.pic.extract_from_paper()
226222

@@ -291,7 +287,6 @@ from axiomatic import Axiomatic, StatementInput
291287

292288
client = Axiomatic(
293289
api_key="YOUR_API_KEY",
294-
base_url="https://yourhost.com/path/to/api",
295290
)
296291
client.pic.identify(
297292
statements=[
@@ -367,7 +362,6 @@ from axiomatic import Axiomatic
367362

368363
client = Axiomatic(
369364
api_key="YOUR_API_KEY",
370-
base_url="https://yourhost.com/path/to/api",
371365
)
372366
client.pic.identify_with_context(
373367
statements="statements",
@@ -446,7 +440,6 @@ from axiomatic import Axiomatic
446440

447441
client = Axiomatic(
448442
api_key="YOUR_API_KEY",
449-
base_url="https://yourhost.com/path/to/api",
450443
)
451444
client.pic.synthesize_circuit_from_paper()
452445

@@ -517,7 +510,6 @@ from axiomatic import Axiomatic
517510

518511
client = Axiomatic(
519512
api_key="YOUR_API_KEY",
520-
base_url="https://yourhost.com/path/to/api",
521513
)
522514
client.pic.synthesize_circuit_from_text(
523515
query="query",
@@ -575,7 +567,6 @@ from axiomatic import Axiomatic
575567

576568
client = Axiomatic(
577569
api_key="YOUR_API_KEY",
578-
base_url="https://yourhost.com/path/to/api",
579570
)
580571
client.lean.lean_execute()
581572

@@ -646,7 +637,6 @@ from axiomatic import Axiomatic
646637

647638
client = Axiomatic(
648639
api_key="YOUR_API_KEY",
649-
base_url="https://yourhost.com/path/to/api",
650640
)
651641
client.lean.suggest(
652642
prompt="prompt",
@@ -712,7 +702,6 @@ from axiomatic import Axiomatic
712702

713703
client = Axiomatic(
714704
api_key="YOUR_API_KEY",
715-
base_url="https://yourhost.com/path/to/api",
716705
)
717706
client.lean.z_3_execute(
718707
code="code",
@@ -784,7 +773,6 @@ from axiomatic import Axiomatic
784773

785774
client = Axiomatic(
786775
api_key="YOUR_API_KEY",
787-
base_url="https://yourhost.com/path/to/api",
788776
)
789777
client.experimental.assistant(
790778
query="query",
@@ -864,7 +852,6 @@ from axiomatic import Axiomatic
864852

865853
client = Axiomatic(
866854
api_key="YOUR_API_KEY",
867-
base_url="https://yourhost.com/path/to/api",
868855
)
869856
client.experimental.synthesize(
870857
query="query",
@@ -922,7 +909,6 @@ from axiomatic import Axiomatic
922909

923910
client = Axiomatic(
924911
api_key="YOUR_API_KEY",
925-
base_url="https://yourhost.com/path/to/api",
926912
)
927913
client.generic.extract(
928914
query="query",

src/axiomatic/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
from .errors import UnprocessableEntityError
2121
from . import experimental, generic, lean, pic
2222
from .client import AsyncAxiomatic, Axiomatic
23+
from .environment import AxiomaticEnvironment
2324
from .version import __version__
2425

2526
__all__ = [
2627
"AsyncAxiomatic",
2728
"Axiomatic",
29+
"AxiomaticEnvironment",
2830
"CircuitImage",
2931
"CodeSynthesisResponse",
3032
"Edge",

src/axiomatic/client.py

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file was auto-generated by Fern from our API Definition.
22

33
import typing
4+
from .environment import AxiomaticEnvironment
45
import httpx
56
from .core.client_wrapper import SyncClientWrapper
67
from .pic.client import PicClient
@@ -24,9 +25,18 @@ class Axiomatic:
2425
2526
Parameters
2627
----------
27-
base_url : str
28+
base_url : typing.Optional[str]
2829
The base url to use for requests from the client.
2930
31+
environment : AxiomaticEnvironment
32+
The environment to use for requests from the client. from .environment import AxiomaticEnvironment
33+
34+
35+
36+
Defaults to AxiomaticEnvironment.DEFAULT
37+
38+
39+
3040
api_key : str
3141
timeout : typing.Optional[float]
3242
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
@@ -43,22 +53,22 @@ class Axiomatic:
4353
4454
client = Axiomatic(
4555
api_key="YOUR_API_KEY",
46-
base_url="https://yourhost.com/path/to/api",
4756
)
4857
"""
4958

5059
def __init__(
5160
self,
5261
*,
53-
base_url: str,
62+
base_url: typing.Optional[str] = None,
63+
environment: AxiomaticEnvironment = AxiomaticEnvironment.DEFAULT,
5464
api_key: str,
5565
timeout: typing.Optional[float] = None,
5666
follow_redirects: typing.Optional[bool] = True,
5767
httpx_client: typing.Optional[httpx.Client] = None,
5868
):
5969
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
6070
self._client_wrapper = SyncClientWrapper(
61-
base_url=base_url,
71+
base_url=_get_base_url(base_url=base_url, environment=environment),
6272
api_key=api_key,
6373
httpx_client=httpx_client
6474
if httpx_client is not None
@@ -92,7 +102,6 @@ def health_check_health_check_get(
92102
93103
client = Axiomatic(
94104
api_key="YOUR_API_KEY",
95-
base_url="https://yourhost.com/path/to/api",
96105
)
97106
client.health_check_health_check_get()
98107
"""
@@ -122,9 +131,18 @@ class AsyncAxiomatic:
122131
123132
Parameters
124133
----------
125-
base_url : str
134+
base_url : typing.Optional[str]
126135
The base url to use for requests from the client.
127136
137+
environment : AxiomaticEnvironment
138+
The environment to use for requests from the client. from .environment import AxiomaticEnvironment
139+
140+
141+
142+
Defaults to AxiomaticEnvironment.DEFAULT
143+
144+
145+
128146
api_key : str
129147
timeout : typing.Optional[float]
130148
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
@@ -141,22 +159,22 @@ class AsyncAxiomatic:
141159
142160
client = AsyncAxiomatic(
143161
api_key="YOUR_API_KEY",
144-
base_url="https://yourhost.com/path/to/api",
145162
)
146163
"""
147164

148165
def __init__(
149166
self,
150167
*,
151-
base_url: str,
168+
base_url: typing.Optional[str] = None,
169+
environment: AxiomaticEnvironment = AxiomaticEnvironment.DEFAULT,
152170
api_key: str,
153171
timeout: typing.Optional[float] = None,
154172
follow_redirects: typing.Optional[bool] = True,
155173
httpx_client: typing.Optional[httpx.AsyncClient] = None,
156174
):
157175
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
158176
self._client_wrapper = AsyncClientWrapper(
159-
base_url=base_url,
177+
base_url=_get_base_url(base_url=base_url, environment=environment),
160178
api_key=api_key,
161179
httpx_client=httpx_client
162180
if httpx_client is not None
@@ -192,7 +210,6 @@ async def health_check_health_check_get(
192210
193211
client = AsyncAxiomatic(
194212
api_key="YOUR_API_KEY",
195-
base_url="https://yourhost.com/path/to/api",
196213
)
197214
198215
@@ -220,3 +237,12 @@ async def main() -> None:
220237
except JSONDecodeError:
221238
raise ApiError(status_code=_response.status_code, body=_response.text)
222239
raise ApiError(status_code=_response.status_code, body=_response_json)
240+
241+
242+
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: AxiomaticEnvironment) -> str:
243+
if base_url is not None:
244+
return base_url
245+
elif environment is not None:
246+
return environment.value
247+
else:
248+
raise Exception("Please pass in either base_url or environment to construct the client")

src/axiomatic/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "axiomatic",
19-
"X-Fern-SDK-Version": "0.0.2",
19+
"X-Fern-SDK-Version": "0.0.3",
2020
}
2121
headers["x-api-key"] = self.api_key
2222
return headers

src/axiomatic/environment.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import enum
4+
5+
6+
class AxiomaticEnvironment(enum.Enum):
7+
DEFAULT = "https://api.axiomatic-ai.com"

src/axiomatic/experimental/client.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def assistant(
4343
4444
client = Axiomatic(
4545
api_key="YOUR_API_KEY",
46-
base_url="https://yourhost.com/path/to/api",
4746
)
4847
client.experimental.assistant(
4948
query="query",
@@ -107,7 +106,6 @@ def synthesize(
107106
108107
client = Axiomatic(
109108
api_key="YOUR_API_KEY",
110-
base_url="https://yourhost.com/path/to/api",
111109
)
112110
client.experimental.synthesize(
113111
query="query",
@@ -178,7 +176,6 @@ async def assistant(
178176
179177
client = AsyncAxiomatic(
180178
api_key="YOUR_API_KEY",
181-
base_url="https://yourhost.com/path/to/api",
182179
)
183180
184181
@@ -250,7 +247,6 @@ async def synthesize(
250247
251248
client = AsyncAxiomatic(
252249
api_key="YOUR_API_KEY",
253-
base_url="https://yourhost.com/path/to/api",
254250
)
255251
256252

src/axiomatic/generic/client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def extract(
4040
4141
client = Axiomatic(
4242
api_key="YOUR_API_KEY",
43-
base_url="https://yourhost.com/path/to/api",
4443
)
4544
client.generic.extract(
4645
query="query",
@@ -111,7 +110,6 @@ async def extract(
111110
112111
client = AsyncAxiomatic(
113112
api_key="YOUR_API_KEY",
114-
base_url="https://yourhost.com/path/to/api",
115113
)
116114
117115

src/axiomatic/lean/client.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def lean_execute(
4949
5050
client = Axiomatic(
5151
api_key="YOUR_API_KEY",
52-
base_url="https://yourhost.com/path/to/api",
5352
)
5453
client.lean.lean_execute()
5554
"""
@@ -115,7 +114,6 @@ def suggest(
115114
116115
client = Axiomatic(
117116
api_key="YOUR_API_KEY",
118-
base_url="https://yourhost.com/path/to/api",
119117
)
120118
client.lean.suggest(
121119
prompt="prompt",
@@ -181,7 +179,6 @@ def z_3_execute(
181179
182180
client = Axiomatic(
183181
api_key="YOUR_API_KEY",
184-
base_url="https://yourhost.com/path/to/api",
185182
)
186183
client.lean.z_3_execute(
187184
code="code",
@@ -261,7 +258,6 @@ async def lean_execute(
261258
262259
client = AsyncAxiomatic(
263260
api_key="YOUR_API_KEY",
264-
base_url="https://yourhost.com/path/to/api",
265261
)
266262
267263
@@ -335,7 +331,6 @@ async def suggest(
335331
336332
client = AsyncAxiomatic(
337333
api_key="YOUR_API_KEY",
338-
base_url="https://yourhost.com/path/to/api",
339334
)
340335
341336
@@ -409,7 +404,6 @@ async def z_3_execute(
409404
410405
client = AsyncAxiomatic(
411406
api_key="YOUR_API_KEY",
412-
base_url="https://yourhost.com/path/to/api",
413407
)
414408
415409

0 commit comments

Comments
 (0)