payi 0.1.0a24__py3-none-any.whl → 0.1.0a25__py3-none-any.whl
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.
Potentially problematic release.
This version of payi might be problematic. Click here for more details.
- payi/_base_client.py +60 -48
- payi/_client.py +8 -0
- payi/_compat.py +2 -0
- payi/_utils/_utils.py +4 -3
- payi/_version.py +1 -1
- payi/resources/__init__.py +14 -0
- payi/resources/budgets/budgets.py +22 -0
- payi/resources/budgets/tags.py +22 -0
- payi/resources/categories/categories.py +22 -0
- payi/resources/categories/resources.py +22 -0
- payi/resources/evaluations/__init__.py +47 -0
- payi/resources/evaluations/evaluations.py +134 -0
- payi/resources/evaluations/experiences.py +188 -0
- payi/resources/evaluations/requests.py +200 -0
- payi/resources/experiences/experiences.py +22 -0
- payi/resources/experiences/types.py +22 -0
- payi/resources/ingest.py +22 -0
- payi/types/__init__.py +1 -0
- payi/types/evaluations/__init__.py +6 -0
- payi/types/evaluations/experience_create_params.py +14 -0
- payi/types/evaluations/request_create_params.py +14 -0
- payi/types/experiences/experience_type.py +0 -2
- payi/types/shared/__init__.py +3 -0
- payi/types/shared/evaluation_response.py +11 -0
- {payi-0.1.0a24.dist-info → payi-0.1.0a25.dist-info}/METADATA +12 -1
- {payi-0.1.0a24.dist-info → payi-0.1.0a25.dist-info}/RECORD +28 -19
- {payi-0.1.0a24.dist-info → payi-0.1.0a25.dist-info}/WHEEL +0 -0
- {payi-0.1.0a24.dist-info → payi-0.1.0a25.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .requests import (
|
|
6
|
+
RequestsResource,
|
|
7
|
+
AsyncRequestsResource,
|
|
8
|
+
RequestsResourceWithRawResponse,
|
|
9
|
+
AsyncRequestsResourceWithRawResponse,
|
|
10
|
+
RequestsResourceWithStreamingResponse,
|
|
11
|
+
AsyncRequestsResourceWithStreamingResponse,
|
|
12
|
+
)
|
|
13
|
+
from ..._compat import cached_property
|
|
14
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from .experiences import (
|
|
16
|
+
ExperiencesResource,
|
|
17
|
+
AsyncExperiencesResource,
|
|
18
|
+
ExperiencesResourceWithRawResponse,
|
|
19
|
+
AsyncExperiencesResourceWithRawResponse,
|
|
20
|
+
ExperiencesResourceWithStreamingResponse,
|
|
21
|
+
AsyncExperiencesResourceWithStreamingResponse,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__all__ = ["EvaluationsResource", "AsyncEvaluationsResource"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class EvaluationsResource(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def experiences(self) -> ExperiencesResource:
|
|
30
|
+
return ExperiencesResource(self._client)
|
|
31
|
+
|
|
32
|
+
@cached_property
|
|
33
|
+
def requests(self) -> RequestsResource:
|
|
34
|
+
return RequestsResource(self._client)
|
|
35
|
+
|
|
36
|
+
@cached_property
|
|
37
|
+
def with_raw_response(self) -> EvaluationsResourceWithRawResponse:
|
|
38
|
+
"""
|
|
39
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
40
|
+
the raw response object instead of the parsed content.
|
|
41
|
+
|
|
42
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
43
|
+
"""
|
|
44
|
+
return EvaluationsResourceWithRawResponse(self)
|
|
45
|
+
|
|
46
|
+
@cached_property
|
|
47
|
+
def with_streaming_response(self) -> EvaluationsResourceWithStreamingResponse:
|
|
48
|
+
"""
|
|
49
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
50
|
+
|
|
51
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
52
|
+
"""
|
|
53
|
+
return EvaluationsResourceWithStreamingResponse(self)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class AsyncEvaluationsResource(AsyncAPIResource):
|
|
57
|
+
@cached_property
|
|
58
|
+
def experiences(self) -> AsyncExperiencesResource:
|
|
59
|
+
return AsyncExperiencesResource(self._client)
|
|
60
|
+
|
|
61
|
+
@cached_property
|
|
62
|
+
def requests(self) -> AsyncRequestsResource:
|
|
63
|
+
return AsyncRequestsResource(self._client)
|
|
64
|
+
|
|
65
|
+
@cached_property
|
|
66
|
+
def with_raw_response(self) -> AsyncEvaluationsResourceWithRawResponse:
|
|
67
|
+
"""
|
|
68
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
69
|
+
the raw response object instead of the parsed content.
|
|
70
|
+
|
|
71
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
72
|
+
"""
|
|
73
|
+
return AsyncEvaluationsResourceWithRawResponse(self)
|
|
74
|
+
|
|
75
|
+
@cached_property
|
|
76
|
+
def with_streaming_response(self) -> AsyncEvaluationsResourceWithStreamingResponse:
|
|
77
|
+
"""
|
|
78
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
79
|
+
|
|
80
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
81
|
+
"""
|
|
82
|
+
return AsyncEvaluationsResourceWithStreamingResponse(self)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class EvaluationsResourceWithRawResponse:
|
|
86
|
+
def __init__(self, evaluations: EvaluationsResource) -> None:
|
|
87
|
+
self._evaluations = evaluations
|
|
88
|
+
|
|
89
|
+
@cached_property
|
|
90
|
+
def experiences(self) -> ExperiencesResourceWithRawResponse:
|
|
91
|
+
return ExperiencesResourceWithRawResponse(self._evaluations.experiences)
|
|
92
|
+
|
|
93
|
+
@cached_property
|
|
94
|
+
def requests(self) -> RequestsResourceWithRawResponse:
|
|
95
|
+
return RequestsResourceWithRawResponse(self._evaluations.requests)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class AsyncEvaluationsResourceWithRawResponse:
|
|
99
|
+
def __init__(self, evaluations: AsyncEvaluationsResource) -> None:
|
|
100
|
+
self._evaluations = evaluations
|
|
101
|
+
|
|
102
|
+
@cached_property
|
|
103
|
+
def experiences(self) -> AsyncExperiencesResourceWithRawResponse:
|
|
104
|
+
return AsyncExperiencesResourceWithRawResponse(self._evaluations.experiences)
|
|
105
|
+
|
|
106
|
+
@cached_property
|
|
107
|
+
def requests(self) -> AsyncRequestsResourceWithRawResponse:
|
|
108
|
+
return AsyncRequestsResourceWithRawResponse(self._evaluations.requests)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class EvaluationsResourceWithStreamingResponse:
|
|
112
|
+
def __init__(self, evaluations: EvaluationsResource) -> None:
|
|
113
|
+
self._evaluations = evaluations
|
|
114
|
+
|
|
115
|
+
@cached_property
|
|
116
|
+
def experiences(self) -> ExperiencesResourceWithStreamingResponse:
|
|
117
|
+
return ExperiencesResourceWithStreamingResponse(self._evaluations.experiences)
|
|
118
|
+
|
|
119
|
+
@cached_property
|
|
120
|
+
def requests(self) -> RequestsResourceWithStreamingResponse:
|
|
121
|
+
return RequestsResourceWithStreamingResponse(self._evaluations.requests)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class AsyncEvaluationsResourceWithStreamingResponse:
|
|
125
|
+
def __init__(self, evaluations: AsyncEvaluationsResource) -> None:
|
|
126
|
+
self._evaluations = evaluations
|
|
127
|
+
|
|
128
|
+
@cached_property
|
|
129
|
+
def experiences(self) -> AsyncExperiencesResourceWithStreamingResponse:
|
|
130
|
+
return AsyncExperiencesResourceWithStreamingResponse(self._evaluations.experiences)
|
|
131
|
+
|
|
132
|
+
@cached_property
|
|
133
|
+
def requests(self) -> AsyncRequestsResourceWithStreamingResponse:
|
|
134
|
+
return AsyncRequestsResourceWithStreamingResponse(self._evaluations.requests)
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ..._utils import (
|
|
11
|
+
maybe_transform,
|
|
12
|
+
async_maybe_transform,
|
|
13
|
+
)
|
|
14
|
+
from ..._compat import cached_property
|
|
15
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from ..._response import (
|
|
17
|
+
to_raw_response_wrapper,
|
|
18
|
+
to_streamed_response_wrapper,
|
|
19
|
+
async_to_raw_response_wrapper,
|
|
20
|
+
async_to_streamed_response_wrapper,
|
|
21
|
+
)
|
|
22
|
+
from ..._base_client import make_request_options
|
|
23
|
+
from ...types.evaluations import experience_create_params
|
|
24
|
+
from ...types.shared.evaluation_response import EvaluationResponse
|
|
25
|
+
|
|
26
|
+
__all__ = ["ExperiencesResource", "AsyncExperiencesResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ExperiencesResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> ExperiencesResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return ExperiencesResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> ExperiencesResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return ExperiencesResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def create(
|
|
50
|
+
self,
|
|
51
|
+
experience_id: str,
|
|
52
|
+
*,
|
|
53
|
+
evaluation: int,
|
|
54
|
+
user_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
55
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
56
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
57
|
+
extra_headers: Headers | None = None,
|
|
58
|
+
extra_query: Query | None = None,
|
|
59
|
+
extra_body: Body | None = None,
|
|
60
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
61
|
+
) -> EvaluationResponse:
|
|
62
|
+
"""
|
|
63
|
+
Create an Evaluation for an Experience
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
extra_headers: Send extra headers
|
|
67
|
+
|
|
68
|
+
extra_query: Add additional query parameters to the request
|
|
69
|
+
|
|
70
|
+
extra_body: Add additional JSON properties to the request
|
|
71
|
+
|
|
72
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
73
|
+
"""
|
|
74
|
+
if not experience_id:
|
|
75
|
+
raise ValueError(f"Expected a non-empty value for `experience_id` but received {experience_id!r}")
|
|
76
|
+
return self._post(
|
|
77
|
+
f"/api/v1/evaluations/experiences/{experience_id}",
|
|
78
|
+
body=maybe_transform(
|
|
79
|
+
{
|
|
80
|
+
"evaluation": evaluation,
|
|
81
|
+
"user_id": user_id,
|
|
82
|
+
},
|
|
83
|
+
experience_create_params.ExperienceCreateParams,
|
|
84
|
+
),
|
|
85
|
+
options=make_request_options(
|
|
86
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
87
|
+
),
|
|
88
|
+
cast_to=EvaluationResponse,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class AsyncExperiencesResource(AsyncAPIResource):
|
|
93
|
+
@cached_property
|
|
94
|
+
def with_raw_response(self) -> AsyncExperiencesResourceWithRawResponse:
|
|
95
|
+
"""
|
|
96
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
97
|
+
the raw response object instead of the parsed content.
|
|
98
|
+
|
|
99
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
100
|
+
"""
|
|
101
|
+
return AsyncExperiencesResourceWithRawResponse(self)
|
|
102
|
+
|
|
103
|
+
@cached_property
|
|
104
|
+
def with_streaming_response(self) -> AsyncExperiencesResourceWithStreamingResponse:
|
|
105
|
+
"""
|
|
106
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
107
|
+
|
|
108
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
109
|
+
"""
|
|
110
|
+
return AsyncExperiencesResourceWithStreamingResponse(self)
|
|
111
|
+
|
|
112
|
+
async def create(
|
|
113
|
+
self,
|
|
114
|
+
experience_id: str,
|
|
115
|
+
*,
|
|
116
|
+
evaluation: int,
|
|
117
|
+
user_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
118
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
119
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
120
|
+
extra_headers: Headers | None = None,
|
|
121
|
+
extra_query: Query | None = None,
|
|
122
|
+
extra_body: Body | None = None,
|
|
123
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
124
|
+
) -> EvaluationResponse:
|
|
125
|
+
"""
|
|
126
|
+
Create an Evaluation for an Experience
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
extra_headers: Send extra headers
|
|
130
|
+
|
|
131
|
+
extra_query: Add additional query parameters to the request
|
|
132
|
+
|
|
133
|
+
extra_body: Add additional JSON properties to the request
|
|
134
|
+
|
|
135
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
136
|
+
"""
|
|
137
|
+
if not experience_id:
|
|
138
|
+
raise ValueError(f"Expected a non-empty value for `experience_id` but received {experience_id!r}")
|
|
139
|
+
return await self._post(
|
|
140
|
+
f"/api/v1/evaluations/experiences/{experience_id}",
|
|
141
|
+
body=await async_maybe_transform(
|
|
142
|
+
{
|
|
143
|
+
"evaluation": evaluation,
|
|
144
|
+
"user_id": user_id,
|
|
145
|
+
},
|
|
146
|
+
experience_create_params.ExperienceCreateParams,
|
|
147
|
+
),
|
|
148
|
+
options=make_request_options(
|
|
149
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
150
|
+
),
|
|
151
|
+
cast_to=EvaluationResponse,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class ExperiencesResourceWithRawResponse:
|
|
156
|
+
def __init__(self, experiences: ExperiencesResource) -> None:
|
|
157
|
+
self._experiences = experiences
|
|
158
|
+
|
|
159
|
+
self.create = to_raw_response_wrapper(
|
|
160
|
+
experiences.create,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class AsyncExperiencesResourceWithRawResponse:
|
|
165
|
+
def __init__(self, experiences: AsyncExperiencesResource) -> None:
|
|
166
|
+
self._experiences = experiences
|
|
167
|
+
|
|
168
|
+
self.create = async_to_raw_response_wrapper(
|
|
169
|
+
experiences.create,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class ExperiencesResourceWithStreamingResponse:
|
|
174
|
+
def __init__(self, experiences: ExperiencesResource) -> None:
|
|
175
|
+
self._experiences = experiences
|
|
176
|
+
|
|
177
|
+
self.create = to_streamed_response_wrapper(
|
|
178
|
+
experiences.create,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class AsyncExperiencesResourceWithStreamingResponse:
|
|
183
|
+
def __init__(self, experiences: AsyncExperiencesResource) -> None:
|
|
184
|
+
self._experiences = experiences
|
|
185
|
+
|
|
186
|
+
self.create = async_to_streamed_response_wrapper(
|
|
187
|
+
experiences.create,
|
|
188
|
+
)
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ..._utils import (
|
|
11
|
+
maybe_transform,
|
|
12
|
+
async_maybe_transform,
|
|
13
|
+
)
|
|
14
|
+
from ..._compat import cached_property
|
|
15
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from ..._response import (
|
|
17
|
+
to_raw_response_wrapper,
|
|
18
|
+
to_streamed_response_wrapper,
|
|
19
|
+
async_to_raw_response_wrapper,
|
|
20
|
+
async_to_streamed_response_wrapper,
|
|
21
|
+
)
|
|
22
|
+
from ..._base_client import make_request_options
|
|
23
|
+
from ...types.evaluations import request_create_params
|
|
24
|
+
from ...types.shared.evaluation_response import EvaluationResponse
|
|
25
|
+
|
|
26
|
+
__all__ = ["RequestsResource", "AsyncRequestsResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class RequestsResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> RequestsResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return RequestsResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> RequestsResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return RequestsResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def create(
|
|
50
|
+
self,
|
|
51
|
+
request_id: str,
|
|
52
|
+
*,
|
|
53
|
+
evaluation: int,
|
|
54
|
+
user_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
55
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
56
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
57
|
+
extra_headers: Headers | None = None,
|
|
58
|
+
extra_query: Query | None = None,
|
|
59
|
+
extra_body: Body | None = None,
|
|
60
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
61
|
+
) -> EvaluationResponse:
|
|
62
|
+
"""
|
|
63
|
+
Create an Evaluation for a Request
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
evaluation: The evaluation value
|
|
67
|
+
|
|
68
|
+
request_id: The request ID being evaluated
|
|
69
|
+
|
|
70
|
+
user_id: The user ID creating the evaluation
|
|
71
|
+
|
|
72
|
+
extra_headers: Send extra headers
|
|
73
|
+
|
|
74
|
+
extra_query: Add additional query parameters to the request
|
|
75
|
+
|
|
76
|
+
extra_body: Add additional JSON properties to the request
|
|
77
|
+
|
|
78
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
79
|
+
"""
|
|
80
|
+
if not request_id:
|
|
81
|
+
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
82
|
+
return self._post(
|
|
83
|
+
f"/api/v1/evaluations/requests/{request_id}",
|
|
84
|
+
body=maybe_transform(
|
|
85
|
+
{
|
|
86
|
+
"evaluation": evaluation,
|
|
87
|
+
"user_id": user_id,
|
|
88
|
+
},
|
|
89
|
+
request_create_params.RequestCreateParams,
|
|
90
|
+
),
|
|
91
|
+
options=make_request_options(
|
|
92
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
93
|
+
),
|
|
94
|
+
cast_to=EvaluationResponse,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class AsyncRequestsResource(AsyncAPIResource):
|
|
99
|
+
@cached_property
|
|
100
|
+
def with_raw_response(self) -> AsyncRequestsResourceWithRawResponse:
|
|
101
|
+
"""
|
|
102
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
103
|
+
the raw response object instead of the parsed content.
|
|
104
|
+
|
|
105
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
106
|
+
"""
|
|
107
|
+
return AsyncRequestsResourceWithRawResponse(self)
|
|
108
|
+
|
|
109
|
+
@cached_property
|
|
110
|
+
def with_streaming_response(self) -> AsyncRequestsResourceWithStreamingResponse:
|
|
111
|
+
"""
|
|
112
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
113
|
+
|
|
114
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
115
|
+
"""
|
|
116
|
+
return AsyncRequestsResourceWithStreamingResponse(self)
|
|
117
|
+
|
|
118
|
+
async def create(
|
|
119
|
+
self,
|
|
120
|
+
request_id: str,
|
|
121
|
+
*,
|
|
122
|
+
evaluation: int,
|
|
123
|
+
user_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
124
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
125
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
126
|
+
extra_headers: Headers | None = None,
|
|
127
|
+
extra_query: Query | None = None,
|
|
128
|
+
extra_body: Body | None = None,
|
|
129
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
130
|
+
) -> EvaluationResponse:
|
|
131
|
+
"""
|
|
132
|
+
Create an Evaluation for a Request
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
evaluation: The evaluation value
|
|
136
|
+
|
|
137
|
+
request_id: The request ID being evaluated
|
|
138
|
+
|
|
139
|
+
user_id: The user ID creating the evaluation
|
|
140
|
+
|
|
141
|
+
extra_headers: Send extra headers
|
|
142
|
+
|
|
143
|
+
extra_query: Add additional query parameters to the request
|
|
144
|
+
|
|
145
|
+
extra_body: Add additional JSON properties to the request
|
|
146
|
+
|
|
147
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
148
|
+
"""
|
|
149
|
+
if not request_id:
|
|
150
|
+
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
151
|
+
return await self._post(
|
|
152
|
+
f"/api/v1/evaluations/requests/{request_id}",
|
|
153
|
+
body=await async_maybe_transform(
|
|
154
|
+
{
|
|
155
|
+
"evaluation": evaluation,
|
|
156
|
+
"user_id": user_id,
|
|
157
|
+
},
|
|
158
|
+
request_create_params.RequestCreateParams,
|
|
159
|
+
),
|
|
160
|
+
options=make_request_options(
|
|
161
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
162
|
+
),
|
|
163
|
+
cast_to=EvaluationResponse,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class RequestsResourceWithRawResponse:
|
|
168
|
+
def __init__(self, requests: RequestsResource) -> None:
|
|
169
|
+
self._requests = requests
|
|
170
|
+
|
|
171
|
+
self.create = to_raw_response_wrapper(
|
|
172
|
+
requests.create,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class AsyncRequestsResourceWithRawResponse:
|
|
177
|
+
def __init__(self, requests: AsyncRequestsResource) -> None:
|
|
178
|
+
self._requests = requests
|
|
179
|
+
|
|
180
|
+
self.create = async_to_raw_response_wrapper(
|
|
181
|
+
requests.create,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class RequestsResourceWithStreamingResponse:
|
|
186
|
+
def __init__(self, requests: RequestsResource) -> None:
|
|
187
|
+
self._requests = requests
|
|
188
|
+
|
|
189
|
+
self.create = to_streamed_response_wrapper(
|
|
190
|
+
requests.create,
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class AsyncRequestsResourceWithStreamingResponse:
|
|
195
|
+
def __init__(self, requests: AsyncRequestsResource) -> None:
|
|
196
|
+
self._requests = requests
|
|
197
|
+
|
|
198
|
+
self.create = async_to_streamed_response_wrapper(
|
|
199
|
+
requests.create,
|
|
200
|
+
)
|
|
@@ -34,10 +34,21 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
34
34
|
|
|
35
35
|
@cached_property
|
|
36
36
|
def with_raw_response(self) -> ExperiencesResourceWithRawResponse:
|
|
37
|
+
"""
|
|
38
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
39
|
+
the raw response object instead of the parsed content.
|
|
40
|
+
|
|
41
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
42
|
+
"""
|
|
37
43
|
return ExperiencesResourceWithRawResponse(self)
|
|
38
44
|
|
|
39
45
|
@cached_property
|
|
40
46
|
def with_streaming_response(self) -> ExperiencesResourceWithStreamingResponse:
|
|
47
|
+
"""
|
|
48
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
49
|
+
|
|
50
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
51
|
+
"""
|
|
41
52
|
return ExperiencesResourceWithStreamingResponse(self)
|
|
42
53
|
|
|
43
54
|
def create(
|
|
@@ -147,10 +158,21 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
147
158
|
|
|
148
159
|
@cached_property
|
|
149
160
|
def with_raw_response(self) -> AsyncExperiencesResourceWithRawResponse:
|
|
161
|
+
"""
|
|
162
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
163
|
+
the raw response object instead of the parsed content.
|
|
164
|
+
|
|
165
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
166
|
+
"""
|
|
150
167
|
return AsyncExperiencesResourceWithRawResponse(self)
|
|
151
168
|
|
|
152
169
|
@cached_property
|
|
153
170
|
def with_streaming_response(self) -> AsyncExperiencesResourceWithStreamingResponse:
|
|
171
|
+
"""
|
|
172
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
173
|
+
|
|
174
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
175
|
+
"""
|
|
154
176
|
return AsyncExperiencesResourceWithStreamingResponse(self)
|
|
155
177
|
|
|
156
178
|
async def create(
|
|
@@ -28,10 +28,21 @@ __all__ = ["TypesResource", "AsyncTypesResource"]
|
|
|
28
28
|
class TypesResource(SyncAPIResource):
|
|
29
29
|
@cached_property
|
|
30
30
|
def with_raw_response(self) -> TypesResourceWithRawResponse:
|
|
31
|
+
"""
|
|
32
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
33
|
+
the raw response object instead of the parsed content.
|
|
34
|
+
|
|
35
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
36
|
+
"""
|
|
31
37
|
return TypesResourceWithRawResponse(self)
|
|
32
38
|
|
|
33
39
|
@cached_property
|
|
34
40
|
def with_streaming_response(self) -> TypesResourceWithStreamingResponse:
|
|
41
|
+
"""
|
|
42
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
43
|
+
|
|
44
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
45
|
+
"""
|
|
35
46
|
return TypesResourceWithStreamingResponse(self)
|
|
36
47
|
|
|
37
48
|
def create(
|
|
@@ -215,10 +226,21 @@ class TypesResource(SyncAPIResource):
|
|
|
215
226
|
class AsyncTypesResource(AsyncAPIResource):
|
|
216
227
|
@cached_property
|
|
217
228
|
def with_raw_response(self) -> AsyncTypesResourceWithRawResponse:
|
|
229
|
+
"""
|
|
230
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
231
|
+
the raw response object instead of the parsed content.
|
|
232
|
+
|
|
233
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
234
|
+
"""
|
|
218
235
|
return AsyncTypesResourceWithRawResponse(self)
|
|
219
236
|
|
|
220
237
|
@cached_property
|
|
221
238
|
def with_streaming_response(self) -> AsyncTypesResourceWithStreamingResponse:
|
|
239
|
+
"""
|
|
240
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
241
|
+
|
|
242
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
243
|
+
"""
|
|
222
244
|
return AsyncTypesResourceWithStreamingResponse(self)
|
|
223
245
|
|
|
224
246
|
async def create(
|
payi/resources/ingest.py
CHANGED
|
@@ -33,10 +33,21 @@ __all__ = ["IngestResource", "AsyncIngestResource"]
|
|
|
33
33
|
class IngestResource(SyncAPIResource):
|
|
34
34
|
@cached_property
|
|
35
35
|
def with_raw_response(self) -> IngestResourceWithRawResponse:
|
|
36
|
+
"""
|
|
37
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
38
|
+
the raw response object instead of the parsed content.
|
|
39
|
+
|
|
40
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
41
|
+
"""
|
|
36
42
|
return IngestResourceWithRawResponse(self)
|
|
37
43
|
|
|
38
44
|
@cached_property
|
|
39
45
|
def with_streaming_response(self) -> IngestResourceWithStreamingResponse:
|
|
46
|
+
"""
|
|
47
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
48
|
+
|
|
49
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
50
|
+
"""
|
|
40
51
|
return IngestResourceWithStreamingResponse(self)
|
|
41
52
|
|
|
42
53
|
def bulk(
|
|
@@ -183,10 +194,21 @@ class IngestResource(SyncAPIResource):
|
|
|
183
194
|
class AsyncIngestResource(AsyncAPIResource):
|
|
184
195
|
@cached_property
|
|
185
196
|
def with_raw_response(self) -> AsyncIngestResourceWithRawResponse:
|
|
197
|
+
"""
|
|
198
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
199
|
+
the raw response object instead of the parsed content.
|
|
200
|
+
|
|
201
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
202
|
+
"""
|
|
186
203
|
return AsyncIngestResourceWithRawResponse(self)
|
|
187
204
|
|
|
188
205
|
@cached_property
|
|
189
206
|
def with_streaming_response(self) -> AsyncIngestResourceWithStreamingResponse:
|
|
207
|
+
"""
|
|
208
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
209
|
+
|
|
210
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
211
|
+
"""
|
|
190
212
|
return AsyncIngestResourceWithStreamingResponse(self)
|
|
191
213
|
|
|
192
214
|
async def bulk(
|
payi/types/__init__.py
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .request_create_params import RequestCreateParams as RequestCreateParams
|
|
6
|
+
from .experience_create_params import ExperienceCreateParams as ExperienceCreateParams
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["ExperienceCreateParams"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ExperienceCreateParams(TypedDict, total=False):
|
|
12
|
+
evaluation: Required[int]
|
|
13
|
+
|
|
14
|
+
user_id: Optional[str]
|