Skip to content

Commit b5a38ed

Browse files
committed
Make all methods in ThreadItemConverter async def
1 parent ef67326 commit b5a38ed

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

chatkit/agents.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,9 @@ class ThreadItemConverter:
634634
Other item types are converted automatically.
635635
"""
636636

637-
def attachment_to_message_content(
637+
async def attachment_to_message_content(
638638
self, attachment: Attachment
639-
) -> Awaitable[ResponseInputContentParam]:
639+
) -> ResponseInputContentParam:
640640
"""
641641
Convert an attachment in a user message into a message content part to send to the model.
642642
Required when attachments are enabled.
@@ -645,7 +645,7 @@ def attachment_to_message_content(
645645
"An Attachment was included in a UserMessageItem but Converter.attachment_to_message_content was not implemented"
646646
)
647647

648-
def tag_to_message_content(
648+
async def tag_to_message_content(
649649
self, tag: UserMessageTagContent
650650
) -> ResponseInputContentParam:
651651
"""
@@ -801,7 +801,7 @@ async def user_message_to_input(
801801

802802
tag_content: ResponseInputMessageContentListParam = [
803803
# should return summarized text items
804-
self.tag_to_message_content(tag)
804+
await self.tag_to_message_content(tag)
805805
for tag in uniq_tags
806806
]
807807

docs/server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ class MyThreadConverter(ThreadItemConverter):
323323

324324
# ..handle other attachment types
325325

326-
def hidden_context_to_input(self, item: HiddenContextItem) -> Message:
326+
async def hidden_context_to_input(self, item: HiddenContextItem) -> Message:
327327
return Message(
328328
type="message",
329329
role="system",
@@ -335,7 +335,7 @@ class MyThreadConverter(ThreadItemConverter):
335335
],
336336
)
337337

338-
def tag_to_message_content(self, tag: UserMessageTagContent):
338+
async def tag_to_message_content(self, tag: UserMessageTagContent):
339339
tag_context = await retrieve_context_for_tag(tag.id)
340340
return ResponseInputTextParam(
341341
type="input_text",

0 commit comments

Comments
 (0)