athena-intelligence 0.1.86__py3-none-any.whl → 0.1.88__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.
- athena/base_client.py +4 -4
- athena/chain/client.py +30 -138
- athena/client.py +57 -19
- athena/core/client_wrapper.py +13 -3
- athena/core/http_client.py +333 -20
- athena/core/remove_none_from_dict.py +2 -2
- athena/dataset/client.py +8 -64
- athena/message/client.py +20 -113
- athena/query/client.py +8 -54
- athena/report/client.py +10 -66
- athena/search/client.py +22 -68
- athena/snippet/client.py +10 -116
- athena/tools/client.py +112 -542
- athena/upload/client.py +2 -58
- athena/workflow/client.py +8 -54
- {athena_intelligence-0.1.86.dist-info → athena_intelligence-0.1.88.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.86.dist-info → athena_intelligence-0.1.88.dist-info}/RECORD +18 -18
- {athena_intelligence-0.1.86.dist-info → athena_intelligence-0.1.88.dist-info}/WHEEL +0 -0
athena/tools/client.py
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
import typing
|
4
|
-
import urllib.parse
|
5
4
|
from json.decoder import JSONDecodeError
|
6
5
|
|
7
6
|
from ..core.api_error import ApiError
|
8
7
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
|
-
from ..core.jsonable_encoder import jsonable_encoder
|
10
8
|
from ..core.pydantic_utilities import pydantic_v1
|
11
|
-
from ..core.query_encoder import encode_query
|
12
|
-
from ..core.remove_none_from_dict import remove_none_from_dict
|
13
9
|
from ..core.request_options import RequestOptions
|
14
10
|
from ..errors.internal_server_error import InternalServerError
|
15
11
|
from ..errors.not_found_error import NotFoundError
|
@@ -45,7 +41,7 @@ class ToolsClient:
|
|
45
41
|
*,
|
46
42
|
url: str,
|
47
43
|
params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
48
|
-
request_options: typing.Optional[RequestOptions] = None
|
44
|
+
request_options: typing.Optional[RequestOptions] = None
|
49
45
|
) -> FirecrawlScrapeUrlDataReponseDto:
|
50
46
|
"""
|
51
47
|
Parameters
|
@@ -74,36 +70,12 @@ class ToolsClient:
|
|
74
70
|
params={"key": "value"},
|
75
71
|
)
|
76
72
|
"""
|
77
|
-
_request: typing.Dict[str, typing.Any] = {"url": url}
|
78
|
-
if params is not OMIT:
|
79
|
-
_request["params"] = params
|
80
73
|
_response = self._client_wrapper.httpx_client.request(
|
74
|
+
"api/v0/tools/firecrawl/scrape-url",
|
81
75
|
method="POST",
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
86
|
-
)
|
87
|
-
),
|
88
|
-
json=jsonable_encoder(_request)
|
89
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
90
|
-
else {
|
91
|
-
**jsonable_encoder(_request),
|
92
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
93
|
-
},
|
94
|
-
headers=jsonable_encoder(
|
95
|
-
remove_none_from_dict(
|
96
|
-
{
|
97
|
-
**self._client_wrapper.get_headers(),
|
98
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
99
|
-
}
|
100
|
-
)
|
101
|
-
),
|
102
|
-
timeout=request_options.get("timeout_in_seconds")
|
103
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
104
|
-
else self._client_wrapper.get_timeout(),
|
105
|
-
retries=0,
|
106
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
76
|
+
json={"url": url, "params": params},
|
77
|
+
request_options=request_options,
|
78
|
+
omit=OMIT,
|
107
79
|
)
|
108
80
|
if 200 <= _response.status_code < 300:
|
109
81
|
return pydantic_v1.parse_obj_as(FirecrawlScrapeUrlDataReponseDto, _response.json()) # type: ignore
|
@@ -123,7 +95,7 @@ class ToolsClient:
|
|
123
95
|
document_id: str,
|
124
96
|
pagination_limit: typing.Optional[int] = OMIT,
|
125
97
|
pagination_offset: typing.Optional[int] = OMIT,
|
126
|
-
request_options: typing.Optional[RequestOptions] = None
|
98
|
+
request_options: typing.Optional[RequestOptions] = None
|
127
99
|
) -> LangchainDocumentsRequestOut:
|
128
100
|
"""
|
129
101
|
Parameters
|
@@ -155,40 +127,16 @@ class ToolsClient:
|
|
155
127
|
pagination_offset=0,
|
156
128
|
)
|
157
129
|
"""
|
158
|
-
_request: typing.Dict[str, typing.Any] = {"document_id": document_id}
|
159
|
-
if pagination_limit is not OMIT:
|
160
|
-
_request["pagination_limit"] = pagination_limit
|
161
|
-
if pagination_offset is not OMIT:
|
162
|
-
_request["pagination_offset"] = pagination_offset
|
163
130
|
_response = self._client_wrapper.httpx_client.request(
|
131
|
+
"api/v0/tools/file/langchain-documents",
|
164
132
|
method="POST",
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
jsonable_encoder(
|
170
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
171
|
-
)
|
172
|
-
),
|
173
|
-
json=jsonable_encoder(_request)
|
174
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
175
|
-
else {
|
176
|
-
**jsonable_encoder(_request),
|
177
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
133
|
+
json={
|
134
|
+
"document_id": document_id,
|
135
|
+
"pagination_limit": pagination_limit,
|
136
|
+
"pagination_offset": pagination_offset,
|
178
137
|
},
|
179
|
-
|
180
|
-
|
181
|
-
{
|
182
|
-
**self._client_wrapper.get_headers(),
|
183
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
184
|
-
}
|
185
|
-
)
|
186
|
-
),
|
187
|
-
timeout=request_options.get("timeout_in_seconds")
|
188
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
189
|
-
else self._client_wrapper.get_timeout(),
|
190
|
-
retries=0,
|
191
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
138
|
+
request_options=request_options,
|
139
|
+
omit=OMIT,
|
192
140
|
)
|
193
141
|
if 200 <= _response.status_code < 300:
|
194
142
|
return pydantic_v1.parse_obj_as(LangchainDocumentsRequestOut, _response.json()) # type: ignore
|
@@ -213,7 +161,7 @@ class ToolsClient:
|
|
213
161
|
] = None,
|
214
162
|
sheet_name: typing.Optional[int] = None,
|
215
163
|
separator: typing.Optional[str] = None,
|
216
|
-
request_options: typing.Optional[RequestOptions] = None
|
164
|
+
request_options: typing.Optional[RequestOptions] = None
|
217
165
|
) -> DataFrameRequestOut:
|
218
166
|
"""
|
219
167
|
Parameters
|
@@ -253,40 +201,17 @@ class ToolsClient:
|
|
253
201
|
)
|
254
202
|
"""
|
255
203
|
_response = self._client_wrapper.httpx_client.request(
|
204
|
+
"api/v0/tools/file/data-frame",
|
256
205
|
method="GET",
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
"sheet_name": sheet_name,
|
267
|
-
"separator": separator,
|
268
|
-
**(
|
269
|
-
request_options.get("additional_query_parameters", {})
|
270
|
-
if request_options is not None
|
271
|
-
else {}
|
272
|
-
),
|
273
|
-
}
|
274
|
-
)
|
275
|
-
)
|
276
|
-
),
|
277
|
-
headers=jsonable_encoder(
|
278
|
-
remove_none_from_dict(
|
279
|
-
{
|
280
|
-
**self._client_wrapper.get_headers(),
|
281
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
282
|
-
}
|
283
|
-
)
|
284
|
-
),
|
285
|
-
timeout=request_options.get("timeout_in_seconds")
|
286
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
287
|
-
else self._client_wrapper.get_timeout(),
|
288
|
-
retries=0,
|
289
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
206
|
+
params={
|
207
|
+
"document_id": document_id,
|
208
|
+
"row_limit": row_limit,
|
209
|
+
"index_column": index_column,
|
210
|
+
"columns": columns,
|
211
|
+
"sheet_name": sheet_name,
|
212
|
+
"separator": separator,
|
213
|
+
},
|
214
|
+
request_options=request_options,
|
290
215
|
)
|
291
216
|
if 200 <= _response.status_code < 300:
|
292
217
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
@@ -336,35 +261,10 @@ class ToolsClient:
|
|
336
261
|
)
|
337
262
|
"""
|
338
263
|
with self._client_wrapper.httpx_client.stream(
|
264
|
+
"api/v0/tools/file/raw-data",
|
339
265
|
method="GET",
|
340
|
-
|
341
|
-
|
342
|
-
jsonable_encoder(
|
343
|
-
remove_none_from_dict(
|
344
|
-
{
|
345
|
-
"document_id": document_id,
|
346
|
-
**(
|
347
|
-
request_options.get("additional_query_parameters", {})
|
348
|
-
if request_options is not None
|
349
|
-
else {}
|
350
|
-
),
|
351
|
-
}
|
352
|
-
)
|
353
|
-
)
|
354
|
-
),
|
355
|
-
headers=jsonable_encoder(
|
356
|
-
remove_none_from_dict(
|
357
|
-
{
|
358
|
-
**self._client_wrapper.get_headers(),
|
359
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
360
|
-
}
|
361
|
-
)
|
362
|
-
),
|
363
|
-
timeout=request_options.get("timeout_in_seconds")
|
364
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
365
|
-
else self._client_wrapper.get_timeout(),
|
366
|
-
retries=0,
|
367
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
266
|
+
params={"document_id": document_id},
|
267
|
+
request_options=request_options,
|
368
268
|
) as _response:
|
369
269
|
if 200 <= _response.status_code < 300:
|
370
270
|
for _chunk in _response.iter_bytes():
|
@@ -390,7 +290,7 @@ class ToolsClient:
|
|
390
290
|
content: str,
|
391
291
|
model: typing.Optional[LlmModel] = OMIT,
|
392
292
|
tool_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
393
|
-
request_options: typing.Optional[RequestOptions] = None
|
293
|
+
request_options: typing.Optional[RequestOptions] = None
|
394
294
|
) -> ExcecuteToolFirstWorkflowOut:
|
395
295
|
"""
|
396
296
|
Parameters
|
@@ -426,38 +326,12 @@ class ToolsClient:
|
|
426
326
|
tool_kwargs={"query": "website: www.athenaintelligence.ai"},
|
427
327
|
)
|
428
328
|
"""
|
429
|
-
_request: typing.Dict[str, typing.Any] = {"tool_name": tool_name, "content": content}
|
430
|
-
if model is not OMIT:
|
431
|
-
_request["model"] = model
|
432
|
-
if tool_kwargs is not OMIT:
|
433
|
-
_request["tool_kwargs"] = tool_kwargs
|
434
329
|
_response = self._client_wrapper.httpx_client.request(
|
330
|
+
"api/v0/tools/first-agent",
|
435
331
|
method="POST",
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
440
|
-
)
|
441
|
-
),
|
442
|
-
json=jsonable_encoder(_request)
|
443
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
444
|
-
else {
|
445
|
-
**jsonable_encoder(_request),
|
446
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
447
|
-
},
|
448
|
-
headers=jsonable_encoder(
|
449
|
-
remove_none_from_dict(
|
450
|
-
{
|
451
|
-
**self._client_wrapper.get_headers(),
|
452
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
453
|
-
}
|
454
|
-
)
|
455
|
-
),
|
456
|
-
timeout=request_options.get("timeout_in_seconds")
|
457
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
458
|
-
else self._client_wrapper.get_timeout(),
|
459
|
-
retries=0,
|
460
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
332
|
+
json={"model": model, "tool_name": tool_name, "content": content, "tool_kwargs": tool_kwargs},
|
333
|
+
request_options=request_options,
|
334
|
+
omit=OMIT,
|
461
335
|
)
|
462
336
|
if 200 <= _response.status_code < 300:
|
463
337
|
return pydantic_v1.parse_obj_as(ExcecuteToolFirstWorkflowOut, _response.json()) # type: ignore
|
@@ -480,7 +354,7 @@ class ToolsClient:
|
|
480
354
|
publish_formats: typing.Optional[PublishFormats] = OMIT,
|
481
355
|
source: typing.Optional[str] = OMIT,
|
482
356
|
athena_document_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
483
|
-
request_options: typing.Optional[RequestOptions] = None
|
357
|
+
request_options: typing.Optional[RequestOptions] = None
|
484
358
|
) -> ResearcherOut:
|
485
359
|
"""
|
486
360
|
Parameters
|
@@ -530,44 +404,19 @@ class ToolsClient:
|
|
530
404
|
athena_document_ids=["doc_1", "doc_2"],
|
531
405
|
)
|
532
406
|
"""
|
533
|
-
_request: typing.Dict[str, typing.Any] = {
|
534
|
-
"query": query,
|
535
|
-
"max_sections": max_sections,
|
536
|
-
"guidelines": guidelines,
|
537
|
-
}
|
538
|
-
if publish_formats is not OMIT:
|
539
|
-
_request["publish_formats"] = publish_formats
|
540
|
-
if source is not OMIT:
|
541
|
-
_request["source"] = source
|
542
|
-
if athena_document_ids is not OMIT:
|
543
|
-
_request["athena_document_ids"] = athena_document_ids
|
544
407
|
_response = self._client_wrapper.httpx_client.request(
|
408
|
+
"api/v0/tools/researcher",
|
545
409
|
method="POST",
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
554
|
-
else {
|
555
|
-
**jsonable_encoder(_request),
|
556
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
410
|
+
json={
|
411
|
+
"query": query,
|
412
|
+
"max_sections": max_sections,
|
413
|
+
"guidelines": guidelines,
|
414
|
+
"publish_formats": publish_formats,
|
415
|
+
"source": source,
|
416
|
+
"athena_document_ids": athena_document_ids,
|
557
417
|
},
|
558
|
-
|
559
|
-
|
560
|
-
{
|
561
|
-
**self._client_wrapper.get_headers(),
|
562
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
563
|
-
}
|
564
|
-
)
|
565
|
-
),
|
566
|
-
timeout=request_options.get("timeout_in_seconds")
|
567
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
568
|
-
else self._client_wrapper.get_timeout(),
|
569
|
-
retries=0,
|
570
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
418
|
+
request_options=request_options,
|
419
|
+
omit=OMIT,
|
571
420
|
)
|
572
421
|
if 200 <= _response.status_code < 300:
|
573
422
|
return pydantic_v1.parse_obj_as(ResearcherOut, _response.json()) # type: ignore
|
@@ -609,32 +458,11 @@ class ToolsClient:
|
|
609
458
|
)
|
610
459
|
"""
|
611
460
|
_response = self._client_wrapper.httpx_client.request(
|
461
|
+
"api/v0/tools/convert-pdf-to-sheet",
|
612
462
|
method="POST",
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
617
|
-
)
|
618
|
-
),
|
619
|
-
json=jsonable_encoder({"document_id": document_id})
|
620
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
621
|
-
else {
|
622
|
-
**jsonable_encoder({"document_id": document_id}),
|
623
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
624
|
-
},
|
625
|
-
headers=jsonable_encoder(
|
626
|
-
remove_none_from_dict(
|
627
|
-
{
|
628
|
-
**self._client_wrapper.get_headers(),
|
629
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
630
|
-
}
|
631
|
-
)
|
632
|
-
),
|
633
|
-
timeout=request_options.get("timeout_in_seconds")
|
634
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
635
|
-
else self._client_wrapper.get_timeout(),
|
636
|
-
retries=0,
|
637
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
463
|
+
json={"document_id": document_id},
|
464
|
+
request_options=request_options,
|
465
|
+
omit=OMIT,
|
638
466
|
)
|
639
467
|
if 200 <= _response.status_code < 300:
|
640
468
|
return pydantic_v1.parse_obj_as(ConvertPdfToSheetOut, _response.json()) # type: ignore
|
@@ -653,7 +481,7 @@ class ToolsClient:
|
|
653
481
|
*,
|
654
482
|
query: QueryModel,
|
655
483
|
table_name: typing.Optional[str] = OMIT,
|
656
|
-
request_options: typing.Optional[RequestOptions] = None
|
484
|
+
request_options: typing.Optional[RequestOptions] = None
|
657
485
|
) -> SemanticQueryOut:
|
658
486
|
"""
|
659
487
|
Parameters
|
@@ -699,36 +527,12 @@ class ToolsClient:
|
|
699
527
|
),
|
700
528
|
)
|
701
529
|
"""
|
702
|
-
_request: typing.Dict[str, typing.Any] = {"query": query}
|
703
|
-
if table_name is not OMIT:
|
704
|
-
_request["table_name"] = table_name
|
705
530
|
_response = self._client_wrapper.httpx_client.request(
|
531
|
+
"api/v0/tools/strict-semantic-query",
|
706
532
|
method="POST",
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
711
|
-
)
|
712
|
-
),
|
713
|
-
json=jsonable_encoder(_request)
|
714
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
715
|
-
else {
|
716
|
-
**jsonable_encoder(_request),
|
717
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
718
|
-
},
|
719
|
-
headers=jsonable_encoder(
|
720
|
-
remove_none_from_dict(
|
721
|
-
{
|
722
|
-
**self._client_wrapper.get_headers(),
|
723
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
724
|
-
}
|
725
|
-
)
|
726
|
-
),
|
727
|
-
timeout=request_options.get("timeout_in_seconds")
|
728
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
729
|
-
else self._client_wrapper.get_timeout(),
|
730
|
-
retries=0,
|
731
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
533
|
+
json={"query": query, "table_name": table_name},
|
534
|
+
request_options=request_options,
|
535
|
+
omit=OMIT,
|
732
536
|
)
|
733
537
|
if 200 <= _response.status_code < 300:
|
734
538
|
return pydantic_v1.parse_obj_as(SemanticQueryOut, _response.json()) # type: ignore
|
@@ -770,32 +574,11 @@ class ToolsClient:
|
|
770
574
|
)
|
771
575
|
"""
|
772
576
|
_response = self._client_wrapper.httpx_client.request(
|
577
|
+
"api/v0/tools/athena-document-v2",
|
773
578
|
method="POST",
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
778
|
-
)
|
779
|
-
),
|
780
|
-
json=jsonable_encoder({"document_id": document_id})
|
781
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
782
|
-
else {
|
783
|
-
**jsonable_encoder({"document_id": document_id}),
|
784
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
785
|
-
},
|
786
|
-
headers=jsonable_encoder(
|
787
|
-
remove_none_from_dict(
|
788
|
-
{
|
789
|
-
**self._client_wrapper.get_headers(),
|
790
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
791
|
-
}
|
792
|
-
)
|
793
|
-
),
|
794
|
-
timeout=request_options.get("timeout_in_seconds")
|
795
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
796
|
-
else self._client_wrapper.get_timeout(),
|
797
|
-
retries=0,
|
798
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
579
|
+
json={"document_id": document_id},
|
580
|
+
request_options=request_options,
|
581
|
+
omit=OMIT,
|
799
582
|
)
|
800
583
|
if 200 <= _response.status_code < 300:
|
801
584
|
return pydantic_v1.parse_obj_as(AthenaDocumentV2Out, _response.json()) # type: ignore
|
@@ -819,7 +602,7 @@ class AsyncToolsClient:
|
|
819
602
|
*,
|
820
603
|
url: str,
|
821
604
|
params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
822
|
-
request_options: typing.Optional[RequestOptions] = None
|
605
|
+
request_options: typing.Optional[RequestOptions] = None
|
823
606
|
) -> FirecrawlScrapeUrlDataReponseDto:
|
824
607
|
"""
|
825
608
|
Parameters
|
@@ -848,36 +631,12 @@ class AsyncToolsClient:
|
|
848
631
|
params={"key": "value"},
|
849
632
|
)
|
850
633
|
"""
|
851
|
-
_request: typing.Dict[str, typing.Any] = {"url": url}
|
852
|
-
if params is not OMIT:
|
853
|
-
_request["params"] = params
|
854
634
|
_response = await self._client_wrapper.httpx_client.request(
|
635
|
+
"api/v0/tools/firecrawl/scrape-url",
|
855
636
|
method="POST",
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
860
|
-
)
|
861
|
-
),
|
862
|
-
json=jsonable_encoder(_request)
|
863
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
864
|
-
else {
|
865
|
-
**jsonable_encoder(_request),
|
866
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
867
|
-
},
|
868
|
-
headers=jsonable_encoder(
|
869
|
-
remove_none_from_dict(
|
870
|
-
{
|
871
|
-
**self._client_wrapper.get_headers(),
|
872
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
873
|
-
}
|
874
|
-
)
|
875
|
-
),
|
876
|
-
timeout=request_options.get("timeout_in_seconds")
|
877
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
878
|
-
else self._client_wrapper.get_timeout(),
|
879
|
-
retries=0,
|
880
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
637
|
+
json={"url": url, "params": params},
|
638
|
+
request_options=request_options,
|
639
|
+
omit=OMIT,
|
881
640
|
)
|
882
641
|
if 200 <= _response.status_code < 300:
|
883
642
|
return pydantic_v1.parse_obj_as(FirecrawlScrapeUrlDataReponseDto, _response.json()) # type: ignore
|
@@ -897,7 +656,7 @@ class AsyncToolsClient:
|
|
897
656
|
document_id: str,
|
898
657
|
pagination_limit: typing.Optional[int] = OMIT,
|
899
658
|
pagination_offset: typing.Optional[int] = OMIT,
|
900
|
-
request_options: typing.Optional[RequestOptions] = None
|
659
|
+
request_options: typing.Optional[RequestOptions] = None
|
901
660
|
) -> LangchainDocumentsRequestOut:
|
902
661
|
"""
|
903
662
|
Parameters
|
@@ -929,40 +688,16 @@ class AsyncToolsClient:
|
|
929
688
|
pagination_offset=0,
|
930
689
|
)
|
931
690
|
"""
|
932
|
-
_request: typing.Dict[str, typing.Any] = {"document_id": document_id}
|
933
|
-
if pagination_limit is not OMIT:
|
934
|
-
_request["pagination_limit"] = pagination_limit
|
935
|
-
if pagination_offset is not OMIT:
|
936
|
-
_request["pagination_offset"] = pagination_offset
|
937
691
|
_response = await self._client_wrapper.httpx_client.request(
|
692
|
+
"api/v0/tools/file/langchain-documents",
|
938
693
|
method="POST",
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
jsonable_encoder(
|
944
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
945
|
-
)
|
946
|
-
),
|
947
|
-
json=jsonable_encoder(_request)
|
948
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
949
|
-
else {
|
950
|
-
**jsonable_encoder(_request),
|
951
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
694
|
+
json={
|
695
|
+
"document_id": document_id,
|
696
|
+
"pagination_limit": pagination_limit,
|
697
|
+
"pagination_offset": pagination_offset,
|
952
698
|
},
|
953
|
-
|
954
|
-
|
955
|
-
{
|
956
|
-
**self._client_wrapper.get_headers(),
|
957
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
958
|
-
}
|
959
|
-
)
|
960
|
-
),
|
961
|
-
timeout=request_options.get("timeout_in_seconds")
|
962
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
963
|
-
else self._client_wrapper.get_timeout(),
|
964
|
-
retries=0,
|
965
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
699
|
+
request_options=request_options,
|
700
|
+
omit=OMIT,
|
966
701
|
)
|
967
702
|
if 200 <= _response.status_code < 300:
|
968
703
|
return pydantic_v1.parse_obj_as(LangchainDocumentsRequestOut, _response.json()) # type: ignore
|
@@ -987,7 +722,7 @@ class AsyncToolsClient:
|
|
987
722
|
] = None,
|
988
723
|
sheet_name: typing.Optional[int] = None,
|
989
724
|
separator: typing.Optional[str] = None,
|
990
|
-
request_options: typing.Optional[RequestOptions] = None
|
725
|
+
request_options: typing.Optional[RequestOptions] = None
|
991
726
|
) -> DataFrameRequestOut:
|
992
727
|
"""
|
993
728
|
Parameters
|
@@ -1027,40 +762,17 @@ class AsyncToolsClient:
|
|
1027
762
|
)
|
1028
763
|
"""
|
1029
764
|
_response = await self._client_wrapper.httpx_client.request(
|
765
|
+
"api/v0/tools/file/data-frame",
|
1030
766
|
method="GET",
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
"sheet_name": sheet_name,
|
1041
|
-
"separator": separator,
|
1042
|
-
**(
|
1043
|
-
request_options.get("additional_query_parameters", {})
|
1044
|
-
if request_options is not None
|
1045
|
-
else {}
|
1046
|
-
),
|
1047
|
-
}
|
1048
|
-
)
|
1049
|
-
)
|
1050
|
-
),
|
1051
|
-
headers=jsonable_encoder(
|
1052
|
-
remove_none_from_dict(
|
1053
|
-
{
|
1054
|
-
**self._client_wrapper.get_headers(),
|
1055
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1056
|
-
}
|
1057
|
-
)
|
1058
|
-
),
|
1059
|
-
timeout=request_options.get("timeout_in_seconds")
|
1060
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1061
|
-
else self._client_wrapper.get_timeout(),
|
1062
|
-
retries=0,
|
1063
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
767
|
+
params={
|
768
|
+
"document_id": document_id,
|
769
|
+
"row_limit": row_limit,
|
770
|
+
"index_column": index_column,
|
771
|
+
"columns": columns,
|
772
|
+
"sheet_name": sheet_name,
|
773
|
+
"separator": separator,
|
774
|
+
},
|
775
|
+
request_options=request_options,
|
1064
776
|
)
|
1065
777
|
if 200 <= _response.status_code < 300:
|
1066
778
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
@@ -1110,35 +822,10 @@ class AsyncToolsClient:
|
|
1110
822
|
)
|
1111
823
|
"""
|
1112
824
|
async with self._client_wrapper.httpx_client.stream(
|
825
|
+
"api/v0/tools/file/raw-data",
|
1113
826
|
method="GET",
|
1114
|
-
|
1115
|
-
|
1116
|
-
jsonable_encoder(
|
1117
|
-
remove_none_from_dict(
|
1118
|
-
{
|
1119
|
-
"document_id": document_id,
|
1120
|
-
**(
|
1121
|
-
request_options.get("additional_query_parameters", {})
|
1122
|
-
if request_options is not None
|
1123
|
-
else {}
|
1124
|
-
),
|
1125
|
-
}
|
1126
|
-
)
|
1127
|
-
)
|
1128
|
-
),
|
1129
|
-
headers=jsonable_encoder(
|
1130
|
-
remove_none_from_dict(
|
1131
|
-
{
|
1132
|
-
**self._client_wrapper.get_headers(),
|
1133
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1134
|
-
}
|
1135
|
-
)
|
1136
|
-
),
|
1137
|
-
timeout=request_options.get("timeout_in_seconds")
|
1138
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1139
|
-
else self._client_wrapper.get_timeout(),
|
1140
|
-
retries=0,
|
1141
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
827
|
+
params={"document_id": document_id},
|
828
|
+
request_options=request_options,
|
1142
829
|
) as _response:
|
1143
830
|
if 200 <= _response.status_code < 300:
|
1144
831
|
async for _chunk in _response.aiter_bytes():
|
@@ -1164,7 +851,7 @@ class AsyncToolsClient:
|
|
1164
851
|
content: str,
|
1165
852
|
model: typing.Optional[LlmModel] = OMIT,
|
1166
853
|
tool_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
1167
|
-
request_options: typing.Optional[RequestOptions] = None
|
854
|
+
request_options: typing.Optional[RequestOptions] = None
|
1168
855
|
) -> ExcecuteToolFirstWorkflowOut:
|
1169
856
|
"""
|
1170
857
|
Parameters
|
@@ -1200,38 +887,12 @@ class AsyncToolsClient:
|
|
1200
887
|
tool_kwargs={"query": "website: www.athenaintelligence.ai"},
|
1201
888
|
)
|
1202
889
|
"""
|
1203
|
-
_request: typing.Dict[str, typing.Any] = {"tool_name": tool_name, "content": content}
|
1204
|
-
if model is not OMIT:
|
1205
|
-
_request["model"] = model
|
1206
|
-
if tool_kwargs is not OMIT:
|
1207
|
-
_request["tool_kwargs"] = tool_kwargs
|
1208
890
|
_response = await self._client_wrapper.httpx_client.request(
|
891
|
+
"api/v0/tools/first-agent",
|
1209
892
|
method="POST",
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
1214
|
-
)
|
1215
|
-
),
|
1216
|
-
json=jsonable_encoder(_request)
|
1217
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
1218
|
-
else {
|
1219
|
-
**jsonable_encoder(_request),
|
1220
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
1221
|
-
},
|
1222
|
-
headers=jsonable_encoder(
|
1223
|
-
remove_none_from_dict(
|
1224
|
-
{
|
1225
|
-
**self._client_wrapper.get_headers(),
|
1226
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1227
|
-
}
|
1228
|
-
)
|
1229
|
-
),
|
1230
|
-
timeout=request_options.get("timeout_in_seconds")
|
1231
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1232
|
-
else self._client_wrapper.get_timeout(),
|
1233
|
-
retries=0,
|
1234
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
893
|
+
json={"model": model, "tool_name": tool_name, "content": content, "tool_kwargs": tool_kwargs},
|
894
|
+
request_options=request_options,
|
895
|
+
omit=OMIT,
|
1235
896
|
)
|
1236
897
|
if 200 <= _response.status_code < 300:
|
1237
898
|
return pydantic_v1.parse_obj_as(ExcecuteToolFirstWorkflowOut, _response.json()) # type: ignore
|
@@ -1254,7 +915,7 @@ class AsyncToolsClient:
|
|
1254
915
|
publish_formats: typing.Optional[PublishFormats] = OMIT,
|
1255
916
|
source: typing.Optional[str] = OMIT,
|
1256
917
|
athena_document_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
1257
|
-
request_options: typing.Optional[RequestOptions] = None
|
918
|
+
request_options: typing.Optional[RequestOptions] = None
|
1258
919
|
) -> ResearcherOut:
|
1259
920
|
"""
|
1260
921
|
Parameters
|
@@ -1304,44 +965,19 @@ class AsyncToolsClient:
|
|
1304
965
|
athena_document_ids=["doc_1", "doc_2"],
|
1305
966
|
)
|
1306
967
|
"""
|
1307
|
-
_request: typing.Dict[str, typing.Any] = {
|
1308
|
-
"query": query,
|
1309
|
-
"max_sections": max_sections,
|
1310
|
-
"guidelines": guidelines,
|
1311
|
-
}
|
1312
|
-
if publish_formats is not OMIT:
|
1313
|
-
_request["publish_formats"] = publish_formats
|
1314
|
-
if source is not OMIT:
|
1315
|
-
_request["source"] = source
|
1316
|
-
if athena_document_ids is not OMIT:
|
1317
|
-
_request["athena_document_ids"] = athena_document_ids
|
1318
968
|
_response = await self._client_wrapper.httpx_client.request(
|
969
|
+
"api/v0/tools/researcher",
|
1319
970
|
method="POST",
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
1328
|
-
else {
|
1329
|
-
**jsonable_encoder(_request),
|
1330
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
971
|
+
json={
|
972
|
+
"query": query,
|
973
|
+
"max_sections": max_sections,
|
974
|
+
"guidelines": guidelines,
|
975
|
+
"publish_formats": publish_formats,
|
976
|
+
"source": source,
|
977
|
+
"athena_document_ids": athena_document_ids,
|
1331
978
|
},
|
1332
|
-
|
1333
|
-
|
1334
|
-
{
|
1335
|
-
**self._client_wrapper.get_headers(),
|
1336
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1337
|
-
}
|
1338
|
-
)
|
1339
|
-
),
|
1340
|
-
timeout=request_options.get("timeout_in_seconds")
|
1341
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1342
|
-
else self._client_wrapper.get_timeout(),
|
1343
|
-
retries=0,
|
1344
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
979
|
+
request_options=request_options,
|
980
|
+
omit=OMIT,
|
1345
981
|
)
|
1346
982
|
if 200 <= _response.status_code < 300:
|
1347
983
|
return pydantic_v1.parse_obj_as(ResearcherOut, _response.json()) # type: ignore
|
@@ -1383,32 +1019,11 @@ class AsyncToolsClient:
|
|
1383
1019
|
)
|
1384
1020
|
"""
|
1385
1021
|
_response = await self._client_wrapper.httpx_client.request(
|
1022
|
+
"api/v0/tools/convert-pdf-to-sheet",
|
1386
1023
|
method="POST",
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
1391
|
-
)
|
1392
|
-
),
|
1393
|
-
json=jsonable_encoder({"document_id": document_id})
|
1394
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
1395
|
-
else {
|
1396
|
-
**jsonable_encoder({"document_id": document_id}),
|
1397
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
1398
|
-
},
|
1399
|
-
headers=jsonable_encoder(
|
1400
|
-
remove_none_from_dict(
|
1401
|
-
{
|
1402
|
-
**self._client_wrapper.get_headers(),
|
1403
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1404
|
-
}
|
1405
|
-
)
|
1406
|
-
),
|
1407
|
-
timeout=request_options.get("timeout_in_seconds")
|
1408
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1409
|
-
else self._client_wrapper.get_timeout(),
|
1410
|
-
retries=0,
|
1411
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
1024
|
+
json={"document_id": document_id},
|
1025
|
+
request_options=request_options,
|
1026
|
+
omit=OMIT,
|
1412
1027
|
)
|
1413
1028
|
if 200 <= _response.status_code < 300:
|
1414
1029
|
return pydantic_v1.parse_obj_as(ConvertPdfToSheetOut, _response.json()) # type: ignore
|
@@ -1427,7 +1042,7 @@ class AsyncToolsClient:
|
|
1427
1042
|
*,
|
1428
1043
|
query: QueryModel,
|
1429
1044
|
table_name: typing.Optional[str] = OMIT,
|
1430
|
-
request_options: typing.Optional[RequestOptions] = None
|
1045
|
+
request_options: typing.Optional[RequestOptions] = None
|
1431
1046
|
) -> SemanticQueryOut:
|
1432
1047
|
"""
|
1433
1048
|
Parameters
|
@@ -1473,36 +1088,12 @@ class AsyncToolsClient:
|
|
1473
1088
|
),
|
1474
1089
|
)
|
1475
1090
|
"""
|
1476
|
-
_request: typing.Dict[str, typing.Any] = {"query": query}
|
1477
|
-
if table_name is not OMIT:
|
1478
|
-
_request["table_name"] = table_name
|
1479
1091
|
_response = await self._client_wrapper.httpx_client.request(
|
1092
|
+
"api/v0/tools/strict-semantic-query",
|
1480
1093
|
method="POST",
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
1485
|
-
)
|
1486
|
-
),
|
1487
|
-
json=jsonable_encoder(_request)
|
1488
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
1489
|
-
else {
|
1490
|
-
**jsonable_encoder(_request),
|
1491
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
1492
|
-
},
|
1493
|
-
headers=jsonable_encoder(
|
1494
|
-
remove_none_from_dict(
|
1495
|
-
{
|
1496
|
-
**self._client_wrapper.get_headers(),
|
1497
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1498
|
-
}
|
1499
|
-
)
|
1500
|
-
),
|
1501
|
-
timeout=request_options.get("timeout_in_seconds")
|
1502
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1503
|
-
else self._client_wrapper.get_timeout(),
|
1504
|
-
retries=0,
|
1505
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
1094
|
+
json={"query": query, "table_name": table_name},
|
1095
|
+
request_options=request_options,
|
1096
|
+
omit=OMIT,
|
1506
1097
|
)
|
1507
1098
|
if 200 <= _response.status_code < 300:
|
1508
1099
|
return pydantic_v1.parse_obj_as(SemanticQueryOut, _response.json()) # type: ignore
|
@@ -1544,32 +1135,11 @@ class AsyncToolsClient:
|
|
1544
1135
|
)
|
1545
1136
|
"""
|
1546
1137
|
_response = await self._client_wrapper.httpx_client.request(
|
1138
|
+
"api/v0/tools/athena-document-v2",
|
1547
1139
|
method="POST",
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
1552
|
-
)
|
1553
|
-
),
|
1554
|
-
json=jsonable_encoder({"document_id": document_id})
|
1555
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
1556
|
-
else {
|
1557
|
-
**jsonable_encoder({"document_id": document_id}),
|
1558
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
1559
|
-
},
|
1560
|
-
headers=jsonable_encoder(
|
1561
|
-
remove_none_from_dict(
|
1562
|
-
{
|
1563
|
-
**self._client_wrapper.get_headers(),
|
1564
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1565
|
-
}
|
1566
|
-
)
|
1567
|
-
),
|
1568
|
-
timeout=request_options.get("timeout_in_seconds")
|
1569
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1570
|
-
else self._client_wrapper.get_timeout(),
|
1571
|
-
retries=0,
|
1572
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
1140
|
+
json={"document_id": document_id},
|
1141
|
+
request_options=request_options,
|
1142
|
+
omit=OMIT,
|
1573
1143
|
)
|
1574
1144
|
if 200 <= _response.status_code < 300:
|
1575
1145
|
return pydantic_v1.parse_obj_as(AthenaDocumentV2Out, _response.json()) # type: ignore
|