Skip to content

Commit f7b21f6

Browse files
feat(api): add agent_message parameter to agents.send_to_execution
1 parent 69f8eb6 commit f7b21f6

File tree

8 files changed

+62
-3
lines changed

8 files changed

+62
-3
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 180
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-16b360cee45543059c71209bed8235e5e1a37b61fbeb513a63ee7e67b577e165.yml
3-
openapi_spec_hash: f22e39876f664dced8af26d4bd51f20c
4-
config_hash: 0ec0dc7b6891f666565cf1521a8d172f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b4ac05534b28936c4fe9d86221fb30415a39826e6a5414b5a7ffb2ad87a021ed.yml
3+
openapi_spec_hash: c5ae4a889864c5255ce9aa0a1fe98631
4+
config_hash: 9629844f3bf40631adbcfe7c739494a1

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ Types:
6565
from gitpod.types import (
6666
AgentCodeContext,
6767
AgentExecution,
68+
AgentMessage,
6869
AgentMode,
6970
Prompt,
7071
PromptMetadata,
7172
PromptSpec,
73+
Type,
7274
UserInputBlock,
7375
AgentCreateExecutionConversationTokenResponse,
7476
AgentCreatePromptResponse,

src/gitpod/resources/agents.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from ..types.prompt import Prompt
3737
from ..types.agent_mode import AgentMode
3838
from ..types.agent_execution import AgentExecution
39+
from ..types.agent_message_param import AgentMessageParam
3940
from ..types.user_input_block_param import UserInputBlockParam
4041
from ..types.agent_code_context_param import AgentCodeContextParam
4142
from ..types.agent_create_prompt_response import AgentCreatePromptResponse
@@ -483,6 +484,7 @@ def send_to_execution(
483484
self,
484485
*,
485486
agent_execution_id: str | Omit = omit,
487+
agent_message: AgentMessageParam | Omit = omit,
486488
user_input: UserInputBlockParam | Omit = omit,
487489
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
488490
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -510,6 +512,9 @@ def send_to_execution(
510512
```
511513
512514
Args:
515+
agent_message: AgentMessage is a message sent between agents (e.g. from a parent agent to a
516+
child agent execution, or vice versa).
517+
513518
extra_headers: Send extra headers
514519
515520
extra_query: Add additional query parameters to the request
@@ -523,6 +528,7 @@ def send_to_execution(
523528
body=maybe_transform(
524529
{
525530
"agent_execution_id": agent_execution_id,
531+
"agent_message": agent_message,
526532
"user_input": user_input,
527533
},
528534
agent_send_to_execution_params.AgentSendToExecutionParams,
@@ -1154,6 +1160,7 @@ async def send_to_execution(
11541160
self,
11551161
*,
11561162
agent_execution_id: str | Omit = omit,
1163+
agent_message: AgentMessageParam | Omit = omit,
11571164
user_input: UserInputBlockParam | Omit = omit,
11581165
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11591166
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1181,6 +1188,9 @@ async def send_to_execution(
11811188
```
11821189
11831190
Args:
1191+
agent_message: AgentMessage is a message sent between agents (e.g. from a parent agent to a
1192+
child agent execution, or vice versa).
1193+
11841194
extra_headers: Send extra headers
11851195
11861196
extra_query: Add additional query parameters to the request
@@ -1194,6 +1204,7 @@ async def send_to_execution(
11941204
body=await async_maybe_transform(
11951205
{
11961206
"agent_execution_id": agent_execution_id,
1207+
"agent_message": agent_message,
11971208
"user_input": user_input,
11981209
},
11991210
agent_send_to_execution_params.AgentSendToExecutionParams,

src/gitpod/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from .type import Type as Type
56
from .user import User as User
67
from .veto import Veto as Veto
78
from .group import Group as Group
@@ -99,6 +100,7 @@
99100
from .secret_list_params import SecretListParams as SecretListParams
100101
from .secret_scope_param import SecretScopeParam as SecretScopeParam
101102
from .warm_pool_metadata import WarmPoolMetadata as WarmPoolMetadata
103+
from .agent_message_param import AgentMessageParam as AgentMessageParam
102104
from .event_list_response import EventListResponse as EventListResponse
103105
from .gateway_list_params import GatewayListParams as GatewayListParams
104106
from .group_create_params import GroupCreateParams as GroupCreateParams
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import TypedDict
6+
7+
from .type import Type
8+
9+
__all__ = ["AgentMessageParam"]
10+
11+
12+
class AgentMessageParam(TypedDict, total=False):
13+
"""AgentMessage is a message sent between agents (e.g.
14+
15+
from a parent agent to a
16+
child agent execution, or vice versa).
17+
"""
18+
19+
payload: str
20+
"""Free-form payload of the message."""
21+
22+
type: Type

src/gitpod/types/agent_send_to_execution_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing_extensions import Annotated, TypedDict
66

77
from .._utils import PropertyInfo
8+
from .agent_message_param import AgentMessageParam
89
from .user_input_block_param import UserInputBlockParam
910

1011
__all__ = ["AgentSendToExecutionParams"]
@@ -13,4 +14,10 @@
1314
class AgentSendToExecutionParams(TypedDict, total=False):
1415
agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")]
1516

17+
agent_message: Annotated[AgentMessageParam, PropertyInfo(alias="agentMessage")]
18+
"""AgentMessage is a message sent between agents (e.g.
19+
20+
from a parent agent to a child agent execution, or vice versa).
21+
"""
22+
1623
user_input: Annotated[UserInputBlockParam, PropertyInfo(alias="userInput")]

src/gitpod/types/type.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal, TypeAlias
4+
5+
__all__ = ["Type"]
6+
7+
Type: TypeAlias = Literal["TYPE_UNSPECIFIED", "TYPE_UPDATE", "TYPE_COMPLETE"]

tests/api_resources/test_agents.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ def test_method_send_to_execution(self, client: Gitpod) -> None:
360360
def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None:
361361
agent = client.agents.send_to_execution(
362362
agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35",
363+
agent_message={
364+
"payload": "payload",
365+
"type": "TYPE_UNSPECIFIED",
366+
},
363367
user_input={
364368
"id": "id",
365369
"created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
@@ -890,6 +894,10 @@ async def test_method_send_to_execution(self, async_client: AsyncGitpod) -> None
890894
async def test_method_send_to_execution_with_all_params(self, async_client: AsyncGitpod) -> None:
891895
agent = await async_client.agents.send_to_execution(
892896
agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35",
897+
agent_message={
898+
"payload": "payload",
899+
"type": "TYPE_UNSPECIFIED",
900+
},
893901
user_input={
894902
"id": "id",
895903
"created_at": parse_datetime("2019-12-27T18:11:19.117Z"),

0 commit comments

Comments
 (0)