Model for requesting a chat completion.
| 54 | content: str |
| 55 | |
| 56 | class ChatCompletionRequest(BaseModel): |
| 57 | """ |
| 58 | Model for requesting a chat completion. |
| 59 | """ |
| 60 | repo_url: str = Field(..., description="URL of the repository to query") |
| 61 | messages: List[ChatMessage] = Field(..., description="List of chat messages") |
| 62 | filePath: Optional[str] = Field(None, description="Optional path to a file in the repository to include in the prompt") |
| 63 | token: Optional[str] = Field(None, description="Personal access token for private repositories") |
| 64 | type: Optional[str] = Field("github", description="Type of repository (e.g., 'github', 'gitlab', 'bitbucket')") |
| 65 | |
| 66 | # model parameters |
| 67 | provider: str = Field("google", description="Model provider (google, openai, openrouter, ollama, bedrock, azure, dashscope)") |
| 68 | model: Optional[str] = Field(None, description="Model name for the specified provider") |
| 69 | |
| 70 | language: Optional[str] = Field("en", description="Language for content generation (e.g., 'en', 'ja', 'zh', 'es', 'kr', 'vi')") |
| 71 | excluded_dirs: Optional[str] = Field(None, description="Comma-separated list of directories to exclude from processing") |
| 72 | excluded_files: Optional[str] = Field(None, description="Comma-separated list of file patterns to exclude from processing") |
| 73 | included_dirs: Optional[str] = Field(None, description="Comma-separated list of directories to include exclusively") |
| 74 | included_files: Optional[str] = Field(None, description="Comma-separated list of file patterns to include exclusively") |
| 75 | |
| 76 | @app.post("/chat/completions/stream") |
| 77 | async def chat_completions_stream(request: ChatCompletionRequest): |
nothing calls this directly
no outgoing calls
no test coverage detected