pydo.genai.create_knowledge_base_data_source()
Generated on 7 Jul 2026
from pydo version
v0.39.0
Usage
client.genai.create_knowledge_base_data_source(
knowledge_base_uuid="\"123e4567-e89b-12d3-a456-426614174000\"",
body={
"aws_data_source": {...},
"chunking_algorithm": "CHUNKING_ALGORITHM_UNKNOWN",
"chunking_options": {...},
...,
},
)Description
To add a data source to a knowledge base, send a POST request to /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources.
Parameters
knowledge_base_uuidstring requiredKnowledge base id
aws_data_sourceobject optionalAWS S3 Data Source
Show child properties
bucket_namestring optionalExample:
example nameSpaces bucket name
item_pathstring optionalExample:
example stringkey_idstring optionalExample:
123e4567-e89b-12d3-a456-426614174000The AWS Key ID
regionstring optionalExample:
example stringRegion of bucket
secret_keystring optionalExample:
example stringThe AWS Secret Key
chunking_algorithmstring optionalchunking_optionsobject optionalShow child properties
child_chunk_sizeinteger optionalExample:
350max_chunk_sizeinteger optionalExample:
750Common options
parent_chunk_sizeinteger optionalExample:
1000Hierarchical options
semantic_thresholdnumber optionalExample:
0.5Semantic options
knowledge_base_uuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"Knowledge base id
spaces_data_sourceobject optionalSpaces Bucket Data Source
Show child properties
bucket_namestring optionalExample:
example nameSpaces bucket name
item_pathstring optionalExample:
example stringregionstring optionalExample:
example stringRegion of bucket
web_crawler_data_sourceobject optionalWebCrawlerDataSource
Show child properties
base_urlstring optionalExample:
example stringThe base url to crawl.
crawling_optionstring optionalOptions for specifying how URLs found on pages should be handled.
- UNKNOWN: Default unknown value
- SCOPED: Only include the base URL.
- PATH: Crawl the base URL and linked pages within the URL path.
- DOMAIN: Crawl the base URL and linked pages within the same domain.
- SUBDOMAINS: Crawl the base URL and linked pages for any subdomain.
- SITEMAP: Crawl URLs discovered in the sitemap.embed_mediaboolean optionalExample:
TrueWhether to ingest and index media (images, etc.) on web pages.
exclude_tagsarray of strings optionalExample:
['example string']Declaring which tags to exclude in web pages while webcrawling
Request Sample
Response Example
More Information
See /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources in the API reference for additional detail on responses, headers, parameters, and more.