mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
from dataclasses import dataclass, field
|
|
from datetime import datetime, timezone
|
|
|
|
from openhands.app_server.app_conversation.app_conversation_models import (
|
|
ConversationTrigger,
|
|
)
|
|
from openhands.integrations.service_types import ProviderType
|
|
|
|
# Re-export for backward compatibility
|
|
__all__ = ['ConversationTrigger', 'ConversationMetadata']
|
|
|
|
|
|
@dataclass
|
|
class ConversationMetadata:
|
|
conversation_id: str
|
|
selected_repository: str | None
|
|
user_id: str | None = None
|
|
selected_branch: str | None = None
|
|
git_provider: ProviderType | None = None
|
|
title: str | None = None
|
|
last_updated_at: datetime | None = None
|
|
trigger: ConversationTrigger | None = None
|
|
pr_number: list[int] = field(default_factory=list)
|
|
created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
|
|
llm_model: str | None = None
|
|
# Cost and token metrics
|
|
accumulated_cost: float = 0.0
|
|
prompt_tokens: int = 0
|
|
completion_tokens: int = 0
|
|
total_tokens: int = 0
|
|
# Tags for automation/plugin context (key-value pairs stored as JSON)
|
|
tags: dict[str, str] | None = None
|
|
# V1 compatibility
|
|
sandbox_id: str | None = None
|
|
conversation_version: str | None = None
|
|
public: bool | None = None
|