-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] change all responses models to custom one
- Loading branch information
Showing
69 changed files
with
275 additions
and
201 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
edenai_apis/features/audio/speech_to_text_async/speech_to_text_async_dataclass.py
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,22 +1,23 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import Sequence, Optional | ||
|
||
from pydantic import BaseModel, StrictStr, Field | ||
|
||
|
||
class SpeechDiarizationEntry(BaseModel): | ||
class SpeechDiarizationEntry(NoRaiseBaseModel): | ||
segment: StrictStr | ||
start_time: Optional[StrictStr] | ||
end_time: Optional[StrictStr] | ||
speaker: int | ||
confidence: Optional[float] | ||
|
||
|
||
class SpeechDiarization(BaseModel): | ||
class SpeechDiarization(NoRaiseBaseModel): | ||
total_speakers: int | ||
entries: Sequence[SpeechDiarizationEntry] = Field(default_factory=list) | ||
error_message: Optional[str] = None | ||
|
||
|
||
class SpeechToTextAsyncDataClass(BaseModel): | ||
class SpeechToTextAsyncDataClass(NoRaiseBaseModel): | ||
text: StrictStr | ||
diarization: SpeechDiarization |
3 changes: 2 additions & 1 deletion
3
edenai_apis/features/audio/text_to_speech/text_to_speech_dataclass.py
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
3 changes: 2 additions & 1 deletion
3
edenai_apis/features/audio/text_to_speech_async/text_to_speech_async_dataclass.py
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
7 changes: 4 additions & 3 deletions
7
edenai_apis/features/image/anonymization/anonymization_dataclass.py
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,22 +1,23 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import Sequence, Optional | ||
|
||
from pydantic import BaseModel, StrictStr, Field | ||
|
||
|
||
class AnonymizationBoundingBox(BaseModel): | ||
class AnonymizationBoundingBox(NoRaiseBaseModel): | ||
x_min: Optional[float] | ||
x_max: Optional[float] | ||
y_min: Optional[float] | ||
y_max: Optional[float] | ||
|
||
|
||
class AnonymizationItem(BaseModel): | ||
class AnonymizationItem(NoRaiseBaseModel): | ||
kind: StrictStr | ||
confidence: float | ||
bounding_boxes: AnonymizationBoundingBox | ||
|
||
|
||
class AnonymizationDataClass(BaseModel): | ||
class AnonymizationDataClass(NoRaiseBaseModel): | ||
image: StrictStr | ||
image_resource_url: StrictStr | ||
items: Sequence[AnonymizationItem] = Field(default_factory=list) |
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
5 changes: 3 additions & 2 deletions
5
edenai_apis/features/image/embeddings/embeddings_dataclass.py
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,11 +1,12 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import Sequence | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class EmbeddingDataClass(BaseModel): | ||
class EmbeddingDataClass(NoRaiseBaseModel): | ||
embedding: Sequence[float] | ||
|
||
|
||
class EmbeddingsDataClass(BaseModel): | ||
class EmbeddingsDataClass(NoRaiseBaseModel): | ||
items: Sequence[EmbeddingDataClass] = Field(default_factory=list) |
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
7 changes: 4 additions & 3 deletions
7
edenai_apis/features/image/face_compare/face_compare_dataclass.py
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,20 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import Optional, Sequence | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class FaceCompareBoundingBox(BaseModel): | ||
class FaceCompareBoundingBox(NoRaiseBaseModel): | ||
top: Optional[float] | ||
left: Optional[float] | ||
height: Optional[float] | ||
width: Optional[float] | ||
|
||
|
||
class FaceMatch(BaseModel): | ||
class FaceMatch(NoRaiseBaseModel): | ||
confidence: Optional[float] | ||
bounding_box: FaceCompareBoundingBox | ||
|
||
|
||
class FaceCompareDataClass(BaseModel): | ||
class FaceCompareDataClass(NoRaiseBaseModel): | ||
items: Sequence[FaceMatch] = Field(default_factory=list) |
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
3 changes: 2 additions & 1 deletion
3
edenai_apis/features/image/face_recognition/add_face/face_recognition_add_face_dataclass.py
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,7 +1,8 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import List | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class FaceRecognitionAddFaceDataClass(BaseModel): | ||
class FaceRecognitionAddFaceDataClass(NoRaiseBaseModel): | ||
face_ids: List[str] |
3 changes: 2 additions & 1 deletion
3
.../image/face_recognition/create_collection/face_recognition_create_collection_dataclass.py
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,5 +1,6 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from pydantic import BaseModel | ||
|
||
|
||
class FaceRecognitionCreateCollectionDataClass(BaseModel): | ||
class FaceRecognitionCreateCollectionDataClass(NoRaiseBaseModel): | ||
collection_id: str |
3 changes: 2 additions & 1 deletion
3
.../image/face_recognition/delete_collection/face_recognition_delete_collection_dataclass.py
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,5 +1,6 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from pydantic import BaseModel | ||
|
||
|
||
class FaceRecognitionDeleteCollectionDataClass(BaseModel): | ||
class FaceRecognitionDeleteCollectionDataClass(NoRaiseBaseModel): | ||
deleted: bool |
3 changes: 2 additions & 1 deletion
3
...pis/features/image/face_recognition/delete_face/face_recognition_delete_face_dataclass.py
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,5 +1,6 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from pydantic import BaseModel | ||
|
||
|
||
class FaceRecognitionDeleteFaceDataClass(BaseModel): | ||
class FaceRecognitionDeleteFaceDataClass(NoRaiseBaseModel): | ||
deleted: bool |
3 changes: 2 additions & 1 deletion
3
...es/image/face_recognition/list_collections/face_recognition_list_collections_dataclass.py
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,7 +1,8 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import List | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class FaceRecognitionListCollectionsDataClass(BaseModel): | ||
class FaceRecognitionListCollectionsDataClass(NoRaiseBaseModel): | ||
collections: List[str] = Field(default_factory=list) |
3 changes: 2 additions & 1 deletion
3
..._apis/features/image/face_recognition/list_faces/face_recognition_list_faces_dataclass.py
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,7 +1,8 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import List | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class FaceRecognitionListFacesDataClass(BaseModel): | ||
class FaceRecognitionListFacesDataClass(NoRaiseBaseModel): | ||
face_ids: List[str] |
5 changes: 3 additions & 2 deletions
5
...ai_apis/features/image/face_recognition/recognize/face_recognition_recognize_dataclass.py
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,12 +1,13 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import List | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class FaceRecognitionRecognizedFaceDataClass(BaseModel): | ||
class FaceRecognitionRecognizedFaceDataClass(NoRaiseBaseModel): | ||
confidence: float | ||
face_id: str | ||
|
||
|
||
class FaceRecognitionRecognizeDataClass(BaseModel): | ||
class FaceRecognitionRecognizeDataClass(NoRaiseBaseModel): | ||
items: List[FaceRecognitionRecognizedFaceDataClass] = Field(default_factory=list) |
5 changes: 3 additions & 2 deletions
5
edenai_apis/features/image/generation/generation_dataclass.py
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,12 +1,13 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import Sequence | ||
|
||
from pydantic import BaseModel, Field, StrictStr | ||
|
||
|
||
class GeneratedImageDataClass(BaseModel): | ||
class GeneratedImageDataClass(NoRaiseBaseModel): | ||
image: str | ||
image_resource_url: StrictStr | ||
|
||
|
||
class GenerationDataClass(BaseModel): | ||
class GenerationDataClass(NoRaiseBaseModel): | ||
items: Sequence[GeneratedImageDataClass] = Field(default_factory=list) |
11 changes: 6 additions & 5 deletions
11
edenai_apis/features/image/landmark_detection/landmark_detection_dataclass.py
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,28 +1,29 @@ | ||
from utils.parsing import NoRaiseBaseModel | ||
from typing import Sequence | ||
|
||
from pydantic import BaseModel, Field, StrictStr | ||
|
||
|
||
class LandmarkVertice(BaseModel): | ||
class LandmarkVertice(NoRaiseBaseModel): | ||
x: int | ||
y: int | ||
|
||
|
||
class LandmarkLatLng(BaseModel): | ||
class LandmarkLatLng(NoRaiseBaseModel): | ||
latitude: float | ||
longitude: float | ||
|
||
|
||
class LandmarkLocation(BaseModel): | ||
class LandmarkLocation(NoRaiseBaseModel): | ||
lat_lng: LandmarkLatLng | ||
|
||
|
||
class LandmarkItem(BaseModel): | ||
class LandmarkItem(NoRaiseBaseModel): | ||
description: StrictStr | ||
confidence: float | ||
bounding_box: Sequence[LandmarkVertice] = Field(default_factory=list) | ||
locations: Sequence[LandmarkLocation] = Field(default_factory=list) | ||
|
||
|
||
class LandmarkDetectionDataClass(BaseModel): | ||
class LandmarkDetectionDataClass(NoRaiseBaseModel): | ||
items: Sequence[LandmarkItem] = Field(default_factory=list) |
Oops, something went wrong.