Skip to content

Commit 83aa3de

Browse files
rgambeegithub-actions[bot]
authored andcommitted
Regenerate SDK code based on OpenAPI spec (#5141)
Sourced from commit 537b4d397425b874666c1ffad335ec17ca24851e
1 parent 2506ca5 commit 83aa3de

32 files changed

Lines changed: 2245 additions & 62 deletions

src/futuresearch/generated/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""A client library for accessing futuresearch API"""
1+
"""A client library for accessing FutureSearch API"""
22

33
from .client import AuthenticatedClient, Client
44

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
from http import HTTPStatus
2+
from typing import Any
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.subscription_status_response import SubscriptionStatusResponse
9+
from ...types import Response
10+
11+
12+
def _get_kwargs() -> dict[str, Any]:
13+
_kwargs: dict[str, Any] = {
14+
"method": "get",
15+
"url": "/billing/subscription",
16+
}
17+
18+
return _kwargs
19+
20+
21+
def _parse_response(
22+
*, client: AuthenticatedClient | Client, response: httpx.Response
23+
) -> SubscriptionStatusResponse | None:
24+
if response.status_code == 200:
25+
response_200 = SubscriptionStatusResponse.from_dict(response.json())
26+
27+
return response_200
28+
29+
if client.raise_on_unexpected_status:
30+
raise errors.UnexpectedStatus(response.status_code, response.content)
31+
else:
32+
return None
33+
34+
35+
def _build_response(
36+
*, client: AuthenticatedClient | Client, response: httpx.Response
37+
) -> Response[SubscriptionStatusResponse]:
38+
return Response(
39+
status_code=HTTPStatus(response.status_code),
40+
content=response.content,
41+
headers=response.headers,
42+
parsed=_parse_response(client=client, response=response),
43+
)
44+
45+
46+
def sync_detailed(
47+
*,
48+
client: AuthenticatedClient,
49+
) -> Response[SubscriptionStatusResponse]:
50+
"""Get subscription status
51+
52+
Get the current subscription tier and details for the authenticated user.
53+
54+
Raises:
55+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56+
httpx.TimeoutException: If the request takes longer than Client.timeout.
57+
58+
Returns:
59+
Response[SubscriptionStatusResponse]
60+
"""
61+
62+
kwargs = _get_kwargs()
63+
64+
response = client.get_httpx_client().request(
65+
**kwargs,
66+
)
67+
68+
return _build_response(client=client, response=response)
69+
70+
71+
def sync(
72+
*,
73+
client: AuthenticatedClient,
74+
) -> SubscriptionStatusResponse | None:
75+
"""Get subscription status
76+
77+
Get the current subscription tier and details for the authenticated user.
78+
79+
Raises:
80+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81+
httpx.TimeoutException: If the request takes longer than Client.timeout.
82+
83+
Returns:
84+
SubscriptionStatusResponse
85+
"""
86+
87+
return sync_detailed(
88+
client=client,
89+
).parsed
90+
91+
92+
async def asyncio_detailed(
93+
*,
94+
client: AuthenticatedClient,
95+
) -> Response[SubscriptionStatusResponse]:
96+
"""Get subscription status
97+
98+
Get the current subscription tier and details for the authenticated user.
99+
100+
Raises:
101+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102+
httpx.TimeoutException: If the request takes longer than Client.timeout.
103+
104+
Returns:
105+
Response[SubscriptionStatusResponse]
106+
"""
107+
108+
kwargs = _get_kwargs()
109+
110+
response = await client.get_async_httpx_client().request(**kwargs)
111+
112+
return _build_response(client=client, response=response)
113+
114+
115+
async def asyncio(
116+
*,
117+
client: AuthenticatedClient,
118+
) -> SubscriptionStatusResponse | None:
119+
"""Get subscription status
120+
121+
Get the current subscription tier and details for the authenticated user.
122+
123+
Raises:
124+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125+
httpx.TimeoutException: If the request takes longer than Client.timeout.
126+
127+
Returns:
128+
SubscriptionStatusResponse
129+
"""
130+
131+
return (
132+
await asyncio_detailed(
133+
client=client,
134+
)
135+
).parsed

src/futuresearch/generated/api/operations/forecast_operations_forecast_post.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ def sync_detailed(
7575
body: ForecastOperation,
7676
x_cohort_source: None | str | Unset = UNSET,
7777
) -> Response[ErrorResponse | InsufficientBalanceResponse | OperationResponse]:
78-
"""AI-powered probability forecast
78+
"""AI-powered forecast
7979
80-
Run 6 parallel research agents per row, then synthesize into a probability forecast with rationale.
80+
Run 6 parallel research agents per row, then synthesize into a forecast. Supports binary
81+
(probability) and numeric (percentile) modes.
8182
8283
Args:
8384
x_cohort_source (None | str | Unset):
@@ -109,9 +110,10 @@ def sync(
109110
body: ForecastOperation,
110111
x_cohort_source: None | str | Unset = UNSET,
111112
) -> ErrorResponse | InsufficientBalanceResponse | OperationResponse | None:
112-
"""AI-powered probability forecast
113+
"""AI-powered forecast
113114
114-
Run 6 parallel research agents per row, then synthesize into a probability forecast with rationale.
115+
Run 6 parallel research agents per row, then synthesize into a forecast. Supports binary
116+
(probability) and numeric (percentile) modes.
115117
116118
Args:
117119
x_cohort_source (None | str | Unset):
@@ -138,9 +140,10 @@ async def asyncio_detailed(
138140
body: ForecastOperation,
139141
x_cohort_source: None | str | Unset = UNSET,
140142
) -> Response[ErrorResponse | InsufficientBalanceResponse | OperationResponse]:
141-
"""AI-powered probability forecast
143+
"""AI-powered forecast
142144
143-
Run 6 parallel research agents per row, then synthesize into a probability forecast with rationale.
145+
Run 6 parallel research agents per row, then synthesize into a forecast. Supports binary
146+
(probability) and numeric (percentile) modes.
144147
145148
Args:
146149
x_cohort_source (None | str | Unset):
@@ -170,9 +173,10 @@ async def asyncio(
170173
body: ForecastOperation,
171174
x_cohort_source: None | str | Unset = UNSET,
172175
) -> ErrorResponse | InsufficientBalanceResponse | OperationResponse | None:
173-
"""AI-powered probability forecast
176+
"""AI-powered forecast
174177
175-
Run 6 parallel research agents per row, then synthesize into a probability forecast with rationale.
178+
Run 6 parallel research agents per row, then synthesize into a forecast. Supports binary
179+
(probability) and numeric (percentile) modes.
176180
177181
Args:
178182
x_cohort_source (None | str | Unset):

src/futuresearch/generated/api/sessions/update_session_endpoint_sessions_session_id_patch.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from http import HTTPStatus
22
from typing import Any
3+
from urllib.parse import quote
34
from uuid import UUID
45

56
import httpx
@@ -21,7 +22,9 @@ def _get_kwargs(
2122

2223
_kwargs: dict[str, Any] = {
2324
"method": "patch",
24-
"url": f"/sessions/{session_id}",
25+
"url": "/sessions/{session_id}".format(
26+
session_id=quote(str(session_id), safe=""),
27+
),
2528
}
2629

2730
_kwargs["json"] = body.to_dict()
@@ -85,7 +88,7 @@ def sync_detailed(
8588
"""
8689

8790
kwargs = _get_kwargs(
88-
session_id,
91+
session_id=session_id,
8992
body=body,
9093
)
9194

@@ -119,7 +122,7 @@ def sync(
119122
"""
120123

121124
return sync_detailed(
122-
session_id,
125+
session_id=session_id,
123126
client=client,
124127
body=body,
125128
).parsed
@@ -148,7 +151,7 @@ async def asyncio_detailed(
148151
"""
149152

150153
kwargs = _get_kwargs(
151-
session_id,
154+
session_id=session_id,
152155
body=body,
153156
)
154157

@@ -181,7 +184,7 @@ async def asyncio(
181184

182185
return (
183186
await asyncio_detailed(
184-
session_id,
187+
session_id=session_id,
185188
client=client,
186189
body=body,
187190
)

0 commit comments

Comments
 (0)