-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: separate frontend from backend so we can host the frontend (#242)
* fix: prompt engineer agent for map decomposition * feat: host application * chore: update azure * chore: update azure * chore: update azure * fix: adding default ops in init * chore: refactoring fastapi models * feat: allowing frontend to use a separate server for backend * feat: allowing frontend to use a separate server for backend * feat: allowing frontend to use a separate server for backend * feat: allowing frontend to use a separate server for backend * feat: allowing frontend to use a separate server for backend * feat: allowing frontend to use a separate server for backend
- Loading branch information
1 parent
0981285
commit f1a12d2
Showing
47 changed files
with
3,906 additions
and
1,995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,50 @@ | ||
import importlib.metadata | ||
from docetl.operations.cluster import ClusterOperation | ||
from docetl.operations.code_operations import CodeFilterOperation, CodeMapOperation, CodeReduceOperation | ||
from docetl.operations.equijoin import EquijoinOperation | ||
from docetl.operations.filter import FilterOperation | ||
from docetl.operations.gather import GatherOperation | ||
from docetl.operations.map import MapOperation | ||
from docetl.operations.reduce import ReduceOperation | ||
from docetl.operations.resolve import ResolveOperation | ||
from docetl.operations.split import SplitOperation | ||
from docetl.operations.sample import SampleOperation | ||
from docetl.operations.unnest import UnnestOperation | ||
|
||
|
||
mapping = { | ||
"cluster": ClusterOperation, | ||
"code_filter": CodeFilterOperation, | ||
"code_map": CodeMapOperation, | ||
"code_reduce": CodeReduceOperation, | ||
"equijoin": EquijoinOperation, | ||
"filter": FilterOperation, | ||
"gather": GatherOperation, | ||
"map": MapOperation, | ||
"reduce": ReduceOperation, | ||
"resolve": ResolveOperation, | ||
"split": SplitOperation, | ||
"sample": SampleOperation, | ||
"unnest": UnnestOperation, | ||
} | ||
|
||
def get_operation(operation_type: str): | ||
"""Loads a single operation by name""" | ||
try: | ||
entrypoint = importlib.metadata.entry_points(group="docetl.operation")[ | ||
operation_type | ||
] | ||
except KeyError as e: | ||
return entrypoint.load() | ||
except KeyError: | ||
if operation_type in mapping: | ||
return mapping[operation_type] | ||
raise KeyError(f"Unrecognized operation {operation_type}") | ||
return entrypoint.load() | ||
|
||
def get_operations(): | ||
"""Load all available operations and return them as a dictionary""" | ||
return { | ||
operations = mapping.copy() | ||
operations.update({ | ||
op.name: op.load() | ||
for op in importlib.metadata.entry_points(group="docetl.operation") | ||
} | ||
}) | ||
return operations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.