-
Notifications
You must be signed in to change notification settings - Fork 6
✨ add support for split utility #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sebastianMindee
wants to merge
17
commits into
main
Choose a base branch
from
add-v2-split
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2179d3a
:sparkles: add support for split
sebastianMindee eeecd82
fix typo in import
sebastianMindee f95a200
fix again
sebastianMindee 272c66b
fix issues
sebastianMindee c434076
fix tests
sebastianMindee 56b60c2
add unit test
sebastianMindee 498a5af
fix forgor :skull:
sebastianMindee a0d6cbf
fix broken syntax for 3.8
sebastianMindee 1957604
fix test
sebastianMindee a63ea0a
rename client methods & deprecate old ones
sebastianMindee 7c23503
move model param logic to their own classes
sebastianMindee 30a6a75
add full support for split
sebastianMindee 6c97e7a
revise entire endpoint slug generation system & refactor input parame…
sebastianMindee 45af404
fix display & test
sebastianMindee 52a5dd6
fix name
sebastianMindee 1d46323
add missing name
sebastianMindee b704ca6
refacto into new syntax
sebastianMindee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,44 @@ | ||
| from abc import ABC | ||
| from dataclasses import dataclass, field | ||
| from typing import Dict, Optional, List, Union | ||
|
|
||
| from mindee.input.polling_options import PollingOptions | ||
|
|
||
|
|
||
| @dataclass | ||
| class BaseParameters(ABC): | ||
| """Base class for parameters accepted by all V2 endpoints.""" | ||
|
|
||
| _slug: str = field(init=False) | ||
| """Slug of the endpoint.""" | ||
|
|
||
| model_id: str | ||
| """ID of the model, required.""" | ||
| alias: Optional[str] = None | ||
| """Use an alias to link the file to your own DB. If empty, no alias will be used.""" | ||
| webhook_ids: Optional[List[str]] = None | ||
| """IDs of webhooks to propagate the API response to.""" | ||
| polling_options: Optional[PollingOptions] = None | ||
| """Options for polling. Set only if having timeout issues.""" | ||
| close_file: bool = True | ||
| """Whether to close the file after product.""" | ||
|
|
||
| def get_config(self) -> Dict[str, Union[str, List[str]]]: | ||
| """ | ||
| Return the parameters as a config dictionary. | ||
|
|
||
| :return: A dict of parameters. | ||
| """ | ||
| data: Dict[str, Union[str, List[str]]] = { | ||
| "model_id": self.model_id, | ||
| } | ||
| if self.alias is not None: | ||
| data["alias"] = self.alias | ||
| if self.webhook_ids and len(self.webhook_ids) > 0: | ||
| data["webhook_ids"] = self.webhook_ids | ||
| return data | ||
|
|
||
| @classmethod | ||
| def get_enqueue_slug(cls) -> str: | ||
| """Getter for the enqueue slug.""" | ||
| return cls._slug |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.