forked from CodeBoarding/CodeBoarding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
67 lines (53 loc) · 1.46 KB
/
Copy pathschemas.py
File metadata and controls
67 lines (53 loc) · 1.46 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""Pydantic models for telemetry payloads.
Event models are dumped with ``model_dump(exclude_none=True)`` at the call site
so optional fields are simply absent rather than arriving as ``null``.
"""
from pydantic import BaseModel
class LanguageStat(BaseModel):
language: str
loc: int
percentage: float
class RepoScanned(BaseModel):
version: str
total_loc: int
language_count: int
languages: list[LanguageStat]
stack: str
run_id: str | None = None
class LspAnalysisResult(BaseModel):
version: str
language: str
loc: int
status: str
duration_ms: int
source_file_count: int = 0
node_count: int = 0
edge_count: int = 0
reference_count: int = 0
diagnostic_file_count: int = 0
diagnostic_count: int = 0
quality_status: str = "ok"
zero_nodes_with_loc: bool = False
zero_edges_with_loc: bool = False
run_id: str | None = None
class AnalysisStarted(BaseModel):
command: str
version: str
run_id: str | None = None
depth_level: int | None = None
class AnalysisCompleted(BaseModel):
command: str
version: str
status: str
duration_ms: int
model_name: str | None = None
total_tokens: int = 0
input_tokens: int = 0
output_tokens: int = 0
run_id: str | None = None
depth_level: int | None = None
class TokenSnapshot(BaseModel):
model_name: str | None = None
total_tokens: int = 0
input_tokens: int = 0
output_tokens: int = 0