Skip to content

Commit 8e30ff8

Browse files
snegi-doanup-deka
andauthored
update examples/curl for create KB and create data source (#1122)
* update examples/curl for create KB and create data source * update sample request payload for create KB and create data source --------- Co-authored-by: anup-deka <adeka@digitalocean.com>
1 parent 578e1b5 commit 8e30ff8

File tree

3 files changed

+186
-2
lines changed

3 files changed

+186
-2
lines changed

specification/resources/gen-ai/definitions.yml

Lines changed: 161 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,8 @@ apiAgentWorkspace:
999999
apiAgentWorkspaceDeployment:
10001000
description: An Agent Workspace Deployment
10011001
properties:
1002+
active_release:
1003+
$ref: '#/apiAgentDeploymentRelease'
10021004
created_at:
10031005
description: Creation date / time
10041006
example: "2023-01-01T00:00:00Z"
@@ -1180,6 +1182,38 @@ apiChatbot:
11801182
example: example string
11811183
type: string
11821184
type: object
1185+
apiChunkingAlgorithm:
1186+
default: CHUNKING_ALGORITHM_UNKNOWN
1187+
enum:
1188+
- CHUNKING_ALGORITHM_UNKNOWN
1189+
- CHUNKING_ALGORITHM_SECTION_BASED
1190+
- CHUNKING_ALGORITHM_HIERARCHICAL
1191+
- CHUNKING_ALGORITHM_SEMANTIC
1192+
- CHUNKING_ALGORITHM_FIXED_LENGTH
1193+
example: CHUNKING_ALGORITHM_SECTION_BASED
1194+
type: string
1195+
apiChunkingOptions:
1196+
properties:
1197+
child_chunk_size:
1198+
example: 350
1199+
format: int64
1200+
type: integer
1201+
max_chunk_size:
1202+
description: Common options
1203+
example: 750
1204+
format: int64
1205+
type: integer
1206+
parent_chunk_size:
1207+
description: Hierarchical options
1208+
example: 1000
1209+
format: int64
1210+
type: integer
1211+
semantic_threshold:
1212+
description: Semantic options
1213+
example: 0.5
1214+
format: float
1215+
type: number
1216+
type: object
11831217
apiCrawlingOption:
11841218
default: UNKNOWN
11851219
description: |-
@@ -1439,6 +1473,8 @@ apiCreateDataSourceFileUploadPresignedUrlsOutput:
14391473
apiCreateEvaluationDatasetInputPublic:
14401474
description: Creates an evaluation dataset for an agent
14411475
properties:
1476+
dataset_type:
1477+
$ref: '#/apiEvaluationDatasetType'
14421478
file_upload_dataset:
14431479
$ref: '#/apiFileUploadDataSource'
14441480
name:
@@ -1456,6 +1492,9 @@ apiCreateEvaluationDatasetOutput:
14561492
type: object
14571493
apiCreateEvaluationTestCaseInputPublic:
14581494
properties:
1495+
agent_workspace_name:
1496+
example: example name
1497+
type: string
14591498
dataset_uuid:
14601499
description: Dataset against which the test‑case is executed.
14611500
example: 123e4567-e89b-12d3-a456-426614174000
@@ -1501,6 +1540,10 @@ apiCreateKnowledgeBaseDataSourceInputPublic:
15011540
properties:
15021541
aws_data_source:
15031542
$ref: '#/apiAWSDataSource'
1543+
chunking_algorithm:
1544+
$ref: '#/apiChunkingAlgorithm'
1545+
chunking_options:
1546+
$ref: '#/apiChunkingOptions'
15041547
knowledge_base_uuid:
15051548
description: Knowledge base id
15061549
example: '"12345678-1234-1234-1234-123456789012"'
@@ -2000,6 +2043,14 @@ apiEvaluationDataset:
20002043
format: int64
20012044
type: integer
20022045
type: object
2046+
apiEvaluationDatasetType:
2047+
default: EVALUATION_DATASET_TYPE_UNKNOWN
2048+
enum:
2049+
- EVALUATION_DATASET_TYPE_UNKNOWN
2050+
- EVALUATION_DATASET_TYPE_ADK
2051+
- EVALUATION_DATASET_TYPE_NON_ADK
2052+
example: EVALUATION_DATASET_TYPE_UNKNOWN
2053+
type: string
20032054
apiEvaluationMetric:
20042055
properties:
20052056
category:
@@ -2100,6 +2151,10 @@ apiEvaluationRun:
21002151
description: Whether agent is deleted
21012152
example: true
21022153
type: boolean
2154+
agent_deployment_name:
2155+
description: The agent deployment name
2156+
example: example name
2157+
type: string
21032158
agent_name:
21042159
description: Agent name
21052160
example: example name
@@ -2273,6 +2328,40 @@ apiEvaluationTestCaseMetricList:
22732328
type: string
22742329
type: array
22752330
type: object
2331+
apiEvaluationTraceSpan:
2332+
description: Represents a span within an evaluatioin trace (e.g., LLM call, tool
2333+
call, etc.)
2334+
properties:
2335+
created_at:
2336+
description: When the span was created
2337+
example: "2023-01-01T00:00:00Z"
2338+
format: date-time
2339+
type: string
2340+
input:
2341+
description: Input data for the span (flexible structure - can be messages array,
2342+
string, etc.)
2343+
type: object
2344+
name:
2345+
description: Name/identifier for the span
2346+
example: example name
2347+
type: string
2348+
output:
2349+
description: Output data from the span (flexible structure - can be message,
2350+
string, etc.)
2351+
type: object
2352+
retriever_chunks:
2353+
description: Any retriever span chunks that were included as part of the span.
2354+
items:
2355+
$ref: '#/apiPromptChunk'
2356+
type: array
2357+
span_level_metric_results:
2358+
description: The span-level metric results.
2359+
items:
2360+
$ref: '#/apiEvaluationMetricResult'
2361+
type: array
2362+
type:
2363+
$ref: '#/apiTraceSpanType'
2364+
type: object
22762365
apiEvaluationUsage:
22772366
properties:
22782367
agent_measurements:
@@ -2373,6 +2462,12 @@ apiGetAgentDeploymentReleaseOutput:
23732462
agent_deployment_release:
23742463
$ref: '#/apiAgentDeploymentRelease'
23752464
type: object
2465+
apiGetAgentDeploymentUsageOutput:
2466+
description: Agent deployment usage
2467+
properties:
2468+
log_insights_usage:
2469+
$ref: '#/apiResourceUsage'
2470+
type: object
23762471
apiGetAgentInputPublic:
23772472
properties:
23782473
uuid:
@@ -3109,6 +3204,10 @@ apiKBDataSource:
31093204
description: Deprecated, moved to data_source_details
31103205
example: example string
31113206
type: string
3207+
chunking_algorithm:
3208+
$ref: '#/apiChunkingAlgorithm'
3209+
chunking_options:
3210+
$ref: '#/apiChunkingOptions'
31123211
dropbox_data_source:
31133212
$ref: '#/apiDropboxDataSource'
31143213
file_upload_data_source:
@@ -3191,6 +3290,10 @@ apiKnowledgeBaseDataSource:
31913290
description: Name of storage bucket - Deprecated, moved to data_source_details
31923291
example: example name
31933292
type: string
3293+
chunking_algorithm:
3294+
$ref: '#/apiChunkingAlgorithm'
3295+
chunking_options:
3296+
$ref: '#/apiChunkingOptions'
31943297
created_at:
31953298
description: Creation date / time
31963299
example: "2023-01-01T00:00:00Z"
@@ -3578,6 +3681,13 @@ apiListEvaluationPricesOutput:
35783681
$ref: '#/apiGuardrailPrice'
35793682
type: array
35803683
type: object
3684+
apiListEvaluationRunsByAgentDeploymentOutput:
3685+
properties:
3686+
evaluation_runs:
3687+
items:
3688+
$ref: '#/apiEvaluationRun'
3689+
type: array
3690+
type: object
35813691
apiListEvaluationRunsByAgentOutput:
35823692
properties:
35833693
evaluation_runs:
@@ -3965,6 +4075,22 @@ apiModel:
39654075
description: True if it is a foundational model provided by do
39664076
example: true
39674077
type: boolean
4078+
kb_default_chunk_size:
4079+
description: Default chunking size limit to show in UI
4080+
example: 123
4081+
format: int64
4082+
type: integer
4083+
kb_max_chunk_size:
4084+
description: Maximum chunk size limit of model
4085+
example: 123
4086+
format: int64
4087+
type: integer
4088+
kb_min_chunk_size:
4089+
description: Minimum chunking size token limits if model supports KNOWLEDGEBASE
4090+
usecase
4091+
example: 123
4092+
format: int64
4093+
type: integer
39684094
metadata:
39694095
description: Additional meta data
39704096
type: object
@@ -4117,6 +4243,22 @@ apiModelPublic:
41174243
description: True if it is a foundational model provided by do
41184244
example: true
41194245
type: boolean
4246+
kb_default_chunk_size:
4247+
description: Default chunking size limit to show in UI
4248+
example: 123
4249+
format: int64
4250+
type: integer
4251+
kb_max_chunk_size:
4252+
description: Maximum chunk size limit of model
4253+
example: 123
4254+
format: int64
4255+
type: integer
4256+
kb_min_chunk_size:
4257+
description: Minimum chunking size token limits if model supports KNOWLEDGEBASE
4258+
usecase
4259+
example: 123
4260+
format: int64
4261+
type: integer
41204262
name:
41214263
description: Display name of the model
41224264
example: Llama 3.3 Instruct (70B)
@@ -4283,6 +4425,11 @@ apiPresignedUrlFile:
42834425
type: object
42844426
apiPrompt:
42854427
properties:
4428+
evaluation_trace_spans:
4429+
description: The evaluated trace spans.
4430+
items:
4431+
$ref: '#/apiEvaluationTraceSpan'
4432+
type: array
42864433
ground_truth:
42874434
description: The ground truth for the prompt.
42884435
example: example string
@@ -4318,6 +4465,10 @@ apiPrompt:
43184465
items:
43194466
$ref: '#/apiEvaluationMetricResult'
43204467
type: array
4468+
trace_id:
4469+
description: The trace id for the prompt.
4470+
example: 123e4567-e89b-12d3-a456-426614174000
4471+
type: string
43214472
type: object
43224473
apiPromptChunk:
43234474
properties:
@@ -4470,8 +4621,17 @@ apiRollbackToAgentVersionOutput:
44704621
apiRunEvaluationTestCaseInputPublic:
44714622
description: Run an evaluation test case.
44724623
properties:
4624+
agent_deployment_names:
4625+
description: Agent deployment names to run the test case against (ADK agent
4626+
workspaces).
4627+
example:
4628+
- example string
4629+
items:
4630+
example: example string
4631+
type: string
4632+
type: array
44734633
agent_uuids:
4474-
description: Agent UUIDs to run the test case against.
4634+
description: Agent UUIDs to run the test case against (legacy agents).
44754635
example:
44764636
- example string
44774637
items:

specification/resources/gen-ai/examples/curl/genai_create_knowledge_base.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ source: |-
1717
"spaces_data_source": {
1818
"bucket_name": "test-public-gen-ai",
1919
"region": "tor1"
20+
},
21+
"chunking_algorithm": "CHUNKING_ALGORITHM_HIERARCHICAL",
22+
"chunking_options": {
23+
"parent_chunk_size": 1000,
24+
"child_chunk_size": 350
2025
}
2126
},
2227
{
@@ -25,8 +30,23 @@ source: |-
2530
"crawling_option": "SCOPED",
2631
"embed_media": false,
2732
"exclude_tags": ["nav","footer","header","aside","script","style","form","iframe", "noscript"]
33+
},
34+
"chunking_algorithm": "CHUNKING_ALGORITHM_SEMANTIC",
35+
"chunking_options": {
36+
"max_chunk_size": 500,
37+
"semantic_threshold": 0.6
2838
}
29-
}
39+
},
40+
{
41+
"spaces_data_source": {
42+
"bucket_name": "test-public-gen-ai-2",
43+
"region": "tor1"
44+
},
45+
"chunking_algorithm": "CHUNKING_ALGORITHM_FIXED_LENGTH",
46+
"chunking_options": {
47+
"max_chunk_size": 400
48+
}
49+
},
3050
],
3151
"region": "tor1",
3252
"vpc_uuid": "f7176e0b-8c5e-4e32-948e-79327e56225a"

specification/resources/gen-ai/examples/curl/genai_create_knowledge_base_data_source.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ source: |-
1111
"crawling_option": "SCOPED",
1212
"embed_media": false,
1313
"exclude_tags": ["nav","footer","header","aside","script","style","form","iframe", "noscript"]
14+
},
15+
"chunking_algorithm": "CHUNKING_ALGORITHM_SECTION_BASED",
16+
"chunking_options": {
17+
"max_chunk_size": 500
1418
}
1519
}'

0 commit comments

Comments
 (0)