-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
72 additions
and
80 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2024-Present, Syigen Ltd. and Syigen Private Limited. All rights reserved. | ||
# Licensed under the Apache License, Version 2.0 (See LICENSE.md or http://www.apache.org/licenses/LICENSE-2.0). | ||
# | ||
import dataclasses | ||
import uuid | ||
from dataclasses import dataclass | ||
from enum import Enum | ||
from typing import Any, Optional, Dict | ||
|
||
|
||
class ProcessState(Enum): | ||
PENDING = "pending" | ||
PROCESSING = "processing" | ||
ERROR = "error" | ||
SUCCESS = "success" | ||
|
||
|
||
@dataclass | ||
class ProcessRequest: | ||
task_type: str | ||
data: Any | ||
id: str = dataclasses.field(default_factory=lambda: str(uuid.uuid4())) | ||
metadata: Optional[Dict[str, Any]] = None | ||
dependency_data: Optional[Dict[str, Any]] = None | ||
|
||
|
||
@dataclass | ||
class ProcessResponse: | ||
request_id: str | ||
result: Any | ||
status: ProcessState = ProcessState.PENDING # 'success' or 'error' | ||
id: str = dataclasses.field(default_factory=lambda: str(uuid.uuid4())) | ||
error_message: Optional[str] = None | ||
execution_time: Optional[float] = None | ||
metadata: Optional[Dict[str, Any]] = None |
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