fal 1.1.0__py3-none-any.whl → 1.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fal might be problematic. Click here for more details.

fal/_fal_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.1.0'
16
- __version_tuple__ = version_tuple = (1, 1, 0)
15
+ __version__ = version = '1.1.1'
16
+ __version_tuple__ = version_tuple = (1, 1, 1)
fal/toolkit/file/file.py CHANGED
@@ -22,6 +22,7 @@ from pydantic import BaseModel, Field
22
22
  from fal.toolkit.file.providers.fal import (
23
23
  FalCDNFileRepository,
24
24
  FalFileRepository,
25
+ FalFileRepositoryV2,
25
26
  InMemoryRepository,
26
27
  )
27
28
  from fal.toolkit.file.providers.gcp import GoogleStorageRepository
@@ -33,6 +34,7 @@ FileRepositoryFactory = Callable[[], FileRepository]
33
34
 
34
35
  BUILT_IN_REPOSITORIES: dict[RepositoryId, FileRepositoryFactory] = {
35
36
  "fal": lambda: FalFileRepository(),
37
+ "fal_v2": lambda: FalFileRepositoryV2(),
36
38
  "in_memory": lambda: InMemoryRepository(),
37
39
  "gcp_storage": lambda: GoogleStorageRepository(),
38
40
  "r2": lambda: R2Repository(),
@@ -26,8 +26,8 @@ GLOBAL_LIFECYCLE_PREFERENCE = ObjectLifecyclePreference(
26
26
 
27
27
 
28
28
  @dataclass
29
- class FalFileRepository(FileRepository):
30
- def save(self, file: FileData) -> str:
29
+ class FalFileRepositoryBase(FileRepository):
30
+ def _save(self, file: FileData, storage_type: str) -> str:
31
31
  key_creds = key_credentials()
32
32
  if not key_creds:
33
33
  raise FileUploadException("FAL_KEY must be set")
@@ -41,7 +41,7 @@ class FalFileRepository(FileRepository):
41
41
 
42
42
  grpc_host = os.environ.get("FAL_HOST", "api.alpha.fal.ai")
43
43
  rest_host = grpc_host.replace("api", "rest", 1)
44
- storage_url = f"https://{rest_host}/storage/upload/initiate"
44
+ storage_url = f"https://{rest_host}/storage/upload/initiate?storage_type={storage_type}"
45
45
 
46
46
  try:
47
47
  req = Request(
@@ -79,6 +79,18 @@ class FalFileRepository(FileRepository):
79
79
  return
80
80
 
81
81
 
82
+ @dataclass
83
+ class FalFileRepository(FalFileRepositoryBase):
84
+ def save(self, file: FileData) -> str:
85
+ return self._save(file, "gcs")
86
+
87
+
88
+ @dataclass
89
+ class FalFileRepositoryV2(FalFileRepositoryBase):
90
+ def save(self, file: FileData) -> str:
91
+ return self._save(file, "fal-cdn")
92
+
93
+
82
94
  @dataclass
83
95
  class InMemoryRepository(FileRepository):
84
96
  def save(
fal/toolkit/file/types.py CHANGED
@@ -28,7 +28,7 @@ class FileData:
28
28
  self.file_name = file_name
29
29
 
30
30
 
31
- RepositoryId = Literal["fal", "in_memory", "gcp_storage", "r2", "cdn"]
31
+ RepositoryId = Literal["fal", "fal_v2", "in_memory", "gcp_storage", "r2", "cdn"]
32
32
 
33
33
 
34
34
  @dataclass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fal
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: fal is an easy-to-use Serverless Python Framework
5
5
  Author: Features & Labels <support@fal.ai>
6
6
  Requires-Python: >=3.8
@@ -1,6 +1,6 @@
1
1
  fal/__init__.py,sha256=wXs1G0gSc7ZK60-bHe-B2m0l_sA6TrFk4BxY0tMoLe8,784
2
2
  fal/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
3
- fal/_fal_version.py,sha256=CqDGE4B1ZqZ-56mxeOFcXRTmlxrdOh4ayrjbcPjziE4,411
3
+ fal/_fal_version.py,sha256=EPoWF0em1tKJgBz5dbBF-r29860VBk-SsdiXh6E1aO0,411
4
4
  fal/_serialization.py,sha256=7urrZXw99qmsK-RkjCurk6Va4TMEfDIMajkzKbSW4j4,7655
5
5
  fal/_version.py,sha256=EBGqrknaf1WygENX-H4fBefLvHryvJBBGtVJetaB0NY,266
6
6
  fal/api.py,sha256=x60GlBWynDd1yhHsVWeqf07WVTzgbwNC6cqCjhlTiFQ,40556
@@ -43,9 +43,9 @@ fal/toolkit/__init__.py,sha256=sV95wiUzKoiDqF9vDgq4q-BLa2sD6IpuKSqp5kdTQNE,658
43
43
  fal/toolkit/exceptions.py,sha256=elHZ7dHCJG5zlHGSBbz-ilkZe9QUvQMomJFi8Pt91LA,198
44
44
  fal/toolkit/optimize.py,sha256=p75sovF0SmRP6zxzpIaaOmqlxvXB_xEz3XPNf59EF7w,1339
45
45
  fal/toolkit/file/__init__.py,sha256=FbNl6wD-P0aSSTUwzHt4HujBXrbC3ABmaigPQA4hRfg,70
46
- fal/toolkit/file/file.py,sha256=r8PzNCgv8Gkj6s1zM0yW-pcMKIouyaiEH06iBue8MwM,6066
47
- fal/toolkit/file/types.py,sha256=9CqDh8SmNJNzfsrvtj468uo2SprJH9rOk8KMhhfU73c,1050
48
- fal/toolkit/file/providers/fal.py,sha256=ACxkfQ9kmMJ1xP8dNUHzkLkJJLZvoybTpVt8avGb8Nw,3747
46
+ fal/toolkit/file/file.py,sha256=S-So4RNSfcKgESFKnCFmQxdCpEov-JqbO2vIW73ZyC8,6136
47
+ fal/toolkit/file/types.py,sha256=bJCeV5NPcpJYJoglailiRgFsuNAfcextYA8Et5-XUag,1060
48
+ fal/toolkit/file/providers/fal.py,sha256=C0j2bRf_xwKNjwv4awdVCggQ-2fBNGPRClTeHbG79v4,4091
49
49
  fal/toolkit/file/providers/gcp.py,sha256=7Lg7BXoHKkFu0jkGv3_vKh2Ks6eRfDMbw31N3mvDUtk,1913
50
50
  fal/toolkit/file/providers/r2.py,sha256=YW5aJBOX41MQxfx1rA_f-IiJhAPMZ5md0cxBcg3y08I,2537
51
51
  fal/toolkit/image/__init__.py,sha256=qNLyXsBWysionUjbeWbohLqWlw3G_UpzunamkZd_JLQ,71
@@ -115,8 +115,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
115
115
  openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
116
116
  openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
117
117
  openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
118
- fal-1.1.0.dist-info/METADATA,sha256=OvMciwRk4COCWrBAjdUkaM5b7vJqdUzbR1RYHJ7yn6A,3777
119
- fal-1.1.0.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
120
- fal-1.1.0.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
121
- fal-1.1.0.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
122
- fal-1.1.0.dist-info/RECORD,,
118
+ fal-1.1.1.dist-info/METADATA,sha256=oygGKONaPZI7r2VFFwKzOyGfV2ljvWwFchw2Tz5UG3E,3777
119
+ fal-1.1.1.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
120
+ fal-1.1.1.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
121
+ fal-1.1.1.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
122
+ fal-1.1.1.dist-info/RECORD,,
File without changes