Model for requesting a chat completion.
| 40 | content: str |
| 41 | |
| 42 | class ChatCompletionRequest(BaseModel): |
| 43 | """ |
| 44 | Model for requesting a chat completion. |
| 45 | """ |
| 46 | repo_url: str = Field(..., description="URL of the repository to query") |
| 47 | messages: List[ChatMessage] = Field(..., description="List of chat messages") |
| 48 | filePath: Optional[str] = Field(None, description="Optional path to a file in the repository to include in the prompt") |
| 49 | token: Optional[str] = Field(None, description="Personal access token for private repositories") |
| 50 | type: Optional[str] = Field("github", description="Type of repository (e.g., 'github', 'gitlab', 'bitbucket')") |
| 51 | |
| 52 | # model parameters |
| 53 | provider: str = Field( |
| 54 | "google", |
| 55 | description="Model provider (google, openai, openrouter, ollama, bedrock, azure, dashscope)", |
| 56 | ) |
| 57 | model: Optional[str] = Field(None, description="Model name for the specified provider") |
| 58 | |
| 59 | language: Optional[str] = Field("en", description="Language for content generation (e.g., 'en', 'ja', 'zh', 'es', 'kr', 'vi')") |
| 60 | excluded_dirs: Optional[str] = Field(None, description="Comma-separated list of directories to exclude from processing") |
| 61 | excluded_files: Optional[str] = Field(None, description="Comma-separated list of file patterns to exclude from processing") |
| 62 | included_dirs: Optional[str] = Field(None, description="Comma-separated list of directories to include exclusively") |
| 63 | included_files: Optional[str] = Field(None, description="Comma-separated list of file patterns to include exclusively") |
| 64 | |
| 65 | async def handle_websocket_chat(websocket: WebSocket): |
| 66 | """ |
no outgoing calls
no test coverage detected