athena-intelligence 0.1.40__tar.gz → 0.1.41__tar.gz
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.
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/PKG-INFO +1 -1
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/pyproject.toml +1 -1
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/__init__.py +8 -4
- athena_intelligence-0.1.41/src/athena/chain/__init__.py +5 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/chain/client.py +19 -19
- athena_intelligence-0.1.41/src/athena/chain/types/__init__.py +5 -0
- athena_intelligence-0.1.40/src/athena/chain/types/structured_tool_data_parsing_model.py → athena_intelligence-0.1.41/src/athena/chain/types/structured_parse_in_parsing_model.py +10 -10
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/client_wrapper.py +1 -1
- {athena_intelligence-0.1.40/src/athena/tools → athena_intelligence-0.1.41/src/athena/search}/client.py +65 -29
- athena_intelligence-0.1.41/src/athena/tools/client.py +444 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/__init__.py +6 -2
- athena_intelligence-0.1.41/src/athena/types/document.py +34 -0
- athena_intelligence-0.1.40/src/athena/types/scrape_markdown_result.py → athena_intelligence-0.1.41/src/athena/types/excecute_tool_first_workflow_out.py +2 -2
- athena_intelligence-0.1.41/src/athena/types/langchain_documents_request_out.py +29 -0
- athena_intelligence-0.1.40/src/athena/chain/__init__.py +0 -5
- athena_intelligence-0.1.40/src/athena/chain/types/__init__.py +0 -5
- athena_intelligence-0.1.40/src/athena/search/client.py +0 -303
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/README.md +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/base_client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/api_error.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/datetime_utils.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/file.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/http_client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/jsonable_encoder.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/remove_none_from_dict.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/core/request_options.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/dataset/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/dataset/client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/environment.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/errors/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/errors/unprocessable_entity_error.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/message/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/message/client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/polling_message_client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/py.typed +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/query/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/query/client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/report/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/report/client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/search/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/snippet/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/snippet/client.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/tools/__init__.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/dataset.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/firecrawl_scrape_url_data_reponse_dto.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/firecrawl_scrape_url_metadata.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/get_datasets_response.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/get_snippets_response.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/http_validation_error.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/message_out.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/message_out_dto.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/model.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/report.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/snippet.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/sql_results.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/status_enum.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/structured_parse_result.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/tools.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/url_result.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/validation_error.py +0 -0
- {athena_intelligence-0.1.40 → athena_intelligence-0.1.41}/src/athena/types/validation_error_loc_item.py +0 -0
@@ -2,16 +2,18 @@
|
|
2
2
|
|
3
3
|
from .types import (
|
4
4
|
Dataset,
|
5
|
+
Document,
|
6
|
+
ExcecuteToolFirstWorkflowOut,
|
5
7
|
FirecrawlScrapeUrlDataReponseDto,
|
6
8
|
FirecrawlScrapeUrlMetadata,
|
7
9
|
GetDatasetsResponse,
|
8
10
|
GetSnippetsResponse,
|
9
11
|
HttpValidationError,
|
12
|
+
LangchainDocumentsRequestOut,
|
10
13
|
MessageOut,
|
11
14
|
MessageOutDto,
|
12
15
|
Model,
|
13
16
|
Report,
|
14
|
-
ScrapeMarkdownResult,
|
15
17
|
Snippet,
|
16
18
|
SqlResults,
|
17
19
|
StatusEnum,
|
@@ -23,27 +25,29 @@ from .types import (
|
|
23
25
|
)
|
24
26
|
from .errors import UnprocessableEntityError
|
25
27
|
from . import chain, dataset, message, query, report, search, snippet, tools
|
26
|
-
from .chain import
|
28
|
+
from .chain import StructuredParseInParsingModel
|
27
29
|
from .environment import AthenaEnvironment
|
28
30
|
|
29
31
|
__all__ = [
|
30
32
|
"AthenaEnvironment",
|
31
33
|
"Dataset",
|
34
|
+
"Document",
|
35
|
+
"ExcecuteToolFirstWorkflowOut",
|
32
36
|
"FirecrawlScrapeUrlDataReponseDto",
|
33
37
|
"FirecrawlScrapeUrlMetadata",
|
34
38
|
"GetDatasetsResponse",
|
35
39
|
"GetSnippetsResponse",
|
36
40
|
"HttpValidationError",
|
41
|
+
"LangchainDocumentsRequestOut",
|
37
42
|
"MessageOut",
|
38
43
|
"MessageOutDto",
|
39
44
|
"Model",
|
40
45
|
"Report",
|
41
|
-
"ScrapeMarkdownResult",
|
42
46
|
"Snippet",
|
43
47
|
"SqlResults",
|
44
48
|
"StatusEnum",
|
49
|
+
"StructuredParseInParsingModel",
|
45
50
|
"StructuredParseResult",
|
46
|
-
"StructuredToolDataParsingModel",
|
47
51
|
"Tools",
|
48
52
|
"UnprocessableEntityError",
|
49
53
|
"UrlResult",
|
@@ -12,7 +12,7 @@ from ..core.request_options import RequestOptions
|
|
12
12
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
13
13
|
from ..types.http_validation_error import HttpValidationError
|
14
14
|
from ..types.structured_parse_result import StructuredParseResult
|
15
|
-
from .types.
|
15
|
+
from .types.structured_parse_in_parsing_model import StructuredParseInParsingModel
|
16
16
|
|
17
17
|
try:
|
18
18
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -32,7 +32,7 @@ class ChainClient:
|
|
32
32
|
*,
|
33
33
|
text_input: str,
|
34
34
|
custom_type_dict: typing.Dict[str, typing.Any],
|
35
|
-
parsing_model: typing.Optional[
|
35
|
+
parsing_model: typing.Optional[StructuredParseInParsingModel] = OMIT,
|
36
36
|
request_options: typing.Optional[RequestOptions] = None,
|
37
37
|
) -> StructuredParseResult:
|
38
38
|
"""
|
@@ -41,19 +41,19 @@ class ChainClient:
|
|
41
41
|
|
42
42
|
- custom_type_dict: typing.Dict[str, typing.Any]. A dictionary of field names and their default values.
|
43
43
|
|
44
|
-
- parsing_model: typing.Optional[
|
44
|
+
- parsing_model: typing.Optional[StructuredParseInParsingModel]. The model to be used for parsing.
|
45
45
|
|
46
46
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
47
47
|
---
|
48
|
+
from athena import StructuredParseInParsingModel
|
48
49
|
from athena.client import Athena
|
49
50
|
|
50
|
-
client = Athena(
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
)
|
51
|
+
client = Athena(api_key="YOUR_API_KEY", )
|
52
|
+
client.chain.structured_parse(text_input='Athena is an AI-native analytics platform and artificial employee built to accelerate analytics workflows
|
53
|
+
by offering enterprise teams co-pilot and auto-pilot modes. Athena learns your workflow as a co-pilot,
|
54
|
+
allowing you to hand over controls to her for autonomous execution with confidence."
|
55
|
+
|
56
|
+
Give me all of the modes Athena provides.', custom_type_dict={"modes": {}}, parsing_model=StructuredParseInParsingModel.GPT_4_TURBO, )
|
57
57
|
"""
|
58
58
|
_request: typing.Dict[str, typing.Any] = {"text_input": text_input, "custom_type_dict": custom_type_dict}
|
59
59
|
if parsing_model is not OMIT:
|
@@ -104,7 +104,7 @@ class AsyncChainClient:
|
|
104
104
|
*,
|
105
105
|
text_input: str,
|
106
106
|
custom_type_dict: typing.Dict[str, typing.Any],
|
107
|
-
parsing_model: typing.Optional[
|
107
|
+
parsing_model: typing.Optional[StructuredParseInParsingModel] = OMIT,
|
108
108
|
request_options: typing.Optional[RequestOptions] = None,
|
109
109
|
) -> StructuredParseResult:
|
110
110
|
"""
|
@@ -113,19 +113,19 @@ class AsyncChainClient:
|
|
113
113
|
|
114
114
|
- custom_type_dict: typing.Dict[str, typing.Any]. A dictionary of field names and their default values.
|
115
115
|
|
116
|
-
- parsing_model: typing.Optional[
|
116
|
+
- parsing_model: typing.Optional[StructuredParseInParsingModel]. The model to be used for parsing.
|
117
117
|
|
118
118
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
119
119
|
---
|
120
|
+
from athena import StructuredParseInParsingModel
|
120
121
|
from athena.client import AsyncAthena
|
121
122
|
|
122
|
-
client = AsyncAthena(
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
)
|
123
|
+
client = AsyncAthena(api_key="YOUR_API_KEY", )
|
124
|
+
await client.chain.structured_parse(text_input='Athena is an AI-native analytics platform and artificial employee built to accelerate analytics workflows
|
125
|
+
by offering enterprise teams co-pilot and auto-pilot modes. Athena learns your workflow as a co-pilot,
|
126
|
+
allowing you to hand over controls to her for autonomous execution with confidence."
|
127
|
+
|
128
|
+
Give me all of the modes Athena provides.', custom_type_dict={"modes": {}}, parsing_model=StructuredParseInParsingModel.GPT_4_TURBO, )
|
129
129
|
"""
|
130
130
|
_request: typing.Dict[str, typing.Any] = {"text_input": text_input, "custom_type_dict": custom_type_dict}
|
131
131
|
if parsing_model is not OMIT:
|
@@ -6,7 +6,7 @@ import typing
|
|
6
6
|
T_Result = typing.TypeVar("T_Result")
|
7
7
|
|
8
8
|
|
9
|
-
class
|
9
|
+
class StructuredParseInParsingModel(str, enum.Enum):
|
10
10
|
"""
|
11
11
|
The model to be used for parsing.
|
12
12
|
"""
|
@@ -33,21 +33,21 @@ class StructuredToolDataParsingModel(str, enum.Enum):
|
|
33
33
|
claude_3_sonnet_20240229: typing.Callable[[], T_Result],
|
34
34
|
claude_3_haiku_20240307: typing.Callable[[], T_Result],
|
35
35
|
) -> T_Result:
|
36
|
-
if self is
|
36
|
+
if self is StructuredParseInParsingModel.GPT_4_TURBO:
|
37
37
|
return gpt_4_turbo()
|
38
|
-
if self is
|
38
|
+
if self is StructuredParseInParsingModel.GPT_4_TURBO_PREVIEW:
|
39
39
|
return gpt_4_turbo_preview()
|
40
|
-
if self is
|
40
|
+
if self is StructuredParseInParsingModel.GPT_4:
|
41
41
|
return gpt_4()
|
42
|
-
if self is
|
42
|
+
if self is StructuredParseInParsingModel.GPT_35_TURBO:
|
43
43
|
return gpt_35_turbo()
|
44
|
-
if self is
|
44
|
+
if self is StructuredParseInParsingModel.MIXTRAL_SMALL_8_X_7_B_0211:
|
45
45
|
return mixtral_small_8_x_7_b_0211()
|
46
|
-
if self is
|
46
|
+
if self is StructuredParseInParsingModel.MISTRAL_LARGE_0224:
|
47
47
|
return mistral_large_0224()
|
48
|
-
if self is
|
48
|
+
if self is StructuredParseInParsingModel.CLAUDE_3_OPUS_20240229:
|
49
49
|
return claude_3_opus_20240229()
|
50
|
-
if self is
|
50
|
+
if self is StructuredParseInParsingModel.CLAUDE_3_SONNET_20240229:
|
51
51
|
return claude_3_sonnet_20240229()
|
52
|
-
if self is
|
52
|
+
if self is StructuredParseInParsingModel.CLAUDE_3_HAIKU_20240307:
|
53
53
|
return claude_3_haiku_20240307()
|
@@ -16,7 +16,7 @@ class BaseClientWrapper:
|
|
16
16
|
headers: typing.Dict[str, str] = {
|
17
17
|
"X-Fern-Language": "Python",
|
18
18
|
"X-Fern-SDK-Name": "athena-intelligence",
|
19
|
-
"X-Fern-SDK-Version": "0.1.
|
19
|
+
"X-Fern-SDK-Version": "0.1.41",
|
20
20
|
}
|
21
21
|
headers["X-API-KEY"] = self.api_key
|
22
22
|
return headers
|
@@ -10,8 +10,8 @@ from ..core.jsonable_encoder import jsonable_encoder
|
|
10
10
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
11
11
|
from ..core.request_options import RequestOptions
|
12
12
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
13
|
-
from ..types.firecrawl_scrape_url_data_reponse_dto import FirecrawlScrapeUrlDataReponseDto
|
14
13
|
from ..types.http_validation_error import HttpValidationError
|
14
|
+
from ..types.url_result import UrlResult
|
15
15
|
|
16
16
|
try:
|
17
17
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -22,22 +22,34 @@ except ImportError:
|
|
22
22
|
OMIT = typing.cast(typing.Any, ...)
|
23
23
|
|
24
24
|
|
25
|
-
class
|
25
|
+
class SearchClient:
|
26
26
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
27
27
|
self._client_wrapper = client_wrapper
|
28
28
|
|
29
|
-
def
|
29
|
+
def get_urls(
|
30
30
|
self,
|
31
31
|
*,
|
32
|
-
|
33
|
-
|
32
|
+
query: str,
|
33
|
+
num_urls: int,
|
34
|
+
tbs: str,
|
35
|
+
country_code: typing.Optional[str] = OMIT,
|
36
|
+
country_restrict: typing.Optional[str] = OMIT,
|
37
|
+
site: typing.Optional[str] = OMIT,
|
34
38
|
request_options: typing.Optional[RequestOptions] = None,
|
35
|
-
) ->
|
39
|
+
) -> UrlResult:
|
36
40
|
"""
|
37
41
|
Parameters:
|
38
|
-
-
|
42
|
+
- query: str.
|
39
43
|
|
40
|
-
-
|
44
|
+
- num_urls: int.
|
45
|
+
|
46
|
+
- tbs: str.
|
47
|
+
|
48
|
+
- country_code: typing.Optional[str].
|
49
|
+
|
50
|
+
- country_restrict: typing.Optional[str].
|
51
|
+
|
52
|
+
- site: typing.Optional[str].
|
41
53
|
|
42
54
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
43
55
|
---
|
@@ -46,16 +58,22 @@ class ToolsClient:
|
|
46
58
|
client = Athena(
|
47
59
|
api_key="YOUR_API_KEY",
|
48
60
|
)
|
49
|
-
client.
|
50
|
-
|
61
|
+
client.search.get_urls(
|
62
|
+
query="Dogs",
|
63
|
+
num_urls=10,
|
64
|
+
tbs="qdr:m",
|
51
65
|
)
|
52
66
|
"""
|
53
|
-
_request: typing.Dict[str, typing.Any] = {"
|
54
|
-
if
|
55
|
-
_request["
|
67
|
+
_request: typing.Dict[str, typing.Any] = {"query": query, "num_urls": num_urls, "tbs": tbs}
|
68
|
+
if country_code is not OMIT:
|
69
|
+
_request["country_code"] = country_code
|
70
|
+
if country_restrict is not OMIT:
|
71
|
+
_request["country_restrict"] = country_restrict
|
72
|
+
if site is not OMIT:
|
73
|
+
_request["site"] = site
|
56
74
|
_response = self._client_wrapper.httpx_client.request(
|
57
75
|
"POST",
|
58
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/
|
76
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/search/get-urls"),
|
59
77
|
params=jsonable_encoder(
|
60
78
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
61
79
|
),
|
@@ -80,7 +98,7 @@ class ToolsClient:
|
|
80
98
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
81
99
|
)
|
82
100
|
if 200 <= _response.status_code < 300:
|
83
|
-
return pydantic.parse_obj_as(
|
101
|
+
return pydantic.parse_obj_as(UrlResult, _response.json()) # type: ignore
|
84
102
|
if _response.status_code == 422:
|
85
103
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
86
104
|
try:
|
@@ -90,22 +108,34 @@ class ToolsClient:
|
|
90
108
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
91
109
|
|
92
110
|
|
93
|
-
class
|
111
|
+
class AsyncSearchClient:
|
94
112
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
95
113
|
self._client_wrapper = client_wrapper
|
96
114
|
|
97
|
-
async def
|
115
|
+
async def get_urls(
|
98
116
|
self,
|
99
117
|
*,
|
100
|
-
|
101
|
-
|
118
|
+
query: str,
|
119
|
+
num_urls: int,
|
120
|
+
tbs: str,
|
121
|
+
country_code: typing.Optional[str] = OMIT,
|
122
|
+
country_restrict: typing.Optional[str] = OMIT,
|
123
|
+
site: typing.Optional[str] = OMIT,
|
102
124
|
request_options: typing.Optional[RequestOptions] = None,
|
103
|
-
) ->
|
125
|
+
) -> UrlResult:
|
104
126
|
"""
|
105
127
|
Parameters:
|
106
|
-
-
|
128
|
+
- query: str.
|
129
|
+
|
130
|
+
- num_urls: int.
|
131
|
+
|
132
|
+
- tbs: str.
|
133
|
+
|
134
|
+
- country_code: typing.Optional[str].
|
135
|
+
|
136
|
+
- country_restrict: typing.Optional[str].
|
107
137
|
|
108
|
-
-
|
138
|
+
- site: typing.Optional[str].
|
109
139
|
|
110
140
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
111
141
|
---
|
@@ -114,16 +144,22 @@ class AsyncToolsClient:
|
|
114
144
|
client = AsyncAthena(
|
115
145
|
api_key="YOUR_API_KEY",
|
116
146
|
)
|
117
|
-
await client.
|
118
|
-
|
147
|
+
await client.search.get_urls(
|
148
|
+
query="Dogs",
|
149
|
+
num_urls=10,
|
150
|
+
tbs="qdr:m",
|
119
151
|
)
|
120
152
|
"""
|
121
|
-
_request: typing.Dict[str, typing.Any] = {"
|
122
|
-
if
|
123
|
-
_request["
|
153
|
+
_request: typing.Dict[str, typing.Any] = {"query": query, "num_urls": num_urls, "tbs": tbs}
|
154
|
+
if country_code is not OMIT:
|
155
|
+
_request["country_code"] = country_code
|
156
|
+
if country_restrict is not OMIT:
|
157
|
+
_request["country_restrict"] = country_restrict
|
158
|
+
if site is not OMIT:
|
159
|
+
_request["site"] = site
|
124
160
|
_response = await self._client_wrapper.httpx_client.request(
|
125
161
|
"POST",
|
126
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/
|
162
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/search/get-urls"),
|
127
163
|
params=jsonable_encoder(
|
128
164
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
129
165
|
),
|
@@ -148,7 +184,7 @@ class AsyncToolsClient:
|
|
148
184
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
149
185
|
)
|
150
186
|
if 200 <= _response.status_code < 300:
|
151
|
-
return pydantic.parse_obj_as(
|
187
|
+
return pydantic.parse_obj_as(UrlResult, _response.json()) # type: ignore
|
152
188
|
if _response.status_code == 422:
|
153
189
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
154
190
|
try:
|