File size: 1,529 Bytes
3f04a5e cf5c1e2 1760e74 353a351 1760e74 465ff1f 1760e74 cf5c1e2 3f04a5e cf5c1e2 |
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 |
from typing import Optional
from pydantic import Field
from pydantic_settings import BaseSettings
from enum import Enum
class ChatConfig(BaseSettings):
max_context_chunks: int = Field(
default=5,
description="Maximum number of similar chunks to include in context"
)
similarity_threshold: float = Field(
default=0.7,
description="Minimum similarity score to include a chunk"
)
interface_title: str = Field(
default="KonwLang Codebase Assistant",
description="Title shown in the chat interface"
)
interface_description: str = Field(
default="Ask questions about the codebase and I'll help you understand it!",
description="Description shown in the chat interface"
)
interface_placeholder: str = Field(
default="Ask about the codebase",
description="Placeholder text in the chat interface"
)
max_length_per_chunk: int = Field(
default=8000,
description="Maximum number of characters per chunk"
)
class AnalyticsProvider(str, Enum):
MIXPANEL = "mixpanel"
class ChatbotAnalyticsConfig(BaseSettings):
enabled: bool = Field(
default=False,
description="Enable analytics tracking"
)
provider: AnalyticsProvider = Field(
default=AnalyticsProvider.MIXPANEL,
description="Analytics provider to use for tracking feedback"
)
api_key: Optional[str] = Field(
default=None,
description="api key for feedback tracking"
) |