fxn 0.0.40__py3-none-any.whl → 0.0.42__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.
- fxn/__init__.py +3 -1
- fxn/beta/__init__.py +6 -0
- fxn/beta/client.py +16 -0
- fxn/beta/prediction.py +16 -0
- fxn/beta/remote.py +207 -0
- fxn/c/__init__.py +7 -10
- fxn/c/configuration.py +114 -56
- fxn/c/fxnc.py +42 -22
- fxn/c/map.py +60 -30
- fxn/c/prediction.py +72 -33
- fxn/c/predictor.py +55 -27
- fxn/c/stream.py +33 -15
- fxn/c/value.py +215 -42
- fxn/cli/__init__.py +14 -12
- fxn/cli/auth.py +1 -1
- fxn/cli/misc.py +1 -1
- fxn/cli/{predict.py → predictions.py} +33 -36
- fxn/cli/predictors.py +3 -51
- fxn/client.py +58 -0
- fxn/compile/__init__.py +7 -0
- fxn/compile/compile.py +80 -0
- fxn/compile/sandbox.py +177 -0
- fxn/compile/signature.py +183 -0
- fxn/function.py +10 -6
- fxn/lib/__init__.py +1 -1
- fxn/lib/linux/arm64/libFunction.so +0 -0
- fxn/lib/linux/x86_64/libFunction.so +0 -0
- fxn/lib/macos/arm64/Function.dylib +0 -0
- fxn/lib/macos/x86_64/Function.dylib +0 -0
- fxn/lib/windows/arm64/Function.dll +0 -0
- fxn/lib/windows/x86_64/Function.dll +0 -0
- fxn/services/__init__.py +4 -4
- fxn/services/prediction.py +180 -351
- fxn/services/predictor.py +14 -187
- fxn/services/user.py +16 -42
- fxn/types/__init__.py +4 -4
- fxn/types/dtype.py +1 -1
- fxn/types/prediction.py +20 -10
- fxn/types/predictor.py +18 -32
- fxn/types/user.py +9 -15
- fxn/version.py +2 -2
- {fxn-0.0.40.dist-info → fxn-0.0.42.dist-info}/METADATA +5 -5
- fxn-0.0.42.dist-info/RECORD +47 -0
- {fxn-0.0.40.dist-info → fxn-0.0.42.dist-info}/WHEEL +1 -1
- fxn/api/__init__.py +0 -6
- fxn/api/client.py +0 -43
- fxn/c/dtype.py +0 -26
- fxn/c/status.py +0 -12
- fxn/c/version.py +0 -13
- fxn/cli/env.py +0 -40
- fxn-0.0.40.dist-info/RECORD +0 -44
- {fxn-0.0.40.dist-info → fxn-0.0.42.dist-info}/LICENSE +0 -0
- {fxn-0.0.40.dist-info → fxn-0.0.42.dist-info}/entry_points.txt +0 -0
- {fxn-0.0.40.dist-info → fxn-0.0.42.dist-info}/top_level.txt +0 -0
fxn/services/predictor.py
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
#
|
2
2
|
# Function
|
3
|
-
# Copyright ©
|
3
|
+
# Copyright © 2025 NatML Inc. All Rights Reserved.
|
4
4
|
#
|
5
5
|
|
6
|
-
from
|
7
|
-
|
8
|
-
from ..api import GraphClient
|
9
|
-
from ..types import Predictor, PredictorStatus
|
10
|
-
from .user import PROFILE_FIELDS
|
6
|
+
from ..client import FunctionClient, FunctionAPIError
|
7
|
+
from ..types import Predictor
|
11
8
|
|
12
9
|
class PredictorService:
|
13
10
|
|
14
|
-
def __init__ (self, client:
|
11
|
+
def __init__ (self, client: FunctionClient) -> None:
|
15
12
|
self.client = client
|
16
13
|
|
17
14
|
def retrieve (self, tag: str) -> Predictor:
|
@@ -24,183 +21,13 @@ class PredictorService:
|
|
24
21
|
Returns:
|
25
22
|
Predictor: Predictor.
|
26
23
|
"""
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
# Create predictor
|
38
|
-
predictor = response["predictor"]
|
39
|
-
predictor = Predictor(**predictor) if predictor else None
|
40
|
-
# Return
|
41
|
-
return predictor
|
42
|
-
|
43
|
-
def list (
|
44
|
-
self,
|
45
|
-
owner: str=None,
|
46
|
-
status: PredictorStatus=None,
|
47
|
-
offset: int=None,
|
48
|
-
count: int=None
|
49
|
-
) -> List[Predictor]:
|
50
|
-
"""
|
51
|
-
List the current user's predictors.
|
52
|
-
|
53
|
-
Parameters:
|
54
|
-
owner (str): Predictor owner. This defaults to the current user.
|
55
|
-
status (PredictorStatus): Predictor status. This defaults to `ACTIVE`.
|
56
|
-
offset (int): Pagination offset.
|
57
|
-
count (int): Pagination count.
|
58
|
-
|
59
|
-
Returns:
|
60
|
-
list: User predictors.
|
61
|
-
"""
|
62
|
-
# Query
|
63
|
-
response = self.client.query(f"""
|
64
|
-
query ($user: UserInput, $predictors: UserPredictorsInput) {{
|
65
|
-
user (input: $user) {{
|
66
|
-
predictors (input: $predictors) {{
|
67
|
-
{PREDICTOR_FIELDS}
|
68
|
-
}}
|
69
|
-
}}
|
70
|
-
}}
|
71
|
-
""",
|
72
|
-
{
|
73
|
-
"user": { "username": owner } if owner else None,
|
74
|
-
"predictors": { "status": status, "offset": offset, "count": count }
|
75
|
-
}
|
76
|
-
)
|
77
|
-
# Check
|
78
|
-
user = response["user"]
|
79
|
-
if not user:
|
80
|
-
return None
|
81
|
-
# Create predictors
|
82
|
-
predictors = response["user"]["predictors"]
|
83
|
-
predictors = [Predictor(**predictor) for predictor in predictors]
|
84
|
-
# Return
|
85
|
-
return predictors
|
86
|
-
|
87
|
-
def search (
|
88
|
-
self,
|
89
|
-
query: str,
|
90
|
-
offset: int=None,
|
91
|
-
count: int=None
|
92
|
-
) -> List[Predictor]:
|
93
|
-
"""
|
94
|
-
Search predictors.
|
95
|
-
|
96
|
-
Parameters:
|
97
|
-
q (str): Search query.
|
98
|
-
offset (int): Pagination offset.
|
99
|
-
count (int): Pagination count.
|
100
|
-
|
101
|
-
Returns:
|
102
|
-
list: Relevant predictors.
|
103
|
-
"""
|
104
|
-
# Query
|
105
|
-
response = self.client.query(f"""
|
106
|
-
query ($input: PredictorsInput!) {{
|
107
|
-
predictors (input: $input) {{
|
108
|
-
{PREDICTOR_FIELDS}
|
109
|
-
}}
|
110
|
-
}}
|
111
|
-
""",
|
112
|
-
{ "input": { "query": query, "offset": offset, "count": count } }
|
113
|
-
)
|
114
|
-
# Create predictors
|
115
|
-
predictors = response["predictors"]
|
116
|
-
predictors = [Predictor(**predictor) for predictor in predictors]
|
117
|
-
# Return
|
118
|
-
return predictors
|
119
|
-
|
120
|
-
def delete (self, tag: str) -> bool:
|
121
|
-
"""
|
122
|
-
Delete a predictor.
|
123
|
-
|
124
|
-
Parameters:
|
125
|
-
tag (str): Predictor tag.
|
126
|
-
|
127
|
-
Returns:
|
128
|
-
bool: Whether the predictor was successfully deleted.
|
129
|
-
"""
|
130
|
-
# Query
|
131
|
-
response = self.client.query(f"""
|
132
|
-
mutation ($input: DeletePredictorInput!) {{
|
133
|
-
deletePredictor (input: $input)
|
134
|
-
}}
|
135
|
-
""",
|
136
|
-
{ "input": { "tag": tag } }
|
137
|
-
)
|
138
|
-
# Return
|
139
|
-
result = response["deletePredictor"]
|
140
|
-
return result
|
141
|
-
|
142
|
-
def archive (self, tag: str) -> Predictor:
|
143
|
-
"""
|
144
|
-
Archive an active predictor.
|
145
|
-
|
146
|
-
Parameters:
|
147
|
-
tag (str): Predictor tag.
|
148
|
-
|
149
|
-
Returns:
|
150
|
-
Predictor: Archived predictor.
|
151
|
-
"""
|
152
|
-
# Query
|
153
|
-
response = self.client.query(f"""
|
154
|
-
mutation ($input: ArchivePredictorInput!) {{
|
155
|
-
archivePredictor (input: $input) {{
|
156
|
-
{PREDICTOR_FIELDS}
|
157
|
-
}}
|
158
|
-
}}
|
159
|
-
""",
|
160
|
-
{ "input": { "tag": tag } }
|
161
|
-
)
|
162
|
-
# Create predictor
|
163
|
-
predictor = response["archivePredictor"]
|
164
|
-
predictor = Predictor(**predictor) if predictor else None
|
165
|
-
# Return
|
166
|
-
return predictor
|
167
|
-
|
168
|
-
|
169
|
-
PREDICTOR_FIELDS = f"""
|
170
|
-
tag
|
171
|
-
owner {{
|
172
|
-
{PROFILE_FIELDS}
|
173
|
-
}}
|
174
|
-
name
|
175
|
-
status
|
176
|
-
access
|
177
|
-
created
|
178
|
-
description
|
179
|
-
card
|
180
|
-
media
|
181
|
-
signature {{
|
182
|
-
inputs {{
|
183
|
-
name
|
184
|
-
type
|
185
|
-
description
|
186
|
-
range
|
187
|
-
optional
|
188
|
-
enumeration {{
|
189
|
-
name
|
190
|
-
value
|
191
|
-
}}
|
192
|
-
default_value: defaultValue {{
|
193
|
-
data
|
194
|
-
type
|
195
|
-
shape
|
196
|
-
}}
|
197
|
-
schema
|
198
|
-
}}
|
199
|
-
outputs {{
|
200
|
-
name
|
201
|
-
type
|
202
|
-
description
|
203
|
-
}}
|
204
|
-
}}
|
205
|
-
license
|
206
|
-
"""
|
24
|
+
try:
|
25
|
+
return self.client.request(
|
26
|
+
method="GET",
|
27
|
+
path=f"/predictors/{tag}",
|
28
|
+
response_type=Predictor
|
29
|
+
)
|
30
|
+
except FunctionAPIError as error:
|
31
|
+
if error.status_code == 404:
|
32
|
+
return None
|
33
|
+
raise
|
fxn/services/user.py
CHANGED
@@ -1,56 +1,30 @@
|
|
1
1
|
#
|
2
2
|
# Function
|
3
|
-
# Copyright ©
|
3
|
+
# Copyright © 2025 NatML Inc. All Rights Reserved.
|
4
4
|
#
|
5
5
|
|
6
|
-
from ..
|
7
|
-
from ..types import
|
6
|
+
from ..client import FunctionClient, FunctionAPIError
|
7
|
+
from ..types import User
|
8
8
|
|
9
9
|
class UserService:
|
10
10
|
|
11
|
-
def __init__ (self, client:
|
11
|
+
def __init__ (self, client: FunctionClient) -> None:
|
12
12
|
self.client = client
|
13
13
|
|
14
|
-
def retrieve (self
|
14
|
+
def retrieve (self) -> User:
|
15
15
|
"""
|
16
|
-
Retrieve
|
17
|
-
|
18
|
-
Parameters:
|
19
|
-
username (str): Username. If `None`, this will retrieve the currently authenticated user.
|
20
|
-
access_key (str): Function access key.
|
16
|
+
Retrieve the current user.
|
21
17
|
|
22
18
|
Returns:
|
23
19
|
User: User.
|
24
20
|
"""
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
)
|
36
|
-
# Create user
|
37
|
-
user = response["user"]
|
38
|
-
user = Profile(**user) if user else None
|
39
|
-
# Return
|
40
|
-
return user
|
41
|
-
|
42
|
-
PROFILE_FIELDS = f"""
|
43
|
-
username
|
44
|
-
created
|
45
|
-
name
|
46
|
-
avatar
|
47
|
-
bio
|
48
|
-
website
|
49
|
-
github
|
50
|
-
"""
|
51
|
-
|
52
|
-
USER_FIELDS = f"""
|
53
|
-
... on User {{
|
54
|
-
email
|
55
|
-
}}
|
56
|
-
"""
|
21
|
+
try:
|
22
|
+
return self.client.request(
|
23
|
+
method="GET",
|
24
|
+
path="/users",
|
25
|
+
response_type=User
|
26
|
+
)
|
27
|
+
except FunctionAPIError as error:
|
28
|
+
if error.status_code == 401:
|
29
|
+
return None
|
30
|
+
raise
|
fxn/types/__init__.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#
|
2
2
|
# Function
|
3
|
-
# Copyright ©
|
3
|
+
# Copyright © 2025 NatML Inc. All Rights Reserved.
|
4
4
|
#
|
5
5
|
|
6
6
|
from .dtype import Dtype
|
7
|
-
from .prediction import Prediction, PredictionResource
|
8
|
-
from .predictor import
|
9
|
-
from .user import
|
7
|
+
from .prediction import Acceleration, Prediction, PredictionResource
|
8
|
+
from .predictor import AccessMode, EnumerationMember, Parameter, Predictor, PredictorStatus, Signature
|
9
|
+
from .user import User
|
fxn/types/dtype.py
CHANGED
fxn/types/prediction.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# Function
|
3
|
-
# Copyright ©
|
3
|
+
# Copyright © 2025 NatML Inc. All Rights Reserved.
|
4
4
|
#
|
5
5
|
|
6
|
+
from enum import IntFlag
|
6
7
|
from pydantic import BaseModel, Field
|
7
|
-
from typing import Any
|
8
|
+
from typing import Any
|
8
9
|
|
9
10
|
class PredictionResource (BaseModel):
|
10
11
|
"""
|
@@ -17,7 +18,7 @@ class PredictionResource (BaseModel):
|
|
17
18
|
"""
|
18
19
|
type: str = Field(description="Resource type.")
|
19
20
|
url: str = Field(description="Resource URL.")
|
20
|
-
name:
|
21
|
+
name: str | None = Field(default=None, description="Resource name.")
|
21
22
|
|
22
23
|
class Prediction (BaseModel):
|
23
24
|
"""
|
@@ -36,10 +37,19 @@ class Prediction (BaseModel):
|
|
36
37
|
"""
|
37
38
|
id: str = Field(description="Prediction identifier.")
|
38
39
|
tag: str = Field(description="Predictor tag.")
|
39
|
-
configuration:
|
40
|
-
resources:
|
41
|
-
results:
|
42
|
-
latency:
|
43
|
-
error:
|
44
|
-
logs:
|
45
|
-
created: str = Field(description="Date created.")
|
40
|
+
configuration: str | None = Field(default=None, description="Prediction configuration token. This is only populated for `EDGE` predictions.")
|
41
|
+
resources: list[PredictionResource] | None = Field(default=None, description="Prediction resources. This is only populated for `EDGE` predictions.")
|
42
|
+
results: list[Any] | None = Field(default=None, description="Prediction results.")
|
43
|
+
latency: float | None = Field(default=None, description="Prediction latency in milliseconds.")
|
44
|
+
error: str | None = Field(default=None, description="Prediction error. This is `None` if the prediction completed successfully.")
|
45
|
+
logs: str | None = Field(default=None, description="Prediction logs.")
|
46
|
+
created: str = Field(description="Date created.")
|
47
|
+
|
48
|
+
class Acceleration (IntFlag):
|
49
|
+
"""
|
50
|
+
Predictor acceleration.
|
51
|
+
"""
|
52
|
+
Auto = 0,
|
53
|
+
CPU = 1 << 0,
|
54
|
+
GPU = 1 << 1,
|
55
|
+
NPU = 1 << 2
|
fxn/types/predictor.py
CHANGED
@@ -1,26 +1,14 @@
|
|
1
1
|
#
|
2
2
|
# Function
|
3
|
-
# Copyright ©
|
3
|
+
# Copyright © 2025 NatML Inc. All Rights Reserved.
|
4
4
|
#
|
5
5
|
|
6
|
-
from enum import Enum
|
7
|
-
from io import BytesIO
|
8
|
-
from numpy.typing import NDArray
|
9
|
-
from PIL import Image
|
6
|
+
from enum import Enum
|
10
7
|
from pydantic import AliasChoices, BaseModel, ConfigDict, Field
|
11
|
-
from typing import Any
|
8
|
+
from typing import Any
|
12
9
|
|
13
10
|
from .dtype import Dtype
|
14
|
-
from .user import
|
15
|
-
|
16
|
-
class Acceleration (IntFlag):
|
17
|
-
"""
|
18
|
-
Predictor acceleration.
|
19
|
-
"""
|
20
|
-
Default = 0,
|
21
|
-
CPU = 1 << 0,
|
22
|
-
GPU = 1 << 1,
|
23
|
-
NPU = 1 << 2
|
11
|
+
from .user import User
|
24
12
|
|
25
13
|
class AccessMode (str, Enum):
|
26
14
|
"""
|
@@ -60,17 +48,15 @@ class Parameter (BaseModel):
|
|
60
48
|
optional (bool): Whether the parameter is optional.
|
61
49
|
range (tuple): Parameter value range for numeric parameters.
|
62
50
|
enumeration (list): Parameter value choices for enumeration parameters.
|
63
|
-
default_value (str | float | int | bool | ndarray | list | dict | PIL.Image | BytesIO): Parameter default value.
|
64
51
|
value_schema (dict): Parameter JSON schema. This is only populated for `list` and `dict` parameters.
|
65
52
|
"""
|
66
53
|
name: str = Field(description="Parameter name.")
|
67
|
-
type:
|
68
|
-
description:
|
69
|
-
optional:
|
70
|
-
range:
|
71
|
-
enumeration:
|
72
|
-
|
73
|
-
value_schema: Optional[dict] = Field(default=None, description="Parameter JSON schema. This is only populated for `list` and `dict` parameters.", serialization_alias="schema", validation_alias=AliasChoices("schema", "value_schema"))
|
54
|
+
type: Dtype | None = Field(default=None, description="Parameter type. This is `None` if the type is unknown or unsupported by Function.")
|
55
|
+
description: str | None = Field(default=None, description="Parameter description.")
|
56
|
+
optional: bool | None = Field(default=None, description="Whether the parameter is optional.")
|
57
|
+
range: tuple[float, float] | None = Field(default=None, description="Parameter value range for numeric parameters.")
|
58
|
+
enumeration: list[EnumerationMember] | None = Field(default=None, description="Parameter value choices for enumeration parameters.")
|
59
|
+
value_schema: dict[str, Any] | None = Field(default=None, description="Parameter JSON schema. This is only populated for `list` and `dict` parameters.", serialization_alias="schema", validation_alias=AliasChoices("schema", "value_schema"))
|
74
60
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
75
61
|
|
76
62
|
class Signature (BaseModel):
|
@@ -81,8 +67,8 @@ class Signature (BaseModel):
|
|
81
67
|
inputs (list): Input parameters.
|
82
68
|
outputs (list): Output parameters.
|
83
69
|
"""
|
84
|
-
inputs:
|
85
|
-
outputs:
|
70
|
+
inputs: list[Parameter] = Field(description="Input parameters.")
|
71
|
+
outputs: list[Parameter] = Field(description="Output parameters.")
|
86
72
|
|
87
73
|
class Predictor (BaseModel):
|
88
74
|
"""
|
@@ -90,7 +76,7 @@ class Predictor (BaseModel):
|
|
90
76
|
|
91
77
|
Members:
|
92
78
|
tag (str): Predictor tag.
|
93
|
-
owner (
|
79
|
+
owner (User): Predictor owner.
|
94
80
|
name (str): Predictor name.
|
95
81
|
status (PredictorStatus): Predictor status.
|
96
82
|
access (AccessMode): Predictor access.
|
@@ -102,13 +88,13 @@ class Predictor (BaseModel):
|
|
102
88
|
license (str): Predictor license URL.
|
103
89
|
"""
|
104
90
|
tag: str = Field(description="Predictor tag.")
|
105
|
-
owner:
|
91
|
+
owner: User = Field(description="Predictor owner.")
|
106
92
|
name: str = Field(description="Predictor name.")
|
107
93
|
status: PredictorStatus = Field(description="Predictor status.")
|
108
94
|
access: AccessMode = Field(description="Predictor access.")
|
109
95
|
signature: Signature = Field(description="Predictor signature.")
|
110
96
|
created: str = Field(description="Date created.")
|
111
|
-
description:
|
112
|
-
card:
|
113
|
-
media:
|
114
|
-
license:
|
97
|
+
description: str | None = Field(default=None, description="Predictor description.")
|
98
|
+
card: str | None = Field(default=None, description="Predictor card.")
|
99
|
+
media: str | None = Field(default=None, description="Predictor media URL.")
|
100
|
+
license: str | None = Field(default=None, description="Predictor license URL.")
|
fxn/types/user.py
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# Function
|
3
|
-
# Copyright ©
|
3
|
+
# Copyright © 2025 NatML Inc. All Rights Reserved.
|
4
4
|
#
|
5
5
|
|
6
6
|
from pydantic import BaseModel, Field
|
7
|
-
from typing import Optional
|
8
7
|
|
9
|
-
class
|
8
|
+
class User (BaseModel):
|
10
9
|
"""
|
11
10
|
Function user profile.
|
12
11
|
|
@@ -21,15 +20,10 @@ class Profile (BaseModel):
|
|
21
20
|
github (str): User GitHub handle.
|
22
21
|
"""
|
23
22
|
username: str = Field(description="Username.")
|
24
|
-
email:
|
25
|
-
created:
|
26
|
-
name:
|
27
|
-
avatar:
|
28
|
-
bio:
|
29
|
-
website:
|
30
|
-
github:
|
31
|
-
|
32
|
-
class User (Profile):
|
33
|
-
"""
|
34
|
-
User.
|
35
|
-
"""
|
23
|
+
email: str | None = Field(default=None, description="User email address.")
|
24
|
+
created: str | None = Field(default=None, description="Date created.")
|
25
|
+
name: str | None = Field(default=None, description="User display name.")
|
26
|
+
avatar: str | None = Field(default=None, description="User avatar URL.")
|
27
|
+
bio: str | None = Field(default=None, description="User bio.")
|
28
|
+
website: str | None = Field(default=None, description="User website.")
|
29
|
+
github: str | None = Field(default=None, description="User GitHub handle.")
|
fxn/version.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: fxn
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.42
|
4
4
|
Summary: Run prediction functions locally in Python. Register at https://fxn.ai.
|
5
5
|
Author-email: "NatML Inc." <hi@fxn.ai>
|
6
|
-
License:
|
6
|
+
License: Apache License
|
7
7
|
Version 2.0, January 2004
|
8
8
|
http://www.apache.org/licenses/
|
9
9
|
|
@@ -227,7 +227,7 @@ Requires-Dist: typer
|
|
227
227
|
|
228
228
|

|
229
229
|
|
230
|
-
[](https://
|
230
|
+
[](https://discord.gg/fxn)
|
231
231
|
|
232
232
|
Run prediction functions (a.k.a "predictors") locally in your Python apps, with full GPU acceleration and zero dependencies.
|
233
233
|
|
@@ -286,7 +286,7 @@ ___
|
|
286
286
|
|
287
287
|
## Useful Links
|
288
288
|
- [Discover predictors to use in your apps](https://fxn.ai/explore).
|
289
|
-
- [Join our Discord community](https://
|
289
|
+
- [Join our Discord community](https://discord.gg/fxn).
|
290
290
|
- [Check out our docs](https://docs.fxn.ai).
|
291
291
|
- Learn more about us [on our blog](https://blog.fxn.ai).
|
292
292
|
- Reach out to us at [hi@fxn.ai](mailto:hi@fxn.ai).
|
@@ -0,0 +1,47 @@
|
|
1
|
+
fxn/__init__.py,sha256=co_h8b85Oz3gyrT8T30RbwFQZ8Zf0i57ynGC2H44VZs,207
|
2
|
+
fxn/client.py,sha256=i56oIr4f4ODjKhnD2EugBWQULVubIIFHqqBsoix23xw,1666
|
3
|
+
fxn/function.py,sha256=JBZnGaLedgoY-wV5Tg-Rxwpd3tK_ADkD0Qve45NBaA0,1342
|
4
|
+
fxn/version.py,sha256=-M_EgT0O4ScSm10y5QibgzW8y3KbHfvkosDKMCfirOQ,95
|
5
|
+
fxn/beta/__init__.py,sha256=gKoDhuXtXCjdhUYUqmF0gDPMhJfg3UwFgbvMtRB5ipo,111
|
6
|
+
fxn/beta/client.py,sha256=x1AVAz0PlX0Wnemi7KXk5XfC8R6HC7vOQaGUviPJLN8,363
|
7
|
+
fxn/beta/prediction.py,sha256=9DTBahNF6m0TicLab2o9e8IKpiSV6K7cUSTYaFju0ZU,356
|
8
|
+
fxn/beta/remote.py,sha256=MMFM6QYyxNkpf2czql_JZz9dVbuWHIzhC4mq7pcyPdo,7778
|
9
|
+
fxn/c/__init__.py,sha256=NMIduqO_MYtI9jVCu6ZxvbBtYQXoQyNEWblNy3m2UPY,313
|
10
|
+
fxn/c/configuration.py,sha256=Jq4kWLu3xb1MWjkfNA4xPr_TykABppbHctUEOHBFdRM,4887
|
11
|
+
fxn/c/fxnc.py,sha256=YrvwOlzPmTlSDuz2zmKZfws2WK5BY4YZ62edoplcMJU,1381
|
12
|
+
fxn/c/map.py,sha256=47fBJ0Q6uB_xeW3sn9aCLYJ539edg8ff9DU-EIfWRGA,2352
|
13
|
+
fxn/c/prediction.py,sha256=-d-5yreFAaRS-nDHzhfabRNtgYcmJGiY_N2dt09gk84,2689
|
14
|
+
fxn/c/predictor.py,sha256=48poLj1AthzCgU9n6Wv9gL8o4gFucIlOnBO2wdor6r0,1925
|
15
|
+
fxn/c/stream.py,sha256=Y1Xv1Bt3_qlnWg9rCn7NWESpouF1eKMzDiQjhZWbXTg,1105
|
16
|
+
fxn/c/value.py,sha256=zkmuKb153UUEnenPO560gXFzxJ_ATvs8_HM-j3OLrJU,7362
|
17
|
+
fxn/cli/__init__.py,sha256=OBwaKLyHBqUUqwJD6waGzRRosMwbisLxCPgki0Ye_lU,1126
|
18
|
+
fxn/cli/auth.py,sha256=6iGbNbjxfCr8OZT3_neLThXdWeKRBZATwru8vU0XmRw,1688
|
19
|
+
fxn/cli/misc.py,sha256=LcJbCj_GAgtGraTRva2zHHOPpNwI6SOFntRksxwlqvM,843
|
20
|
+
fxn/cli/predictions.py,sha256=HN7-2BLTgwSn_4LYJQ7Ez9TpTKAZfiEGB62eMF_USaA,3084
|
21
|
+
fxn/cli/predictors.py,sha256=t4DYwGTw_3z0dNDSqLmGmWeksPExGVPHyhHsxmVZk48,447
|
22
|
+
fxn/compile/__init__.py,sha256=BXIcV2Ghp8YkfYZyhHuZjjV3BCLSuaoiTgu9YeFb-w0,130
|
23
|
+
fxn/compile/compile.py,sha256=7PzPEjmHu_mQMoLcRrFOe1TJ11iZMgxcGt4rESqk6fg,3040
|
24
|
+
fxn/compile/sandbox.py,sha256=3ewg1C3lST0KETxkx1qmqMuqcj6YJHBMdCVq4ne-2l8,5425
|
25
|
+
fxn/compile/signature.py,sha256=QiB546g5p_MfiGt8hRi5BZ-_cmGaZm8vuYs47m2W-XM,6436
|
26
|
+
fxn/lib/__init__.py,sha256=-w1ikmmki5NMpzJjERW-O4SwOfBNkimej_0jL8ujYRk,71
|
27
|
+
fxn/lib/linux/arm64/libFunction.so,sha256=NU9PEuQNObqtWPr5vXrWeQuYhzBfmX_Z4guaregFjrI,207632
|
28
|
+
fxn/lib/linux/x86_64/libFunction.so,sha256=qZNlczayaaHIP_tJ9eeZ1TVpV1Os-ztvSWOoBuY9yWE,236272
|
29
|
+
fxn/lib/macos/arm64/Function.dylib,sha256=ODM3zDbI4Tomx7_QSvnqOE42OBYYblntkSq6gftBP4c,263664
|
30
|
+
fxn/lib/macos/x86_64/Function.dylib,sha256=qIu4dhx0Xk5dQHgTnZTcm2IpoMYJwRPmKRi9J-UnkAY,263680
|
31
|
+
fxn/lib/windows/arm64/Function.dll,sha256=FyL-oipK9wSxXdbD9frc8QFbUKTPMCdtmCkCT8ooIIM,419328
|
32
|
+
fxn/lib/windows/x86_64/Function.dll,sha256=iL6w1FwDgBkHlNhQmhE7XgfoeHsiYQgpVGzeGDdHGUw,454656
|
33
|
+
fxn/services/__init__.py,sha256=Bif8IttwJ089mSRsd3MFdob7z2eF-MKigKu4ZQFZBCQ,190
|
34
|
+
fxn/services/prediction.py,sha256=IKudi7n3bm-RAW26dg188ItDgGnJcW4rcN48LD37CEg,10185
|
35
|
+
fxn/services/predictor.py,sha256=Wl_7YKiD5mTpC5x2Zaq4BpatRjwRUX8Th9GIrwd38MA,791
|
36
|
+
fxn/services/user.py,sha256=ADl5MFLsk4K0altgKHnI-i64E3g1wU3e56Noq_ciRuk,685
|
37
|
+
fxn/types/__init__.py,sha256=MEg71rzbGgoWfgB4Yi5QvxbnovHTZRIzCUZLtWtWP1E,292
|
38
|
+
fxn/types/dtype.py,sha256=b0V91aknED2Ql0_BOG_vEg__YJVJByxsgB0cR4rtotE,617
|
39
|
+
fxn/types/prediction.py,sha256=YVnRcqm6IPEx0796OuT3dqn_jOPjhWblzuM2lkk-Vzo,2173
|
40
|
+
fxn/types/predictor.py,sha256=51hhb1rCYFt_r86pbOIVeV_tXYE6BVhcNP27_xmQG1Q,4006
|
41
|
+
fxn/types/user.py,sha256=Z44TwEocyxSrfKyzcNfmAXUrpX_Ry8fJ7MffSxRn4oU,1071
|
42
|
+
fxn-0.0.42.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
43
|
+
fxn-0.0.42.dist-info/METADATA,sha256=RM5c7vePEj9cP3OSysoHclvklaV5-byVneeQnhVSKuU,16122
|
44
|
+
fxn-0.0.42.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
45
|
+
fxn-0.0.42.dist-info/entry_points.txt,sha256=O_AwD5dYaeB-YT1F9hPAPuDYCkw_W0tdNGYbc5RVR2k,45
|
46
|
+
fxn-0.0.42.dist-info/top_level.txt,sha256=1ULIEGrnMlhId8nYAkjmRn9g3KEFuHKboq193SEKQkA,4
|
47
|
+
fxn-0.0.42.dist-info/RECORD,,
|
fxn/api/__init__.py
DELETED
fxn/api/client.py
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Function
|
3
|
-
# Copyright © 2024 NatML Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
|
6
|
-
from requests import post
|
7
|
-
from typing import Any, Dict
|
8
|
-
|
9
|
-
class GraphClient:
|
10
|
-
"""
|
11
|
-
Function graph API client.
|
12
|
-
"""
|
13
|
-
|
14
|
-
def __init__(self, access_key: str, api_url: str) -> None:
|
15
|
-
self.access_key = access_key
|
16
|
-
self.api_url = api_url
|
17
|
-
|
18
|
-
def query (self, query: str, variables: dict=None) -> Dict[str, Any]:
|
19
|
-
"""
|
20
|
-
Query the Function graph API.
|
21
|
-
|
22
|
-
Parameters:
|
23
|
-
query (str): Graph query.
|
24
|
-
variables (dict): Input variables.
|
25
|
-
|
26
|
-
Returns:
|
27
|
-
dict: Response dictionary.
|
28
|
-
"""
|
29
|
-
# Request
|
30
|
-
response = post(
|
31
|
-
f"{self.api_url}/graph",
|
32
|
-
json={ "query": query, "variables": variables },
|
33
|
-
headers={ "Authorization": f"Bearer {self.access_key}" } if self.access_key else { }
|
34
|
-
)
|
35
|
-
payload = response.json()
|
36
|
-
# Check error
|
37
|
-
try:
|
38
|
-
response.raise_for_status()
|
39
|
-
except Exception as ex:
|
40
|
-
error = payload["errors"][0]["message"] if "errors" in payload else str(ex)
|
41
|
-
raise RuntimeError(error)
|
42
|
-
# Return
|
43
|
-
return payload["data"]
|
fxn/c/dtype.py
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Function
|
3
|
-
# Copyright © 2024 NatML Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
|
6
|
-
from ctypes import c_int
|
7
|
-
|
8
|
-
class FXNDtype(c_int):
|
9
|
-
NULL = 0
|
10
|
-
FLOAT16 = 1
|
11
|
-
FLOAT32 = 2
|
12
|
-
FLOAT64 = 3
|
13
|
-
INT8 = 4
|
14
|
-
INT16 = 5
|
15
|
-
INT32 = 6
|
16
|
-
INT64 = 7
|
17
|
-
UINT8 = 8
|
18
|
-
UINT16 = 9
|
19
|
-
UINT32 = 10
|
20
|
-
UINT64 = 11
|
21
|
-
BOOL = 12
|
22
|
-
STRING = 13
|
23
|
-
LIST = 14
|
24
|
-
DICT = 15
|
25
|
-
IMAGE = 16
|
26
|
-
BINARY = 17
|