-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Kendra] S3 connector documentation for templateConfiguration usage #4288
Comments
Thanks for reaching out. As mentioned in other issues that you opened, the create_data_source command makes a request to the CreateDataSource API, so any improvements to that documentation would need to be provided by the Kendra team. Boto3-specific examples could also be added here: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/examples.html, or here in the Kendra Developer Guide: https://docs.aws.amazon.com/kendra/latest/dg/gs-python.html The |
@tim-finnigan Thanks. Would it possible to add an example of using this with boto3 with TemplatConfiguration or is this something thats not supported by boto3 and boto3 only supports the S3DataSourceConfiguration method ? I see a 'Template' option in the boto3 create_data_source at https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/create_data_source.html Is this related to the S3 TeplateConfiguration ? If so, theres no example on how to use it in the docs for S3.
|
I see Have you tried setting that parameter? Here is a list of data template schemas: https://docs.aws.amazon.com/kendra/latest/dg/ds-schemas.html, for example S3: https://docs.aws.amazon.com/kendra/latest/dg/ds-schemas.html#ds-s3-schema |
I am requesting an example for the S3 configuration with TemplateConfiguration. (Not AlfrescoConfiguration) @tim-finnigan if you can kindly provide documentation for that. or is this something that we ned to check with Kendra directly and not supported from boto3. |
@ssmails can you try something like this: (I'm referring to TemplateConfiguration as documented, not AlfrescoConfiguration) import boto3
# Create the Kendra client
kendra_client = boto3.client('kendra')
response = kendra_client.create_data_source(
Name='string',
IndexId='string',
Type='TEMPLATE',
TemplateConfiguration={
'Template': {...}
}
) |
@tim-finnigan do you have a sample of a working Template that can work for this ? I also see the tag added to the issue as 'Feature-request' so wondering If this is something thats currently supported or not for S3 ? kindly confirm. |
Hi, here are the various template schemas: https://docs.aws.amazon.com/kendra/latest/dg/ds-schemas.html. Which one are you trying to do, or can you share any more details on your use case? |
Pls provide a minimal working example of using TemplateConfiguration with S3 (at the least accepting a bucket name). |
Here you go, this worked for me: import boto3
kendra_client = boto3.client('kendra', region_name='us-east-1')
template = {
"connectionConfiguration": {
"repositoryEndpointMetadata": {
"BucketName": "BUCKET"
}
},
"repositoryConfigurations": {
"document": {
"fieldMappings": [
{
"indexFieldName": "MyField",
"indexFieldType": "STRING",
"dataSourceFieldName": "MyField",
}
]
}
},
"syncMode": "FULL_CRAWL",
"type": "S3"
}
response = kendra_client.create_data_source(
Name='test-data-source',
IndexId='f81421b2-b65b-4edd-b0fe-f53921a4',
Type="TEMPLATE",
Configuration={
'TemplateConfiguration': {
'Template': template
}
},
RoleArn='arn:aws:iam::accountid:role/service-role/AmazonKendra-us-east-1-test',
)
print(response) And here is the S3 template schema: https://docs.aws.amazon.com/kendra/latest/dg/ds-schemas.html#ds-s3-schema |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the issue
Referring to https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/create_data_source.html
please provide example of using the [TemplateConfiguration], since the orinal method documented using the S3DataSourceConfiguration is scheduled to end.
Links
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/create_data_source.html
The text was updated successfully, but these errors were encountered: