-
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.
cleanup: refactor shared types, deduplicate duplicated types (#41)
* refactor shared types, deduplicate duplicated types * minor path fixes --------- Co-authored-by: Andrew Wang <[email protected]>
- Loading branch information
Showing
15 changed files
with
116 additions
and
129 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pydantic import BaseModel, Field | ||
from typing import Optional | ||
from datetime import datetime | ||
from enum import Enum | ||
|
||
|
||
class ConversionStatus(str, Enum): | ||
SUCCESS = "success" | ||
FAILED = "failed" | ||
|
||
|
||
class PDFConversionResult(BaseModel): | ||
filename: str | ||
content: str = "" | ||
status: ConversionStatus | ||
error: Optional[str] = None | ||
|
||
|
||
class PDFMetadata(BaseModel): | ||
filename: str | ||
markdown: str = "" | ||
summary: str = "" | ||
status: ConversionStatus | ||
error: Optional[str] = None | ||
created_at: datetime = Field(default_factory=datetime.utcnow) |
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,45 @@ | ||
from pydantic import BaseModel | ||
from typing import Optional, Dict, Literal, List | ||
|
||
|
||
class SavedPodcast(BaseModel): | ||
job_id: str | ||
filename: str | ||
created_at: str | ||
size: int | ||
transcription_params: Optional[Dict] = {} | ||
|
||
|
||
class SavedPodcastWithAudio(SavedPodcast): | ||
audio_data: str | ||
|
||
|
||
class DialogueEntry(BaseModel): | ||
text: str | ||
speaker: Literal["speaker-1", "speaker-2"] | ||
|
||
|
||
class Conversation(BaseModel): | ||
scratchpad: str | ||
dialogue: List[DialogueEntry] | ||
|
||
|
||
class SegmentPoint(BaseModel): | ||
description: str | ||
|
||
|
||
class SegmentTopic(BaseModel): | ||
title: str | ||
points: List[SegmentPoint] | ||
|
||
|
||
class PodcastSegment(BaseModel): | ||
section: str | ||
topics: List[SegmentTopic] | ||
duration: int | ||
references: List[str] | ||
|
||
|
||
class PodcastOutline(BaseModel): | ||
title: str | ||
segments: List[PodcastSegment] |
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,14 @@ | ||
from pydantic import BaseModel | ||
from typing import List | ||
|
||
|
||
class ProcessingStep(BaseModel): | ||
step_name: str | ||
prompt: str | ||
response: str | ||
model: str | ||
timestamp: float | ||
|
||
|
||
class PromptTracker(BaseModel): | ||
steps: List[ProcessingStep] |
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