Skip to content

Commit fe828ea

Browse files
committed
make transport send compatible with agent emit funcs
1 parent c54054d commit fe828ea

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/steamship/experimental/transports/steamship_widget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import uuid
2-
from typing import Optional
2+
from typing import Any, Dict, Optional
33

44
from steamship import Block, SteamshipError
55
from steamship.experimental.transports.transport import Transport
@@ -17,7 +17,7 @@ def _instance_deinit(self, *args, **kwargs):
1717
"""Unsubscribe from updates."""
1818
pass
1919

20-
def _send(self, blocks: [Block]):
20+
def _send(self, blocks: [Block], metadata: Dict[str, Any]):
2121
"""Send a response to the client.
2222
2323
TODO: Since this isn't a push, but rather an API return, we need to figure out how to model this.

src/steamship/experimental/transports/telegram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22
import tempfile
3-
from typing import Optional
3+
from typing import Any, Dict, Optional
44

55
import requests
66

@@ -46,7 +46,7 @@ def _instance_deinit(self, *args, **kwargs):
4646
"""Unsubscribe from Telegram updates."""
4747
requests.get(f"{self.api_root}/deleteWebhook")
4848

49-
def _send(self, blocks: [Block]):
49+
def _send(self, blocks: [Block], metadata: Dict[str, Any]):
5050
"""Send a response to the Telegram chat."""
5151
for block in blocks:
5252
chat_id = block.chat_id

src/steamship/experimental/transports/transport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import time
33
from abc import ABC, abstractmethod
4-
from typing import List, Optional
4+
from typing import Any, Dict, List, Optional
55

66
from steamship import Block
77

@@ -69,7 +69,7 @@ def send(self, blocks: List[Block]):
6969
)
7070

7171
@abstractmethod
72-
def _send(self, blocks: List[Block]):
72+
def _send(self, blocks: List[Block], metadata: Dict[str, Any]):
7373
raise NotImplementedError
7474

7575
def parse_inbound(self, payload: dict, context: Optional[dict] = None) -> Optional[Block]:

0 commit comments

Comments
 (0)