Spaces:
Sleeping
Sleeping
File size: 2,443 Bytes
fd52f31 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
from pydantic import BaseModel, Field
from typing import Optional, List, Dict, Union, Any
from datetime import datetime
class UserCreate(BaseModel):
username: str
password: str
class UserLogin(BaseModel):
username: str
password: str
class Token(BaseModel):
access_token: str
token_type: str
class UserUpdate(BaseModel):
password: str
class UserResponse(BaseModel):
username: str
class AgentCreate(BaseModel):
name: str
voice_id: str
voice_name: str
voice_description: str
speed: float
pitch: float
volume: float
output_format: str
personality: str = None # Optional field for agent personality
class AgentResponse(BaseModel):
agent_id: str
name: str
voice_id: str
voice_name: str
voice_description: str
speed: float
pitch: float
volume: float
output_format: str
user_id: str
personality: str = None # Optional field for agent personality
class PodcastRequest(BaseModel):
topic: str
believer_voice_id: str
skeptic_voice_id: str
class ConversationBlock(BaseModel):
name: str
input: str
silence_before: int
voice_id: str
emotion: str
model: str
speed: float
duration: int
class PodcastResponse(BaseModel):
podcast_id: str
audio_url: Optional[str]
topic: str
error: Optional[str]
# Models for structured debate transcript and insights
class TranscriptEntry(BaseModel):
agentId: str
agentName: str
turn: int
content: str
class InsightsData(BaseModel):
topic: str
research: str
transcript: List[TranscriptEntry]
keyInsights: List[str]
conclusion: str
# New Workflow Models
class WorkflowCreate(BaseModel):
name: str
description: str
nodes: List[Dict]
edges: List[Dict]
insights: Optional[Union[InsightsData, str]] = None
class WorkflowResponse(BaseModel):
id: str
name: str
description: str
nodes: List[Dict]
edges: List[Dict]
insights: Optional[Union[InsightsData, str]] = None
user_id: str
created_at: Optional[str]
updated_at: Optional[str]
class TextPodcastRequest(BaseModel):
text: str
voice_id: str = "alloy"
emotion: str = "neutral"
speed: float = 1.0
title: Optional[str] = None
class TextPodcastResponse(BaseModel):
audio_url: str
duration: Optional[float]
status: str
error: Optional[str]
updated_at: Optional[str]
|