lfx-amazon 0.1.4
“Amazon component(s) as a standalone Langflow Extension Bundle.”
Cloud credential path markerAWS shared credentials access key field
SHA-256908a76425a42ca8ff1d93cb48250f00b377f4fe7acb0eed4361fb2027647086a
MaleculeH₂(Cm₃F)
Evidence
1from pathlib import Path
2from typing import Any
3
4from lfx.custom.custom_component.component import Component
5from lfx.io import (
6 BoolInput,
7 DropdownInput,
8 HandleInput,
9 Output,
10 SecretStrInput,
11 StrInput,
12)
13
14
15class S3BucketUploaderComponent(Component):
16 """S3BucketUploaderComponent is a component responsible for uploading files to an S3 bucket.
17
18 It provides two strategies for file upload: "By Data" and "By File Name". The component
19 requires AWS credentials and bucket details as inputs and processes files accordi …
53:25… ader"
54
55 inputs = [
56 SecretStrInput(
57 name="aws_access_key_id",
58 display_name="AWS Access Key ID",
59 required=True,
60 password=True,
61 info="AWS Access key ID.",
62 ),
63 SecretStrInput(
64 name="aws_secret_access_key",
65 display_name="AWS Secret Key",
66 required=True,
67 password=True,
68 info="AWS Secret …
166:32… g file: {file_path}")
167 if file_path:
168 self._s3_client().upload_file(file_path, Bucket=self.bucket_name, Key=self._normalize_path(file_path))
169
170 def _s3_client(self) -> Any:
171 """Creates …
174:23… o3 S3 client instance.
175 """
176 try:
177 import boto3
178 except ImportError as e:
179 msg = "boto3 is not installed. Please install it using `uv pip install boto3`."
180 raise ImportError(msg) from e
181
182 return boto3.client(
183 "s3",
184 aws_access_key_id=self.aws_access_key_id,
⋯4 lines
24:37…
25 options=AWS_MODEL_IDs,
26 value="anthropic.claude-3-haiku-20240307-v1:0",
27 info="List of available model IDs to choose from.",
28 ),
29 SecretStrInput(
30 name="aws_access_key_id",
31 display_name="AWS Access Key ID",
32 info="The access key for your AWS account."
33 "Usually set in Python code as the environment variable 'AWS_ACCESS_KEY_ID'.",
34 value="AWS_ACCESS_KEY_ID",
35 required=True,
36 ),
37 SecretStrInput(
38 name="aws_secret_access_key",
39 display_name="AWS Secret Access Key",
40 info="The secret key for your AWS account. "
41 "Usually set in Python code as the environment variable 'AWS_SECRET_ACCESS_KEY'.",
42 value="AWS_SECRET_ACCESS_KEY",
43 required=True,
44 ),
45 SecretStrInput(
46 name="aws_session_token",
47 display_name="AWS Session Token",
48 advanced=False,
49 info="The session key for your AWS acco …
No evidence locations were recorded for this file. Raw result