knowledge2 0.4.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.
- knowledge2-0.4.0.dist-info/METADATA +556 -0
- knowledge2-0.4.0.dist-info/RECORD +139 -0
- knowledge2-0.4.0.dist-info/WHEEL +5 -0
- knowledge2-0.4.0.dist-info/top_level.txt +1 -0
- sdk/__init__.py +70 -0
- sdk/_async_base.py +525 -0
- sdk/_async_paging.py +57 -0
- sdk/_base.py +541 -0
- sdk/_logging.py +41 -0
- sdk/_paging.py +73 -0
- sdk/_preview.py +70 -0
- sdk/_raw_response.py +25 -0
- sdk/_request_options.py +51 -0
- sdk/_transport.py +144 -0
- sdk/_validation.py +25 -0
- sdk/_validation_response.py +36 -0
- sdk/_version.py +3 -0
- sdk/async_client.py +320 -0
- sdk/async_resources/__init__.py +45 -0
- sdk/async_resources/_mixin_base.py +42 -0
- sdk/async_resources/a2a.py +230 -0
- sdk/async_resources/agents.py +489 -0
- sdk/async_resources/audit.py +145 -0
- sdk/async_resources/auth.py +133 -0
- sdk/async_resources/console.py +409 -0
- sdk/async_resources/corpora.py +276 -0
- sdk/async_resources/deployments.py +106 -0
- sdk/async_resources/documents.py +592 -0
- sdk/async_resources/feeds.py +248 -0
- sdk/async_resources/indexes.py +208 -0
- sdk/async_resources/jobs.py +165 -0
- sdk/async_resources/metadata.py +48 -0
- sdk/async_resources/models.py +102 -0
- sdk/async_resources/onboarding.py +538 -0
- sdk/async_resources/orgs.py +37 -0
- sdk/async_resources/pipelines.py +523 -0
- sdk/async_resources/projects.py +90 -0
- sdk/async_resources/search.py +262 -0
- sdk/async_resources/training.py +357 -0
- sdk/async_resources/usage.py +91 -0
- sdk/client.py +417 -0
- sdk/config.py +182 -0
- sdk/errors.py +178 -0
- sdk/examples/auth_factory.py +34 -0
- sdk/examples/batch_operations.py +57 -0
- sdk/examples/document_upload.py +56 -0
- sdk/examples/e2e_lifecycle.py +213 -0
- sdk/examples/error_handling.py +61 -0
- sdk/examples/pagination.py +64 -0
- sdk/examples/quickstart.py +36 -0
- sdk/examples/request_options.py +44 -0
- sdk/examples/search.py +64 -0
- sdk/integrations/__init__.py +57 -0
- sdk/integrations/_client.py +101 -0
- sdk/integrations/langchain/__init__.py +6 -0
- sdk/integrations/langchain/retriever.py +166 -0
- sdk/integrations/langchain/tools.py +108 -0
- sdk/integrations/llamaindex/__init__.py +11 -0
- sdk/integrations/llamaindex/filters.py +78 -0
- sdk/integrations/llamaindex/retriever.py +162 -0
- sdk/integrations/llamaindex/tools.py +109 -0
- sdk/integrations/llamaindex/vector_store.py +320 -0
- sdk/models/__init__.py +18 -0
- sdk/models/_base.py +24 -0
- sdk/models/_registry.py +457 -0
- sdk/models/a2a.py +92 -0
- sdk/models/agents.py +109 -0
- sdk/models/audit.py +28 -0
- sdk/models/auth.py +49 -0
- sdk/models/chunks.py +20 -0
- sdk/models/common.py +14 -0
- sdk/models/console.py +103 -0
- sdk/models/corpora.py +48 -0
- sdk/models/deployments.py +13 -0
- sdk/models/documents.py +126 -0
- sdk/models/embeddings.py +24 -0
- sdk/models/evaluation.py +17 -0
- sdk/models/feedback.py +9 -0
- sdk/models/feeds.py +57 -0
- sdk/models/indexes.py +36 -0
- sdk/models/jobs.py +52 -0
- sdk/models/models.py +26 -0
- sdk/models/onboarding.py +323 -0
- sdk/models/orgs.py +11 -0
- sdk/models/pipelines.py +147 -0
- sdk/models/projects.py +19 -0
- sdk/models/search.py +149 -0
- sdk/models/training.py +57 -0
- sdk/models/usage.py +39 -0
- sdk/namespaces.py +386 -0
- sdk/py.typed +0 -0
- sdk/resources/__init__.py +45 -0
- sdk/resources/_mixin_base.py +40 -0
- sdk/resources/a2a.py +230 -0
- sdk/resources/agents.py +487 -0
- sdk/resources/audit.py +144 -0
- sdk/resources/auth.py +138 -0
- sdk/resources/console.py +411 -0
- sdk/resources/corpora.py +269 -0
- sdk/resources/deployments.py +105 -0
- sdk/resources/documents.py +597 -0
- sdk/resources/feeds.py +246 -0
- sdk/resources/indexes.py +210 -0
- sdk/resources/jobs.py +164 -0
- sdk/resources/metadata.py +53 -0
- sdk/resources/models.py +99 -0
- sdk/resources/onboarding.py +542 -0
- sdk/resources/orgs.py +35 -0
- sdk/resources/pipeline_builder.py +257 -0
- sdk/resources/pipelines.py +520 -0
- sdk/resources/projects.py +87 -0
- sdk/resources/search.py +277 -0
- sdk/resources/training.py +358 -0
- sdk/resources/usage.py +92 -0
- sdk/types/__init__.py +366 -0
- sdk/types/a2a.py +88 -0
- sdk/types/agents.py +133 -0
- sdk/types/audit.py +26 -0
- sdk/types/auth.py +45 -0
- sdk/types/chunks.py +18 -0
- sdk/types/common.py +10 -0
- sdk/types/console.py +99 -0
- sdk/types/corpora.py +42 -0
- sdk/types/deployments.py +11 -0
- sdk/types/documents.py +104 -0
- sdk/types/embeddings.py +22 -0
- sdk/types/evaluation.py +15 -0
- sdk/types/feedback.py +7 -0
- sdk/types/feeds.py +61 -0
- sdk/types/indexes.py +30 -0
- sdk/types/jobs.py +50 -0
- sdk/types/models.py +22 -0
- sdk/types/onboarding.py +395 -0
- sdk/types/orgs.py +9 -0
- sdk/types/pipelines.py +177 -0
- sdk/types/projects.py +14 -0
- sdk/types/search.py +116 -0
- sdk/types/training.py +55 -0
- sdk/types/usage.py +37 -0
sdk/resources/usage.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""Usage metrics resource mixin for the Knowledge2 SDK."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from sdk._request_options import RequestOptions
|
|
8
|
+
from sdk.resources._mixin_base import RequesterMixin
|
|
9
|
+
from sdk.types import UsageByCorpusResponse, UsageByKeyResponse, UsageSummaryResponse
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class UsageMixin(RequesterMixin):
|
|
13
|
+
def usage_summary(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
range_value: str = "7d",
|
|
17
|
+
corpus_id: str | None = None,
|
|
18
|
+
request_options: RequestOptions | None = None,
|
|
19
|
+
) -> UsageSummaryResponse:
|
|
20
|
+
"""Retrieve an aggregate usage summary.
|
|
21
|
+
|
|
22
|
+
.. note:: Requires **bearer token** auth, not an API key.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
range_value: Time range for the summary (e.g. ``"7d"``,
|
|
26
|
+
``"30d"``).
|
|
27
|
+
corpus_id: Optional corpus to scope the summary to.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
Aggregated usage statistics for the requested period.
|
|
31
|
+
|
|
32
|
+
Raises:
|
|
33
|
+
AuthenticationError: If called with an API key instead of a
|
|
34
|
+
bearer token.
|
|
35
|
+
Knowledge2Error: If the API request fails.
|
|
36
|
+
"""
|
|
37
|
+
params: dict[str, Any] = {"range": range_value}
|
|
38
|
+
if corpus_id:
|
|
39
|
+
params["corpus_id"] = corpus_id
|
|
40
|
+
data = self._request(
|
|
41
|
+
"GET", "/v1/usage/summary", params=params, request_options=request_options
|
|
42
|
+
)
|
|
43
|
+
return self._maybe_validate(data, "UsageSummaryResponse")
|
|
44
|
+
|
|
45
|
+
def usage_by_corpus(
|
|
46
|
+
self,
|
|
47
|
+
*,
|
|
48
|
+
range_value: str = "7d",
|
|
49
|
+
request_options: RequestOptions | None = None,
|
|
50
|
+
) -> UsageByCorpusResponse:
|
|
51
|
+
"""Retrieve usage metrics broken down by corpus.
|
|
52
|
+
|
|
53
|
+
.. note:: Requires **bearer token** auth, not an API key.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
range_value: Time range for the breakdown (e.g. ``"7d"``,
|
|
57
|
+
``"30d"``).
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
Per-corpus usage statistics for the requested period.
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
AuthenticationError: If called with an API key instead of a
|
|
64
|
+
bearer token.
|
|
65
|
+
Knowledge2Error: If the API request fails.
|
|
66
|
+
"""
|
|
67
|
+
data = self._request(
|
|
68
|
+
"GET",
|
|
69
|
+
"/v1/usage/by_corpus",
|
|
70
|
+
params={"range": range_value},
|
|
71
|
+
request_options=request_options,
|
|
72
|
+
)
|
|
73
|
+
return self._maybe_validate(data, "UsageByCorpusResponse")
|
|
74
|
+
|
|
75
|
+
def usage_by_key(
|
|
76
|
+
self,
|
|
77
|
+
request_options: RequestOptions | None = None,
|
|
78
|
+
) -> UsageByKeyResponse:
|
|
79
|
+
"""Retrieve usage metrics broken down by API key.
|
|
80
|
+
|
|
81
|
+
.. note:: Requires **bearer token** auth, not an API key.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
Per-key usage statistics.
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
AuthenticationError: If called with an API key instead of a
|
|
88
|
+
bearer token.
|
|
89
|
+
Knowledge2Error: If the API request fails.
|
|
90
|
+
"""
|
|
91
|
+
data = self._request("GET", "/v1/usage/by_key", request_options=request_options)
|
|
92
|
+
return self._maybe_validate(data, "UsageByKeyResponse")
|
sdk/types/__init__.py
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from .a2a import (
|
|
4
|
+
A2AAgentAuthentication,
|
|
5
|
+
A2AAgentCapabilities,
|
|
6
|
+
A2AAgentCardResponse,
|
|
7
|
+
A2AAgentProvider,
|
|
8
|
+
A2AAgentSkill,
|
|
9
|
+
A2AArtifact,
|
|
10
|
+
A2ADataPart,
|
|
11
|
+
A2AJsonRpcError,
|
|
12
|
+
A2AJsonRpcResponse,
|
|
13
|
+
A2ATaskResponse,
|
|
14
|
+
A2ATaskStatus,
|
|
15
|
+
A2ATextPart,
|
|
16
|
+
)
|
|
17
|
+
from .agents import (
|
|
18
|
+
AgentChatResponse,
|
|
19
|
+
AgentListResponse,
|
|
20
|
+
AgentModelInfo,
|
|
21
|
+
AgentModelsResponse,
|
|
22
|
+
AgentResponse,
|
|
23
|
+
AgentRunListItem,
|
|
24
|
+
AgentRunListResponse,
|
|
25
|
+
AgentRunResponse,
|
|
26
|
+
AgentTaskTypesResponse,
|
|
27
|
+
SourceAgentInfo,
|
|
28
|
+
SubscriptionListResponse,
|
|
29
|
+
SubscriptionResponse,
|
|
30
|
+
TaskTypeInfo,
|
|
31
|
+
ToolConfigResponse,
|
|
32
|
+
)
|
|
33
|
+
from .audit import AuditLogActionsResponse, AuditLogItem, AuditLogListResponse
|
|
34
|
+
from .auth import (
|
|
35
|
+
ApiKeyCreateResponse,
|
|
36
|
+
ApiKeyListItem,
|
|
37
|
+
ApiKeyListResponse,
|
|
38
|
+
ApiKeyRevokeResponse,
|
|
39
|
+
ApiKeyRotateResponse,
|
|
40
|
+
WhoAmIResponse,
|
|
41
|
+
)
|
|
42
|
+
from .chunks import ChunkListItem, ChunkListResponse
|
|
43
|
+
from .common import ApiErrorDetail
|
|
44
|
+
from .console import (
|
|
45
|
+
ConsoleBootstrapResponse,
|
|
46
|
+
ConsoleMeResponse,
|
|
47
|
+
ConsoleOrgResponse,
|
|
48
|
+
ConsoleProjectItem,
|
|
49
|
+
ConsoleProjectListResponse,
|
|
50
|
+
ConsoleSummaryResponse,
|
|
51
|
+
InviteAcceptResponse,
|
|
52
|
+
InviteCreateResponse,
|
|
53
|
+
InviteListItem,
|
|
54
|
+
InviteListResponse,
|
|
55
|
+
MemberRemoveResponse,
|
|
56
|
+
MemberUpdateResponse,
|
|
57
|
+
TeamListResponse,
|
|
58
|
+
TeamMember,
|
|
59
|
+
)
|
|
60
|
+
from .corpora import (
|
|
61
|
+
CorpusDeleteResponse,
|
|
62
|
+
CorpusListResponse,
|
|
63
|
+
CorpusResponse,
|
|
64
|
+
CorpusStatusResponse,
|
|
65
|
+
)
|
|
66
|
+
from .deployments import DeploymentResponse
|
|
67
|
+
from .documents import (
|
|
68
|
+
ChunkingConfig,
|
|
69
|
+
DocumentBatchItem,
|
|
70
|
+
DocumentBatchUploadResponse,
|
|
71
|
+
DocumentCreateResponse,
|
|
72
|
+
DocumentDeleteResponse,
|
|
73
|
+
DocumentDetailResponse,
|
|
74
|
+
DocumentListItem,
|
|
75
|
+
DocumentListResponse,
|
|
76
|
+
DocumentManifestIngestResponse,
|
|
77
|
+
DocumentUrlIngestResponse,
|
|
78
|
+
DocumentUrlItem,
|
|
79
|
+
)
|
|
80
|
+
from .embeddings import (
|
|
81
|
+
EmbeddingItem,
|
|
82
|
+
EmbeddingModelInfo,
|
|
83
|
+
EmbeddingModelListResponse,
|
|
84
|
+
EmbeddingsResponse,
|
|
85
|
+
)
|
|
86
|
+
from .evaluation import EvalRunDetailResponse, EvalRunResponse
|
|
87
|
+
from .feedback import FeedbackResponse
|
|
88
|
+
from .feeds import (
|
|
89
|
+
FeedListResponse,
|
|
90
|
+
FeedResponse,
|
|
91
|
+
FeedRunResponse,
|
|
92
|
+
FeedSubscriptionResponse,
|
|
93
|
+
)
|
|
94
|
+
from .indexes import IndexBuildResponse, IndexCompactResponse, IndexStatusResponse
|
|
95
|
+
from .jobs import (
|
|
96
|
+
JobListItem,
|
|
97
|
+
JobListResponse,
|
|
98
|
+
JobResponse,
|
|
99
|
+
JobStatusResponse,
|
|
100
|
+
ReconcileJobsResponse,
|
|
101
|
+
)
|
|
102
|
+
from .models import ModelDeleteResponse, ModelListResponse, ModelResponse
|
|
103
|
+
from .onboarding import (
|
|
104
|
+
DatasetAnalysisDetails,
|
|
105
|
+
DatasetAnalysisRequest,
|
|
106
|
+
DatasetAnalysisResponse,
|
|
107
|
+
DatasetAnalysisSummary,
|
|
108
|
+
DocumentSummaryResponse,
|
|
109
|
+
EvaluationDetails,
|
|
110
|
+
EvaluationListResponse,
|
|
111
|
+
EvaluationMetrics,
|
|
112
|
+
EvaluationReportResponse,
|
|
113
|
+
EvaluationRequest,
|
|
114
|
+
EvaluationResponse,
|
|
115
|
+
EvaluationSummary,
|
|
116
|
+
GoldLabelChunkReference,
|
|
117
|
+
GoldLabelDocumentReference,
|
|
118
|
+
GoldLabelEntry,
|
|
119
|
+
GoldLabelListItem,
|
|
120
|
+
GoldLabelsListResponse,
|
|
121
|
+
GoldLabelsUploadRequest,
|
|
122
|
+
GoldLabelsUploadResponse,
|
|
123
|
+
LexicalStrategy,
|
|
124
|
+
OnboardingStatusResponse,
|
|
125
|
+
ResolvedLabelInfo,
|
|
126
|
+
SearcherPersona,
|
|
127
|
+
SummarizationRequest,
|
|
128
|
+
SummarizationResponse,
|
|
129
|
+
SummarizationStatusResponse,
|
|
130
|
+
SyntheticQueryBatchDetails,
|
|
131
|
+
SyntheticQueryBatchListResponse,
|
|
132
|
+
SyntheticQueryBatchResponse,
|
|
133
|
+
SyntheticQueryBatchSummary,
|
|
134
|
+
SyntheticQueryGenerationRequest,
|
|
135
|
+
SyntheticQuerySample,
|
|
136
|
+
)
|
|
137
|
+
from .orgs import OrgResponse
|
|
138
|
+
from .pipelines import (
|
|
139
|
+
ApplyResult,
|
|
140
|
+
ArchiveResult,
|
|
141
|
+
DraftActivateResult,
|
|
142
|
+
DriftReport,
|
|
143
|
+
DriftSummary,
|
|
144
|
+
DryRunResult,
|
|
145
|
+
EntityDiff,
|
|
146
|
+
FieldDiff,
|
|
147
|
+
GraphEdge,
|
|
148
|
+
GraphNode,
|
|
149
|
+
GraphResponse,
|
|
150
|
+
PipelineSpecListResponse,
|
|
151
|
+
PipelineSpecResponse,
|
|
152
|
+
RefreshChanges,
|
|
153
|
+
RefreshResult,
|
|
154
|
+
SkippedEntity,
|
|
155
|
+
ValidationIssue,
|
|
156
|
+
)
|
|
157
|
+
from .projects import ProjectListResponse, ProjectResponse
|
|
158
|
+
from .search import (
|
|
159
|
+
SearchBatchOptions,
|
|
160
|
+
SearchBatchResponse,
|
|
161
|
+
SearchColdStartMeta,
|
|
162
|
+
SearchGenerateOptions,
|
|
163
|
+
SearchGenerateResponse,
|
|
164
|
+
SearchGenerationConfig,
|
|
165
|
+
SearchHybridConfig,
|
|
166
|
+
SearchMeta,
|
|
167
|
+
SearchOptions,
|
|
168
|
+
SearchRerankConfig,
|
|
169
|
+
SearchResponse,
|
|
170
|
+
SearchResult,
|
|
171
|
+
SearchReturnConfig,
|
|
172
|
+
)
|
|
173
|
+
from .training import (
|
|
174
|
+
CancelTuningRunResponse,
|
|
175
|
+
PromoteResponse,
|
|
176
|
+
TrainingDataBuildResponse,
|
|
177
|
+
TrainingDatasetListResponse,
|
|
178
|
+
TrainingDatasetResponse,
|
|
179
|
+
TuningRunBuildResponse,
|
|
180
|
+
TuningRunDetailResponse,
|
|
181
|
+
TuningRunListResponse,
|
|
182
|
+
TuningRunLogsResponse,
|
|
183
|
+
TuningRunResponse,
|
|
184
|
+
)
|
|
185
|
+
from .usage import (
|
|
186
|
+
UsageByCorpusItem,
|
|
187
|
+
UsageByCorpusResponse,
|
|
188
|
+
UsageByKeyItem,
|
|
189
|
+
UsageByKeyResponse,
|
|
190
|
+
UsageSeriesPoint,
|
|
191
|
+
UsageSummaryResponse,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
__all__ = [
|
|
195
|
+
"A2AAgentAuthentication",
|
|
196
|
+
"A2AAgentCapabilities",
|
|
197
|
+
"A2AAgentCardResponse",
|
|
198
|
+
"A2AAgentProvider",
|
|
199
|
+
"A2AAgentSkill",
|
|
200
|
+
"A2AArtifact",
|
|
201
|
+
"A2ADataPart",
|
|
202
|
+
"A2AJsonRpcError",
|
|
203
|
+
"A2AJsonRpcResponse",
|
|
204
|
+
"A2ATaskResponse",
|
|
205
|
+
"A2ATaskStatus",
|
|
206
|
+
"A2ATextPart",
|
|
207
|
+
"AgentChatResponse",
|
|
208
|
+
"AgentListResponse",
|
|
209
|
+
"AgentModelInfo",
|
|
210
|
+
"AgentModelsResponse",
|
|
211
|
+
"AgentResponse",
|
|
212
|
+
"AgentRunListItem",
|
|
213
|
+
"AgentRunListResponse",
|
|
214
|
+
"AgentRunResponse",
|
|
215
|
+
"AgentTaskTypesResponse",
|
|
216
|
+
"ApiErrorDetail",
|
|
217
|
+
"ApiKeyCreateResponse",
|
|
218
|
+
"ApiKeyListItem",
|
|
219
|
+
"ApiKeyListResponse",
|
|
220
|
+
"ApiKeyRevokeResponse",
|
|
221
|
+
"ApiKeyRotateResponse",
|
|
222
|
+
"ApplyResult",
|
|
223
|
+
"ArchiveResult",
|
|
224
|
+
"AuditLogActionsResponse",
|
|
225
|
+
"AuditLogItem",
|
|
226
|
+
"AuditLogListResponse",
|
|
227
|
+
"CancelTuningRunResponse",
|
|
228
|
+
"ChunkListItem",
|
|
229
|
+
"ChunkListResponse",
|
|
230
|
+
"ChunkingConfig",
|
|
231
|
+
"ConsoleBootstrapResponse",
|
|
232
|
+
"ConsoleMeResponse",
|
|
233
|
+
"ConsoleOrgResponse",
|
|
234
|
+
"ConsoleProjectItem",
|
|
235
|
+
"ConsoleProjectListResponse",
|
|
236
|
+
"ConsoleSummaryResponse",
|
|
237
|
+
"CorpusDeleteResponse",
|
|
238
|
+
"CorpusListResponse",
|
|
239
|
+
"CorpusResponse",
|
|
240
|
+
"CorpusStatusResponse",
|
|
241
|
+
"DatasetAnalysisDetails",
|
|
242
|
+
"DatasetAnalysisRequest",
|
|
243
|
+
"DatasetAnalysisResponse",
|
|
244
|
+
"DatasetAnalysisSummary",
|
|
245
|
+
"DeploymentResponse",
|
|
246
|
+
"DocumentBatchItem",
|
|
247
|
+
"DocumentBatchUploadResponse",
|
|
248
|
+
"DocumentCreateResponse",
|
|
249
|
+
"DocumentDeleteResponse",
|
|
250
|
+
"DocumentDetailResponse",
|
|
251
|
+
"DocumentListItem",
|
|
252
|
+
"DocumentListResponse",
|
|
253
|
+
"DocumentManifestIngestResponse",
|
|
254
|
+
"DocumentSummaryResponse",
|
|
255
|
+
"DocumentUrlIngestResponse",
|
|
256
|
+
"DocumentUrlItem",
|
|
257
|
+
"DraftActivateResult",
|
|
258
|
+
"DriftReport",
|
|
259
|
+
"DriftSummary",
|
|
260
|
+
"DryRunResult",
|
|
261
|
+
"EmbeddingItem",
|
|
262
|
+
"EmbeddingModelInfo",
|
|
263
|
+
"EmbeddingModelListResponse",
|
|
264
|
+
"EmbeddingsResponse",
|
|
265
|
+
"EntityDiff",
|
|
266
|
+
"EvalRunDetailResponse",
|
|
267
|
+
"EvalRunResponse",
|
|
268
|
+
"EvaluationDetails",
|
|
269
|
+
"EvaluationListResponse",
|
|
270
|
+
"EvaluationMetrics",
|
|
271
|
+
"EvaluationReportResponse",
|
|
272
|
+
"EvaluationRequest",
|
|
273
|
+
"EvaluationResponse",
|
|
274
|
+
"EvaluationSummary",
|
|
275
|
+
"FeedListResponse",
|
|
276
|
+
"FeedResponse",
|
|
277
|
+
"FeedRunResponse",
|
|
278
|
+
"FeedSubscriptionResponse",
|
|
279
|
+
"FeedbackResponse",
|
|
280
|
+
"FieldDiff",
|
|
281
|
+
"GoldLabelChunkReference",
|
|
282
|
+
"GoldLabelDocumentReference",
|
|
283
|
+
"GoldLabelEntry",
|
|
284
|
+
"GoldLabelListItem",
|
|
285
|
+
"GoldLabelsListResponse",
|
|
286
|
+
"GoldLabelsUploadRequest",
|
|
287
|
+
"GoldLabelsUploadResponse",
|
|
288
|
+
"GraphEdge",
|
|
289
|
+
"GraphNode",
|
|
290
|
+
"GraphResponse",
|
|
291
|
+
"IndexBuildResponse",
|
|
292
|
+
"IndexCompactResponse",
|
|
293
|
+
"IndexStatusResponse",
|
|
294
|
+
"InviteAcceptResponse",
|
|
295
|
+
"InviteCreateResponse",
|
|
296
|
+
"InviteListItem",
|
|
297
|
+
"InviteListResponse",
|
|
298
|
+
"JobListItem",
|
|
299
|
+
"JobListResponse",
|
|
300
|
+
"JobResponse",
|
|
301
|
+
"JobStatusResponse",
|
|
302
|
+
"LexicalStrategy",
|
|
303
|
+
"MemberRemoveResponse",
|
|
304
|
+
"MemberUpdateResponse",
|
|
305
|
+
"ModelDeleteResponse",
|
|
306
|
+
"ModelListResponse",
|
|
307
|
+
"ModelResponse",
|
|
308
|
+
"OnboardingStatusResponse",
|
|
309
|
+
"OrgResponse",
|
|
310
|
+
"PipelineSpecListResponse",
|
|
311
|
+
"PipelineSpecResponse",
|
|
312
|
+
"ProjectListResponse",
|
|
313
|
+
"ProjectResponse",
|
|
314
|
+
"PromoteResponse",
|
|
315
|
+
"ReconcileJobsResponse",
|
|
316
|
+
"RefreshChanges",
|
|
317
|
+
"RefreshResult",
|
|
318
|
+
"ResolvedLabelInfo",
|
|
319
|
+
"SearchBatchOptions",
|
|
320
|
+
"SearchBatchResponse",
|
|
321
|
+
"SearchColdStartMeta",
|
|
322
|
+
"SearchGenerateOptions",
|
|
323
|
+
"SearchGenerateResponse",
|
|
324
|
+
"SearchGenerationConfig",
|
|
325
|
+
"SearchHybridConfig",
|
|
326
|
+
"SearchMeta",
|
|
327
|
+
"SearchOptions",
|
|
328
|
+
"SearchRerankConfig",
|
|
329
|
+
"SearchResponse",
|
|
330
|
+
"SearchResult",
|
|
331
|
+
"SearchReturnConfig",
|
|
332
|
+
"SearcherPersona",
|
|
333
|
+
"SkippedEntity",
|
|
334
|
+
"SourceAgentInfo",
|
|
335
|
+
"SubscriptionListResponse",
|
|
336
|
+
"SubscriptionResponse",
|
|
337
|
+
"SummarizationRequest",
|
|
338
|
+
"SummarizationResponse",
|
|
339
|
+
"SummarizationStatusResponse",
|
|
340
|
+
"SyntheticQueryBatchDetails",
|
|
341
|
+
"SyntheticQueryBatchListResponse",
|
|
342
|
+
"SyntheticQueryBatchResponse",
|
|
343
|
+
"SyntheticQueryBatchSummary",
|
|
344
|
+
"SyntheticQueryGenerationRequest",
|
|
345
|
+
"SyntheticQuerySample",
|
|
346
|
+
"TaskTypeInfo",
|
|
347
|
+
"TeamListResponse",
|
|
348
|
+
"TeamMember",
|
|
349
|
+
"ToolConfigResponse",
|
|
350
|
+
"TrainingDataBuildResponse",
|
|
351
|
+
"TrainingDatasetListResponse",
|
|
352
|
+
"TrainingDatasetResponse",
|
|
353
|
+
"TuningRunBuildResponse",
|
|
354
|
+
"TuningRunDetailResponse",
|
|
355
|
+
"TuningRunListResponse",
|
|
356
|
+
"TuningRunLogsResponse",
|
|
357
|
+
"TuningRunResponse",
|
|
358
|
+
"UsageByCorpusItem",
|
|
359
|
+
"UsageByCorpusResponse",
|
|
360
|
+
"UsageByKeyItem",
|
|
361
|
+
"UsageByKeyResponse",
|
|
362
|
+
"UsageSeriesPoint",
|
|
363
|
+
"UsageSummaryResponse",
|
|
364
|
+
"ValidationIssue",
|
|
365
|
+
"WhoAmIResponse",
|
|
366
|
+
]
|
sdk/types/a2a.py
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Literal, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class A2ATextPart(TypedDict):
|
|
7
|
+
kind: Literal["text"]
|
|
8
|
+
text: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class A2ADataPart(TypedDict):
|
|
12
|
+
kind: Literal["data"]
|
|
13
|
+
data: dict[str, Any]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class A2AArtifact(TypedDict, total=False):
|
|
17
|
+
artifactId: str
|
|
18
|
+
name: str
|
|
19
|
+
parts: list[A2ATextPart | A2ADataPart]
|
|
20
|
+
metadata: dict[str, Any]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class A2ATaskStatus(TypedDict, total=False):
|
|
24
|
+
state: str
|
|
25
|
+
timestamp: str
|
|
26
|
+
message: dict[str, Any]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class A2ATaskResponse(TypedDict, total=False):
|
|
30
|
+
id: str
|
|
31
|
+
contextId: str
|
|
32
|
+
status: A2ATaskStatus
|
|
33
|
+
artifacts: list[A2AArtifact]
|
|
34
|
+
history: list[dict[str, Any]]
|
|
35
|
+
metadata: dict[str, Any]
|
|
36
|
+
kind: Literal["task"]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class A2AJsonRpcError(TypedDict, total=False):
|
|
40
|
+
code: int
|
|
41
|
+
message: str
|
|
42
|
+
data: dict[str, Any]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class A2AJsonRpcResponse(TypedDict, total=False):
|
|
46
|
+
jsonrpc: str
|
|
47
|
+
id: str | int
|
|
48
|
+
result: A2ATaskResponse
|
|
49
|
+
error: A2AJsonRpcError
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class A2AAgentSkill(TypedDict, total=False):
|
|
53
|
+
id: str
|
|
54
|
+
name: str
|
|
55
|
+
description: str
|
|
56
|
+
tags: list[str]
|
|
57
|
+
examples: list[str]
|
|
58
|
+
inputModes: list[str]
|
|
59
|
+
outputModes: list[str]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class A2AAgentCapabilities(TypedDict, total=False):
|
|
63
|
+
streaming: bool
|
|
64
|
+
pushNotifications: bool
|
|
65
|
+
stateTransitionHistory: bool
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class A2AAgentProvider(TypedDict, total=False):
|
|
69
|
+
organization: str
|
|
70
|
+
url: str
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class A2AAgentAuthentication(TypedDict, total=False):
|
|
74
|
+
schemes: list[str]
|
|
75
|
+
credentials: str
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class A2AAgentCardResponse(TypedDict, total=False):
|
|
79
|
+
name: str
|
|
80
|
+
description: str
|
|
81
|
+
url: str
|
|
82
|
+
provider: A2AAgentProvider
|
|
83
|
+
version: str
|
|
84
|
+
capabilities: A2AAgentCapabilities
|
|
85
|
+
authentication: A2AAgentAuthentication
|
|
86
|
+
defaultInputModes: list[str]
|
|
87
|
+
defaultOutputModes: list[str]
|
|
88
|
+
skills: list[A2AAgentSkill]
|
sdk/types/agents.py
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SourceAgentInfo(TypedDict, total=False):
|
|
7
|
+
"""Source agent reference in an agent response."""
|
|
8
|
+
|
|
9
|
+
agent_id: str
|
|
10
|
+
agent_name: str
|
|
11
|
+
mode: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ToolConfigResponse(TypedDict, total=False):
|
|
15
|
+
"""Webhook tool configuration (secret masked in responses)."""
|
|
16
|
+
|
|
17
|
+
webhook_url: str
|
|
18
|
+
webhook_secret: str | None
|
|
19
|
+
webhook_retries: int | None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AgentResponse(TypedDict, total=False):
|
|
23
|
+
"""A single knowledge agent record."""
|
|
24
|
+
|
|
25
|
+
id: str
|
|
26
|
+
org_id: str
|
|
27
|
+
project_id: str | None
|
|
28
|
+
name: str
|
|
29
|
+
slug: str
|
|
30
|
+
description: str | None
|
|
31
|
+
corpus_id: str | None
|
|
32
|
+
task_type: str
|
|
33
|
+
instructions: str | None
|
|
34
|
+
model: str
|
|
35
|
+
status: str
|
|
36
|
+
parent_agent_id: str | None
|
|
37
|
+
source_agents: list[SourceAgentInfo]
|
|
38
|
+
tool_config: ToolConfigResponse | None
|
|
39
|
+
created_at: str | None
|
|
40
|
+
updated_at: str | None
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class AgentListResponse(TypedDict):
|
|
44
|
+
"""Paginated list of agents."""
|
|
45
|
+
|
|
46
|
+
agents: list[AgentResponse]
|
|
47
|
+
total: int
|
|
48
|
+
limit: int
|
|
49
|
+
offset: int
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AgentChatResponse(TypedDict, total=False):
|
|
53
|
+
"""Response from chatting with an agent."""
|
|
54
|
+
|
|
55
|
+
answer: str
|
|
56
|
+
model: str
|
|
57
|
+
results: list[dict[str, Any]]
|
|
58
|
+
used_sources: list[str]
|
|
59
|
+
meta: dict[str, Any] | None
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class AgentModelInfo(TypedDict, total=False):
|
|
63
|
+
"""Information about an available agent model."""
|
|
64
|
+
|
|
65
|
+
id: str
|
|
66
|
+
name: str
|
|
67
|
+
provider: str
|
|
68
|
+
default: bool
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class AgentModelsResponse(TypedDict):
|
|
72
|
+
"""List of available models for knowledge agents."""
|
|
73
|
+
|
|
74
|
+
models: list[AgentModelInfo]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class TaskTypeInfo(TypedDict, total=False):
|
|
78
|
+
"""Information about an available agent task type."""
|
|
79
|
+
|
|
80
|
+
id: str
|
|
81
|
+
name: str
|
|
82
|
+
description: str
|
|
83
|
+
output_schema: str | None
|
|
84
|
+
supports_chat: bool
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class AgentTaskTypesResponse(TypedDict):
|
|
88
|
+
"""List of available agent task types."""
|
|
89
|
+
|
|
90
|
+
task_types: list[TaskTypeInfo]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class AgentRunResponse(TypedDict):
|
|
94
|
+
"""Response from triggering an agent task run."""
|
|
95
|
+
|
|
96
|
+
job_id: str
|
|
97
|
+
status: str
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class AgentRunListItem(TypedDict, total=False):
|
|
101
|
+
"""A single agent task run in the runs list."""
|
|
102
|
+
|
|
103
|
+
job_id: str
|
|
104
|
+
status: str
|
|
105
|
+
created_at: str
|
|
106
|
+
completed_at: str | None
|
|
107
|
+
result: dict[str, Any] | None
|
|
108
|
+
error_message: str | None
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class AgentRunListResponse(TypedDict):
|
|
112
|
+
"""Paginated list of agent task runs."""
|
|
113
|
+
|
|
114
|
+
runs: list[AgentRunListItem]
|
|
115
|
+
total: int
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class SubscriptionResponse(TypedDict, total=False):
|
|
119
|
+
"""A feed subscription for an agent."""
|
|
120
|
+
|
|
121
|
+
id: str
|
|
122
|
+
agent_id: str
|
|
123
|
+
feed_id: str
|
|
124
|
+
feed_name: str | None
|
|
125
|
+
feed_activation_status: str | None
|
|
126
|
+
role: str
|
|
127
|
+
created_at: str
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class SubscriptionListResponse(TypedDict):
|
|
131
|
+
"""List of feed subscriptions for an agent."""
|
|
132
|
+
|
|
133
|
+
subscriptions: list[SubscriptionResponse]
|
sdk/types/audit.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AuditLogItem(TypedDict, total=False):
|
|
7
|
+
id: str
|
|
8
|
+
action: str
|
|
9
|
+
entity_type: str
|
|
10
|
+
entity_id: str | None
|
|
11
|
+
org_id: str
|
|
12
|
+
project_id: str | None
|
|
13
|
+
corpus_id: str | None
|
|
14
|
+
api_key_id: str | None
|
|
15
|
+
user_id: str | None
|
|
16
|
+
payload: dict
|
|
17
|
+
created_at: str
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class AuditLogListResponse(TypedDict):
|
|
21
|
+
logs: list[AuditLogItem]
|
|
22
|
+
total: int
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class AuditLogActionsResponse(TypedDict):
|
|
26
|
+
actions: list[str]
|