-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathagent_code_context.py
More file actions
78 lines (49 loc) · 2.4 KB
/
agent_code_context.py
File metadata and controls
78 lines (49 loc) · 2.4 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
68
69
70
71
72
73
74
75
76
77
78
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from pydantic import Field as FieldInfo
from .._models import BaseModel
from .shared.state import State
__all__ = ["AgentCodeContext", "ContextURL", "PullRequest", "PullRequestRepository"]
class ContextURL(BaseModel):
environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None)
url: Optional[str] = None
class PullRequestRepository(BaseModel):
"""Repository information"""
clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None)
host: Optional[str] = None
name: Optional[str] = None
owner: Optional[str] = None
class PullRequest(BaseModel):
"""
Pull request context - optional metadata about the PR being worked on
This is populated when the agent execution is triggered by a PR workflow
or when explicitly provided through the browser extension
"""
id: Optional[str] = None
"""Unique identifier from the source system (e.g., "123" for GitHub PR #123)"""
author: Optional[str] = None
"""Author name as provided by the SCM system"""
draft: Optional[bool] = None
"""Whether this is a draft pull request"""
from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None)
"""Source branch name (the branch being merged from)"""
repository: Optional[PullRequestRepository] = None
"""Repository information"""
state: Optional[State] = None
"""Current state of the pull request"""
title: Optional[str] = None
"""Pull request title"""
to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None)
"""Target branch name (the branch being merged into)"""
url: Optional[str] = None
"""Pull request URL (e.g., "https://github.com/owner/repo/pull/123")"""
class AgentCodeContext(BaseModel):
context_url: Optional[ContextURL] = FieldInfo(alias="contextUrl", default=None)
environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None)
project_id: Optional[str] = FieldInfo(alias="projectId", default=None)
pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None)
"""
Pull request context - optional metadata about the PR being worked on This is
populated when the agent execution is triggered by a PR workflow or when
explicitly provided through the browser extension
"""