Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed Aug 8, 2024
1 parent f542ece commit 5a9820c
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright DataStax, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ai.langstream.agents.google.utils;

import com.google.auth.oauth2.GoogleCredentials;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright DataStax, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ai.langstream.agents.google.drive;

import static org.junit.jupiter.api.Assertions.*;
Expand Down Expand Up @@ -30,7 +45,7 @@ void test() throws Exception {
Map<String, StorageProviderObjectReference> collect = new LinkedHashMap<>();
source.inspectFiles(files, collect, tree);
assertEquals(5, collect.size());
assertEquals("doc1", collect.get("iddoc1").name());
assertEquals("iddoc1", collect.get("iddoc1").name());
assertEquals("ckdoc1", collect.get("iddoc1").contentDigest());
assertEquals(90L, collect.get("iddoc1").size());
}
Expand Down Expand Up @@ -92,7 +107,7 @@ void testRootFolders() throws Exception {
"include-mime-types",
"application/pdf,plain/text",
"root-parents",
inside.getId()));
root.getId()));

List<File> files =
List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,125 @@ public void testDocumentation() {
}
}
},
"google-drive-source" : {
"name" : "Google Drive Source",
"description" : "Reads data from Google Drive. The only authentication supported is via service account JSON.",
"properties" : {
"deleted-objects-topic" : {
"description" : "Write a message to this topic when an object has been detected as deleted for any reason.",
"required" : false,
"type" : "string",
"defaultValue" : "true"
},
"exclude-mime-types" : {
"description" : "Filter out mime types. Comma separated list of mime types. Only files with different mime types will be processed.\\nNote that folders are always discarded.",
"required" : false,
"type" : "array",
"items" : {
"description" : "Filter out mime types. Comma separated list of mime types. Only files with different mime types will be processed.\\nNote that folders are always discarded.",
"required" : false,
"type" : "string"
}
},
"idle-time" : {
"description" : "Time in seconds to sleep after polling for new files.",
"required" : false,
"type" : "integer",
"defaultValue" : "5"
},
"include-mime-types" : {
"description" : "Filter by mime types. Comma separated list of mime types. Only files with these mime types will be processed.",
"required" : false,
"type" : "array",
"items" : {
"description" : "Filter by mime types. Comma separated list of mime types. Only files with these mime types will be processed.",
"required" : false,
"type" : "string"
}
},
"root-parents" : {
"description" : "Filter by parent folders. Comma separated list of folder IDs. Only children will be processed.",
"required" : false,
"type" : "array",
"items" : {
"description" : "Filter by parent folders. Comma separated list of folder IDs. Only children will be processed.",
"required" : false,
"type" : "string"
}
},
"service-account-json" : {
"description" : "Textual Service Account JSON to authenticate with.",
"required" : true,
"type" : "string"
},
"source-activity-summary-events" : {
"description" : "List of events (comma separated) to include in the source activity summary. ('new', 'updated', 'deleted')\\nTo include all: 'new,updated,deleted'.\\nUse this property to disable the source activity summary (by leaving default to empty).",
"required" : false,
"type" : "string"
},
"source-activity-summary-events-threshold" : {
"description" : "Trigger source activity summary emission when this number of events have been detected, even if the time threshold has not been reached yet.",
"required" : false,
"type" : "integer",
"defaultValue" : "60"
},
"source-activity-summary-time-seconds-threshold" : {
"description" : "Trigger source activity summary emission every time this time threshold has been reached.",
"required" : false,
"type" : "integer"
},
"source-activity-summary-topic" : {
"description" : "Write a message to this topic periodically with a summary of the activity in the source.",
"required" : false,
"type" : "string"
},
"source-record-headers" : {
"description" : "Additional headers to add to emitted records.",
"required" : false,
"type" : "object"
},
"state-storage" : {
"description" : "State storage type (s3, disk).",
"required" : false,
"type" : "string"
},
"state-storage-file-prefix" : {
"description" : "Prepend a prefix to the state storage file. (valid for all types)",
"required" : false,
"type" : "string"
},
"state-storage-file-prepend-tenant" : {
"description" : "Prepend tenant to the state storage file. (valid for all types)",
"required" : false,
"type" : "string"
},
"state-storage-s3-access-key" : {
"description" : "State storage S3 access key.",
"required" : false,
"type" : "string"
},
"state-storage-s3-bucket" : {
"description" : "State storage S3 bucket.",
"required" : false,
"type" : "string"
},
"state-storage-s3-endpoint" : {
"description" : "State storage S3 endpoint.",
"required" : false,
"type" : "string"
},
"state-storage-s3-region" : {
"description" : "State storage S3 region.",
"required" : false,
"type" : "string"
},
"state-storage-s3-secret-key" : {
"description" : "State storage S3 secret key.",
"required" : false,
"type" : "string"
}
}
},
"s3-source" : {
"name" : "S3 Source",
"description" : "Reads data from S3 bucket",
Expand Down

0 comments on commit 5a9820c

Please sign in to comment.