mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
52 lines
1.2 KiB
Python
52 lines
1.2 KiB
Python
from dataclasses import dataclass
|
|
from enum import Enum
|
|
|
|
from jinja2 import Environment
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class GitLabResourceType(Enum):
|
|
GROUP = 'group'
|
|
SUBGROUP = 'subgroup'
|
|
PROJECT = 'project'
|
|
|
|
|
|
class PRStatus(Enum):
|
|
CLOSED = 'CLOSED'
|
|
MERGED = 'MERGED'
|
|
|
|
|
|
class UserData(BaseModel):
|
|
user_id: int
|
|
username: str
|
|
keycloak_user_id: str
|
|
|
|
|
|
@dataclass
|
|
class SummaryExtractionTracker:
|
|
conversation_id: str
|
|
should_extract: bool
|
|
send_summary_instruction: bool
|
|
|
|
|
|
@dataclass
|
|
class ResolverViewInterface(SummaryExtractionTracker):
|
|
installation_id: int
|
|
user_info: UserData
|
|
issue_number: int
|
|
full_repo_name: str
|
|
is_public_repo: bool
|
|
raw_payload: dict
|
|
|
|
def _get_instructions(self, jinja_env: Environment) -> tuple[str, str]:
|
|
"Instructions passed when conversation is first initialized"
|
|
raise NotImplementedError()
|
|
|
|
async def create_new_conversation(self, jinja_env: Environment, token: str):
|
|
"Create a new conversation"
|
|
raise NotImplementedError()
|
|
|
|
def get_callback_id(self) -> str:
|
|
"Unique callback id for subscribription made to EventStream for fetching agent summary"
|
|
raise NotImplementedError()
|