profound 0.1.0__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 profound might be problematic. Click here for more details.
- profound/__init__.py +102 -0
- profound/_base_client.py +1995 -0
- profound/_client.py +448 -0
- profound/_compat.py +219 -0
- profound/_constants.py +14 -0
- profound/_exceptions.py +108 -0
- profound/_files.py +123 -0
- profound/_models.py +835 -0
- profound/_qs.py +150 -0
- profound/_resource.py +43 -0
- profound/_response.py +830 -0
- profound/_streaming.py +333 -0
- profound/_types.py +260 -0
- profound/_utils/__init__.py +64 -0
- profound/_utils/_compat.py +45 -0
- profound/_utils/_datetime_parse.py +136 -0
- profound/_utils/_logs.py +25 -0
- profound/_utils/_proxy.py +65 -0
- profound/_utils/_reflection.py +42 -0
- profound/_utils/_resources_proxy.py +24 -0
- profound/_utils/_streams.py +12 -0
- profound/_utils/_sync.py +86 -0
- profound/_utils/_transform.py +457 -0
- profound/_utils/_typing.py +156 -0
- profound/_utils/_utils.py +421 -0
- profound/_version.py +4 -0
- profound/lib/.keep +4 -0
- profound/py.typed +0 -0
- profound/resources/__init__.py +61 -0
- profound/resources/logs/__init__.py +33 -0
- profound/resources/logs/logs.py +102 -0
- profound/resources/logs/raw.py +511 -0
- profound/resources/organizations/__init__.py +33 -0
- profound/resources/organizations/categories.py +372 -0
- profound/resources/organizations/organizations.py +269 -0
- profound/resources/prompts.py +201 -0
- profound/resources/reports.py +609 -0
- profound/types/__init__.py +17 -0
- profound/types/info.py +13 -0
- profound/types/logs/__init__.py +8 -0
- profound/types/logs/raw_bots_params.py +111 -0
- profound/types/logs/raw_bots_response.py +45 -0
- profound/types/logs/raw_logs_params.py +99 -0
- profound/types/logs/raw_logs_response.py +39 -0
- profound/types/organization_domains_response.py +20 -0
- profound/types/organization_models_response.py +10 -0
- profound/types/organization_regions_response.py +10 -0
- profound/types/organizations/__init__.py +9 -0
- profound/types/organizations/category_list_response.py +10 -0
- profound/types/organizations/category_prompts_response.py +31 -0
- profound/types/organizations/category_tags_response.py +10 -0
- profound/types/organizations/category_topics_response.py +10 -0
- profound/types/organizations/org_item.py +11 -0
- profound/types/pagination_param.py +15 -0
- profound/types/prompt_answers_params.py +82 -0
- profound/types/prompt_answers_response.py +44 -0
- profound/types/report_citations_params.py +83 -0
- profound/types/report_citations_response.py +16 -0
- profound/types/report_sentiment_params.py +83 -0
- profound/types/report_visibility_params.py +83 -0
- profound/types/response.py +16 -0
- profound/types/result.py +13 -0
- profound-0.1.0.dist-info/METADATA +415 -0
- profound-0.1.0.dist-info/RECORD +66 -0
- profound-0.1.0.dist-info/WHEEL +4 -0
- profound-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,609 @@
|
|
|
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 Dict, List, Union, Iterable
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Literal
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ..types import report_citations_params, report_sentiment_params, report_visibility_params
|
|
12
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
13
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
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.response import Response
|
|
24
|
+
from ..types.pagination_param import PaginationParam
|
|
25
|
+
from ..types.report_citations_response import ReportCitationsResponse
|
|
26
|
+
|
|
27
|
+
__all__ = ["ReportsResource", "AsyncReportsResource"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ReportsResource(SyncAPIResource):
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> ReportsResourceWithRawResponse:
|
|
33
|
+
"""
|
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
35
|
+
the raw response object instead of the parsed content.
|
|
36
|
+
|
|
37
|
+
For more information, see https://www.github.com/cooper-square-technologies/profound-python-sdk#accessing-raw-response-data-eg-headers
|
|
38
|
+
"""
|
|
39
|
+
return ReportsResourceWithRawResponse(self)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_streaming_response(self) -> ReportsResourceWithStreamingResponse:
|
|
43
|
+
"""
|
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
45
|
+
|
|
46
|
+
For more information, see https://www.github.com/cooper-square-technologies/profound-python-sdk#with_streaming_response
|
|
47
|
+
"""
|
|
48
|
+
return ReportsResourceWithStreamingResponse(self)
|
|
49
|
+
|
|
50
|
+
def citations(
|
|
51
|
+
self,
|
|
52
|
+
*,
|
|
53
|
+
category_id: str,
|
|
54
|
+
end_date: Union[str, datetime],
|
|
55
|
+
metrics: List[Literal["count", "share_of_voice"]],
|
|
56
|
+
start_date: Union[str, datetime],
|
|
57
|
+
date_interval: Literal["day", "week", "month", "year"] | Omit = omit,
|
|
58
|
+
dimensions: List[Literal["hostname", "path", "date", "region", "topic", "model", "tag"]] | Omit = omit,
|
|
59
|
+
filters: Iterable[report_citations_params.Filter] | Omit = omit,
|
|
60
|
+
order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
|
|
61
|
+
pagination: PaginationParam | Omit = omit,
|
|
62
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
63
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
64
|
+
extra_headers: Headers | None = None,
|
|
65
|
+
extra_query: Query | None = None,
|
|
66
|
+
extra_body: Body | None = None,
|
|
67
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
68
|
+
) -> ReportCitationsResponse:
|
|
69
|
+
"""Get citations for a given category.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
end_date: End date for the report.
|
|
73
|
+
|
|
74
|
+
Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full
|
|
75
|
+
ISO timestamp.
|
|
76
|
+
|
|
77
|
+
start_date: Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or
|
|
78
|
+
full ISO timestamp.
|
|
79
|
+
|
|
80
|
+
date_interval: Date interval for the report. (only used with date dimension)
|
|
81
|
+
|
|
82
|
+
dimensions: Dimensions to group the report by.
|
|
83
|
+
|
|
84
|
+
filters: List of filters to apply to the report. Each filter has an operator, field, and
|
|
85
|
+
value.
|
|
86
|
+
|
|
87
|
+
order_by: Custom ordering of the report results.
|
|
88
|
+
|
|
89
|
+
The order is a record of key-value pairs where:
|
|
90
|
+
|
|
91
|
+
- key is the field to order by, which can be a metric or dimension
|
|
92
|
+
- value is the direction of the order, either 'asc' for ascending or 'desc' for
|
|
93
|
+
descending.
|
|
94
|
+
|
|
95
|
+
When not specified, the default order is the first metric in the query
|
|
96
|
+
descending.
|
|
97
|
+
|
|
98
|
+
pagination: Pagination settings for the report results.
|
|
99
|
+
|
|
100
|
+
extra_headers: Send extra headers
|
|
101
|
+
|
|
102
|
+
extra_query: Add additional query parameters to the request
|
|
103
|
+
|
|
104
|
+
extra_body: Add additional JSON properties to the request
|
|
105
|
+
|
|
106
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
107
|
+
"""
|
|
108
|
+
return self._post(
|
|
109
|
+
"/v1/reports/citations",
|
|
110
|
+
body=maybe_transform(
|
|
111
|
+
{
|
|
112
|
+
"category_id": category_id,
|
|
113
|
+
"end_date": end_date,
|
|
114
|
+
"metrics": metrics,
|
|
115
|
+
"start_date": start_date,
|
|
116
|
+
"date_interval": date_interval,
|
|
117
|
+
"dimensions": dimensions,
|
|
118
|
+
"filters": filters,
|
|
119
|
+
"order_by": order_by,
|
|
120
|
+
"pagination": pagination,
|
|
121
|
+
},
|
|
122
|
+
report_citations_params.ReportCitationsParams,
|
|
123
|
+
),
|
|
124
|
+
options=make_request_options(
|
|
125
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
126
|
+
),
|
|
127
|
+
cast_to=ReportCitationsResponse,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
def sentiment(
|
|
131
|
+
self,
|
|
132
|
+
*,
|
|
133
|
+
category_id: str,
|
|
134
|
+
end_date: Union[str, datetime],
|
|
135
|
+
metrics: List[Literal["positive", "negative"]],
|
|
136
|
+
start_date: Union[str, datetime],
|
|
137
|
+
date_interval: Literal["day", "week", "month", "year"] | Omit = omit,
|
|
138
|
+
dimensions: List[Literal["theme", "date", "region", "topic", "model", "asset_name", "tag"]] | Omit = omit,
|
|
139
|
+
filters: Iterable[report_sentiment_params.Filter] | Omit = omit,
|
|
140
|
+
order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
|
|
141
|
+
pagination: PaginationParam | Omit = omit,
|
|
142
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
143
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
144
|
+
extra_headers: Headers | None = None,
|
|
145
|
+
extra_query: Query | None = None,
|
|
146
|
+
extra_body: Body | None = None,
|
|
147
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
148
|
+
) -> Response:
|
|
149
|
+
"""Get citations for a given category.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
end_date: End date for the report.
|
|
153
|
+
|
|
154
|
+
Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full
|
|
155
|
+
ISO timestamp.
|
|
156
|
+
|
|
157
|
+
start_date: Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or
|
|
158
|
+
full ISO timestamp.
|
|
159
|
+
|
|
160
|
+
date_interval: Date interval for the report. (only used with date dimension)
|
|
161
|
+
|
|
162
|
+
dimensions: Dimensions to group the report by.
|
|
163
|
+
|
|
164
|
+
filters: List of filters to apply to the report. Each filter has an operator, field, and
|
|
165
|
+
value.
|
|
166
|
+
|
|
167
|
+
order_by: Custom ordering of the report results.
|
|
168
|
+
|
|
169
|
+
The order is a record of key-value pairs where:
|
|
170
|
+
|
|
171
|
+
- key is the field to order by, which can be a metric or dimension
|
|
172
|
+
- value is the direction of the order, either 'asc' for ascending or 'desc' for
|
|
173
|
+
descending.
|
|
174
|
+
|
|
175
|
+
When not specified, the default order is the first metric in the query
|
|
176
|
+
descending.
|
|
177
|
+
|
|
178
|
+
pagination: Pagination settings for the report results.
|
|
179
|
+
|
|
180
|
+
extra_headers: Send extra headers
|
|
181
|
+
|
|
182
|
+
extra_query: Add additional query parameters to the request
|
|
183
|
+
|
|
184
|
+
extra_body: Add additional JSON properties to the request
|
|
185
|
+
|
|
186
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
187
|
+
"""
|
|
188
|
+
return self._post(
|
|
189
|
+
"/v1/reports/sentiment",
|
|
190
|
+
body=maybe_transform(
|
|
191
|
+
{
|
|
192
|
+
"category_id": category_id,
|
|
193
|
+
"end_date": end_date,
|
|
194
|
+
"metrics": metrics,
|
|
195
|
+
"start_date": start_date,
|
|
196
|
+
"date_interval": date_interval,
|
|
197
|
+
"dimensions": dimensions,
|
|
198
|
+
"filters": filters,
|
|
199
|
+
"order_by": order_by,
|
|
200
|
+
"pagination": pagination,
|
|
201
|
+
},
|
|
202
|
+
report_sentiment_params.ReportSentimentParams,
|
|
203
|
+
),
|
|
204
|
+
options=make_request_options(
|
|
205
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
206
|
+
),
|
|
207
|
+
cast_to=Response,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
def visibility(
|
|
211
|
+
self,
|
|
212
|
+
*,
|
|
213
|
+
category_id: str,
|
|
214
|
+
end_date: Union[str, datetime],
|
|
215
|
+
metrics: List[Literal["share_of_voice", "mentions_count", "visibility_score"]],
|
|
216
|
+
start_date: Union[str, datetime],
|
|
217
|
+
date_interval: Literal["day", "week", "month", "year"] | Omit = omit,
|
|
218
|
+
dimensions: List[Literal["date", "region", "topic", "model", "asset_name", "prompt", "tag"]] | Omit = omit,
|
|
219
|
+
filters: Iterable[report_visibility_params.Filter] | Omit = omit,
|
|
220
|
+
order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
|
|
221
|
+
pagination: PaginationParam | Omit = omit,
|
|
222
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
223
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
224
|
+
extra_headers: Headers | None = None,
|
|
225
|
+
extra_query: Query | None = None,
|
|
226
|
+
extra_body: Body | None = None,
|
|
227
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
228
|
+
) -> Response:
|
|
229
|
+
"""Query visibility report.
|
|
230
|
+
|
|
231
|
+
Args:
|
|
232
|
+
end_date: End date for the report.
|
|
233
|
+
|
|
234
|
+
Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full
|
|
235
|
+
ISO timestamp.
|
|
236
|
+
|
|
237
|
+
start_date: Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or
|
|
238
|
+
full ISO timestamp.
|
|
239
|
+
|
|
240
|
+
date_interval: Date interval for the report. (only used with date dimension)
|
|
241
|
+
|
|
242
|
+
dimensions: Dimensions to group the report by.
|
|
243
|
+
|
|
244
|
+
filters: List of filters to apply to the report. Each filter has an operator, field, and
|
|
245
|
+
value.
|
|
246
|
+
|
|
247
|
+
order_by: Custom ordering of the report results.
|
|
248
|
+
|
|
249
|
+
The order is a record of key-value pairs where:
|
|
250
|
+
|
|
251
|
+
- key is the field to order by, which can be a metric or dimension
|
|
252
|
+
- value is the direction of the order, either 'asc' for ascending or 'desc' for
|
|
253
|
+
descending.
|
|
254
|
+
|
|
255
|
+
When not specified, the default order is the first metric in the query
|
|
256
|
+
descending.
|
|
257
|
+
|
|
258
|
+
pagination: Pagination settings for the report results.
|
|
259
|
+
|
|
260
|
+
extra_headers: Send extra headers
|
|
261
|
+
|
|
262
|
+
extra_query: Add additional query parameters to the request
|
|
263
|
+
|
|
264
|
+
extra_body: Add additional JSON properties to the request
|
|
265
|
+
|
|
266
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
267
|
+
"""
|
|
268
|
+
return self._post(
|
|
269
|
+
"/v1/reports/visibility",
|
|
270
|
+
body=maybe_transform(
|
|
271
|
+
{
|
|
272
|
+
"category_id": category_id,
|
|
273
|
+
"end_date": end_date,
|
|
274
|
+
"metrics": metrics,
|
|
275
|
+
"start_date": start_date,
|
|
276
|
+
"date_interval": date_interval,
|
|
277
|
+
"dimensions": dimensions,
|
|
278
|
+
"filters": filters,
|
|
279
|
+
"order_by": order_by,
|
|
280
|
+
"pagination": pagination,
|
|
281
|
+
},
|
|
282
|
+
report_visibility_params.ReportVisibilityParams,
|
|
283
|
+
),
|
|
284
|
+
options=make_request_options(
|
|
285
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
286
|
+
),
|
|
287
|
+
cast_to=Response,
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
class AsyncReportsResource(AsyncAPIResource):
|
|
292
|
+
@cached_property
|
|
293
|
+
def with_raw_response(self) -> AsyncReportsResourceWithRawResponse:
|
|
294
|
+
"""
|
|
295
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
296
|
+
the raw response object instead of the parsed content.
|
|
297
|
+
|
|
298
|
+
For more information, see https://www.github.com/cooper-square-technologies/profound-python-sdk#accessing-raw-response-data-eg-headers
|
|
299
|
+
"""
|
|
300
|
+
return AsyncReportsResourceWithRawResponse(self)
|
|
301
|
+
|
|
302
|
+
@cached_property
|
|
303
|
+
def with_streaming_response(self) -> AsyncReportsResourceWithStreamingResponse:
|
|
304
|
+
"""
|
|
305
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
306
|
+
|
|
307
|
+
For more information, see https://www.github.com/cooper-square-technologies/profound-python-sdk#with_streaming_response
|
|
308
|
+
"""
|
|
309
|
+
return AsyncReportsResourceWithStreamingResponse(self)
|
|
310
|
+
|
|
311
|
+
async def citations(
|
|
312
|
+
self,
|
|
313
|
+
*,
|
|
314
|
+
category_id: str,
|
|
315
|
+
end_date: Union[str, datetime],
|
|
316
|
+
metrics: List[Literal["count", "share_of_voice"]],
|
|
317
|
+
start_date: Union[str, datetime],
|
|
318
|
+
date_interval: Literal["day", "week", "month", "year"] | Omit = omit,
|
|
319
|
+
dimensions: List[Literal["hostname", "path", "date", "region", "topic", "model", "tag"]] | Omit = omit,
|
|
320
|
+
filters: Iterable[report_citations_params.Filter] | Omit = omit,
|
|
321
|
+
order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
|
|
322
|
+
pagination: PaginationParam | Omit = omit,
|
|
323
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
324
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
325
|
+
extra_headers: Headers | None = None,
|
|
326
|
+
extra_query: Query | None = None,
|
|
327
|
+
extra_body: Body | None = None,
|
|
328
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
329
|
+
) -> ReportCitationsResponse:
|
|
330
|
+
"""Get citations for a given category.
|
|
331
|
+
|
|
332
|
+
Args:
|
|
333
|
+
end_date: End date for the report.
|
|
334
|
+
|
|
335
|
+
Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full
|
|
336
|
+
ISO timestamp.
|
|
337
|
+
|
|
338
|
+
start_date: Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or
|
|
339
|
+
full ISO timestamp.
|
|
340
|
+
|
|
341
|
+
date_interval: Date interval for the report. (only used with date dimension)
|
|
342
|
+
|
|
343
|
+
dimensions: Dimensions to group the report by.
|
|
344
|
+
|
|
345
|
+
filters: List of filters to apply to the report. Each filter has an operator, field, and
|
|
346
|
+
value.
|
|
347
|
+
|
|
348
|
+
order_by: Custom ordering of the report results.
|
|
349
|
+
|
|
350
|
+
The order is a record of key-value pairs where:
|
|
351
|
+
|
|
352
|
+
- key is the field to order by, which can be a metric or dimension
|
|
353
|
+
- value is the direction of the order, either 'asc' for ascending or 'desc' for
|
|
354
|
+
descending.
|
|
355
|
+
|
|
356
|
+
When not specified, the default order is the first metric in the query
|
|
357
|
+
descending.
|
|
358
|
+
|
|
359
|
+
pagination: Pagination settings for the report results.
|
|
360
|
+
|
|
361
|
+
extra_headers: Send extra headers
|
|
362
|
+
|
|
363
|
+
extra_query: Add additional query parameters to the request
|
|
364
|
+
|
|
365
|
+
extra_body: Add additional JSON properties to the request
|
|
366
|
+
|
|
367
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
368
|
+
"""
|
|
369
|
+
return await self._post(
|
|
370
|
+
"/v1/reports/citations",
|
|
371
|
+
body=await async_maybe_transform(
|
|
372
|
+
{
|
|
373
|
+
"category_id": category_id,
|
|
374
|
+
"end_date": end_date,
|
|
375
|
+
"metrics": metrics,
|
|
376
|
+
"start_date": start_date,
|
|
377
|
+
"date_interval": date_interval,
|
|
378
|
+
"dimensions": dimensions,
|
|
379
|
+
"filters": filters,
|
|
380
|
+
"order_by": order_by,
|
|
381
|
+
"pagination": pagination,
|
|
382
|
+
},
|
|
383
|
+
report_citations_params.ReportCitationsParams,
|
|
384
|
+
),
|
|
385
|
+
options=make_request_options(
|
|
386
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
387
|
+
),
|
|
388
|
+
cast_to=ReportCitationsResponse,
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
async def sentiment(
|
|
392
|
+
self,
|
|
393
|
+
*,
|
|
394
|
+
category_id: str,
|
|
395
|
+
end_date: Union[str, datetime],
|
|
396
|
+
metrics: List[Literal["positive", "negative"]],
|
|
397
|
+
start_date: Union[str, datetime],
|
|
398
|
+
date_interval: Literal["day", "week", "month", "year"] | Omit = omit,
|
|
399
|
+
dimensions: List[Literal["theme", "date", "region", "topic", "model", "asset_name", "tag"]] | Omit = omit,
|
|
400
|
+
filters: Iterable[report_sentiment_params.Filter] | Omit = omit,
|
|
401
|
+
order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
|
|
402
|
+
pagination: PaginationParam | Omit = omit,
|
|
403
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
404
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
405
|
+
extra_headers: Headers | None = None,
|
|
406
|
+
extra_query: Query | None = None,
|
|
407
|
+
extra_body: Body | None = None,
|
|
408
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
409
|
+
) -> Response:
|
|
410
|
+
"""Get citations for a given category.
|
|
411
|
+
|
|
412
|
+
Args:
|
|
413
|
+
end_date: End date for the report.
|
|
414
|
+
|
|
415
|
+
Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full
|
|
416
|
+
ISO timestamp.
|
|
417
|
+
|
|
418
|
+
start_date: Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or
|
|
419
|
+
full ISO timestamp.
|
|
420
|
+
|
|
421
|
+
date_interval: Date interval for the report. (only used with date dimension)
|
|
422
|
+
|
|
423
|
+
dimensions: Dimensions to group the report by.
|
|
424
|
+
|
|
425
|
+
filters: List of filters to apply to the report. Each filter has an operator, field, and
|
|
426
|
+
value.
|
|
427
|
+
|
|
428
|
+
order_by: Custom ordering of the report results.
|
|
429
|
+
|
|
430
|
+
The order is a record of key-value pairs where:
|
|
431
|
+
|
|
432
|
+
- key is the field to order by, which can be a metric or dimension
|
|
433
|
+
- value is the direction of the order, either 'asc' for ascending or 'desc' for
|
|
434
|
+
descending.
|
|
435
|
+
|
|
436
|
+
When not specified, the default order is the first metric in the query
|
|
437
|
+
descending.
|
|
438
|
+
|
|
439
|
+
pagination: Pagination settings for the report results.
|
|
440
|
+
|
|
441
|
+
extra_headers: Send extra headers
|
|
442
|
+
|
|
443
|
+
extra_query: Add additional query parameters to the request
|
|
444
|
+
|
|
445
|
+
extra_body: Add additional JSON properties to the request
|
|
446
|
+
|
|
447
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
448
|
+
"""
|
|
449
|
+
return await self._post(
|
|
450
|
+
"/v1/reports/sentiment",
|
|
451
|
+
body=await async_maybe_transform(
|
|
452
|
+
{
|
|
453
|
+
"category_id": category_id,
|
|
454
|
+
"end_date": end_date,
|
|
455
|
+
"metrics": metrics,
|
|
456
|
+
"start_date": start_date,
|
|
457
|
+
"date_interval": date_interval,
|
|
458
|
+
"dimensions": dimensions,
|
|
459
|
+
"filters": filters,
|
|
460
|
+
"order_by": order_by,
|
|
461
|
+
"pagination": pagination,
|
|
462
|
+
},
|
|
463
|
+
report_sentiment_params.ReportSentimentParams,
|
|
464
|
+
),
|
|
465
|
+
options=make_request_options(
|
|
466
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
467
|
+
),
|
|
468
|
+
cast_to=Response,
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
async def visibility(
|
|
472
|
+
self,
|
|
473
|
+
*,
|
|
474
|
+
category_id: str,
|
|
475
|
+
end_date: Union[str, datetime],
|
|
476
|
+
metrics: List[Literal["share_of_voice", "mentions_count", "visibility_score"]],
|
|
477
|
+
start_date: Union[str, datetime],
|
|
478
|
+
date_interval: Literal["day", "week", "month", "year"] | Omit = omit,
|
|
479
|
+
dimensions: List[Literal["date", "region", "topic", "model", "asset_name", "prompt", "tag"]] | Omit = omit,
|
|
480
|
+
filters: Iterable[report_visibility_params.Filter] | Omit = omit,
|
|
481
|
+
order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
|
|
482
|
+
pagination: PaginationParam | Omit = omit,
|
|
483
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
484
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
485
|
+
extra_headers: Headers | None = None,
|
|
486
|
+
extra_query: Query | None = None,
|
|
487
|
+
extra_body: Body | None = None,
|
|
488
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
489
|
+
) -> Response:
|
|
490
|
+
"""Query visibility report.
|
|
491
|
+
|
|
492
|
+
Args:
|
|
493
|
+
end_date: End date for the report.
|
|
494
|
+
|
|
495
|
+
Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full
|
|
496
|
+
ISO timestamp.
|
|
497
|
+
|
|
498
|
+
start_date: Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or
|
|
499
|
+
full ISO timestamp.
|
|
500
|
+
|
|
501
|
+
date_interval: Date interval for the report. (only used with date dimension)
|
|
502
|
+
|
|
503
|
+
dimensions: Dimensions to group the report by.
|
|
504
|
+
|
|
505
|
+
filters: List of filters to apply to the report. Each filter has an operator, field, and
|
|
506
|
+
value.
|
|
507
|
+
|
|
508
|
+
order_by: Custom ordering of the report results.
|
|
509
|
+
|
|
510
|
+
The order is a record of key-value pairs where:
|
|
511
|
+
|
|
512
|
+
- key is the field to order by, which can be a metric or dimension
|
|
513
|
+
- value is the direction of the order, either 'asc' for ascending or 'desc' for
|
|
514
|
+
descending.
|
|
515
|
+
|
|
516
|
+
When not specified, the default order is the first metric in the query
|
|
517
|
+
descending.
|
|
518
|
+
|
|
519
|
+
pagination: Pagination settings for the report results.
|
|
520
|
+
|
|
521
|
+
extra_headers: Send extra headers
|
|
522
|
+
|
|
523
|
+
extra_query: Add additional query parameters to the request
|
|
524
|
+
|
|
525
|
+
extra_body: Add additional JSON properties to the request
|
|
526
|
+
|
|
527
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
528
|
+
"""
|
|
529
|
+
return await self._post(
|
|
530
|
+
"/v1/reports/visibility",
|
|
531
|
+
body=await async_maybe_transform(
|
|
532
|
+
{
|
|
533
|
+
"category_id": category_id,
|
|
534
|
+
"end_date": end_date,
|
|
535
|
+
"metrics": metrics,
|
|
536
|
+
"start_date": start_date,
|
|
537
|
+
"date_interval": date_interval,
|
|
538
|
+
"dimensions": dimensions,
|
|
539
|
+
"filters": filters,
|
|
540
|
+
"order_by": order_by,
|
|
541
|
+
"pagination": pagination,
|
|
542
|
+
},
|
|
543
|
+
report_visibility_params.ReportVisibilityParams,
|
|
544
|
+
),
|
|
545
|
+
options=make_request_options(
|
|
546
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
547
|
+
),
|
|
548
|
+
cast_to=Response,
|
|
549
|
+
)
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
class ReportsResourceWithRawResponse:
|
|
553
|
+
def __init__(self, reports: ReportsResource) -> None:
|
|
554
|
+
self._reports = reports
|
|
555
|
+
|
|
556
|
+
self.citations = to_raw_response_wrapper(
|
|
557
|
+
reports.citations,
|
|
558
|
+
)
|
|
559
|
+
self.sentiment = to_raw_response_wrapper(
|
|
560
|
+
reports.sentiment,
|
|
561
|
+
)
|
|
562
|
+
self.visibility = to_raw_response_wrapper(
|
|
563
|
+
reports.visibility,
|
|
564
|
+
)
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
class AsyncReportsResourceWithRawResponse:
|
|
568
|
+
def __init__(self, reports: AsyncReportsResource) -> None:
|
|
569
|
+
self._reports = reports
|
|
570
|
+
|
|
571
|
+
self.citations = async_to_raw_response_wrapper(
|
|
572
|
+
reports.citations,
|
|
573
|
+
)
|
|
574
|
+
self.sentiment = async_to_raw_response_wrapper(
|
|
575
|
+
reports.sentiment,
|
|
576
|
+
)
|
|
577
|
+
self.visibility = async_to_raw_response_wrapper(
|
|
578
|
+
reports.visibility,
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
class ReportsResourceWithStreamingResponse:
|
|
583
|
+
def __init__(self, reports: ReportsResource) -> None:
|
|
584
|
+
self._reports = reports
|
|
585
|
+
|
|
586
|
+
self.citations = to_streamed_response_wrapper(
|
|
587
|
+
reports.citations,
|
|
588
|
+
)
|
|
589
|
+
self.sentiment = to_streamed_response_wrapper(
|
|
590
|
+
reports.sentiment,
|
|
591
|
+
)
|
|
592
|
+
self.visibility = to_streamed_response_wrapper(
|
|
593
|
+
reports.visibility,
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
class AsyncReportsResourceWithStreamingResponse:
|
|
598
|
+
def __init__(self, reports: AsyncReportsResource) -> None:
|
|
599
|
+
self._reports = reports
|
|
600
|
+
|
|
601
|
+
self.citations = async_to_streamed_response_wrapper(
|
|
602
|
+
reports.citations,
|
|
603
|
+
)
|
|
604
|
+
self.sentiment = async_to_streamed_response_wrapper(
|
|
605
|
+
reports.sentiment,
|
|
606
|
+
)
|
|
607
|
+
self.visibility = async_to_streamed_response_wrapper(
|
|
608
|
+
reports.visibility,
|
|
609
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .info import Info as Info
|
|
6
|
+
from .result import Result as Result
|
|
7
|
+
from .response import Response as Response
|
|
8
|
+
from .pagination_param import PaginationParam as PaginationParam
|
|
9
|
+
from .prompt_answers_params import PromptAnswersParams as PromptAnswersParams
|
|
10
|
+
from .prompt_answers_response import PromptAnswersResponse as PromptAnswersResponse
|
|
11
|
+
from .report_citations_params import ReportCitationsParams as ReportCitationsParams
|
|
12
|
+
from .report_sentiment_params import ReportSentimentParams as ReportSentimentParams
|
|
13
|
+
from .report_visibility_params import ReportVisibilityParams as ReportVisibilityParams
|
|
14
|
+
from .report_citations_response import ReportCitationsResponse as ReportCitationsResponse
|
|
15
|
+
from .organization_models_response import OrganizationModelsResponse as OrganizationModelsResponse
|
|
16
|
+
from .organization_domains_response import OrganizationDomainsResponse as OrganizationDomainsResponse
|
|
17
|
+
from .organization_regions_response import OrganizationRegionsResponse as OrganizationRegionsResponse
|
profound/types/info.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["Info"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Info(BaseModel):
|
|
11
|
+
total_rows: int
|
|
12
|
+
|
|
13
|
+
query: Optional[Dict[str, object]] = None
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .raw_bots_params import RawBotsParams as RawBotsParams
|
|
6
|
+
from .raw_logs_params import RawLogsParams as RawLogsParams
|
|
7
|
+
from .raw_bots_response import RawBotsResponse as RawBotsResponse
|
|
8
|
+
from .raw_logs_response import RawLogsResponse as RawLogsResponse
|