Custom i18n system with typed translation dictionaries (~570 keys), LanguageProvider context, and useTranslation hook. All 31 components and pages wired with t() calls. Chatbot backend passes language hint to Claude for Ukrainian responses. Language preference persists via localStorage. SEO meta tags and html lang attribute update dynamically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
865 B
Python
37 lines
865 B
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ChatLead(BaseModel):
|
|
name: str = ""
|
|
email: str = ""
|
|
company: str = ""
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
session_id: str = Field(..., min_length=1, max_length=64)
|
|
message: str = Field(..., min_length=1, max_length=500)
|
|
page_context: str = Field(default="/", max_length=200)
|
|
language: str = Field(default="en", max_length=5)
|
|
lead: ChatLead | None = None
|
|
|
|
|
|
class ChatResponse(BaseModel):
|
|
reply: str
|
|
sender: str = "bot" # "bot" | "human"
|
|
session_id: str
|
|
message_count: int
|
|
rate_limited: bool = False
|
|
|
|
|
|
class LeadData(BaseModel):
|
|
name: str = ""
|
|
email: str = ""
|
|
company: str = ""
|
|
need: str = ""
|
|
|
|
|
|
class RocketChatWebhook(BaseModel):
|
|
token: str = ""
|
|
channel_id: str = ""
|
|
user_name: str = ""
|
|
text: str = ""
|