|
|
@@ -41,7 +41,8 @@ def get_thread_contents ( |
|
|
|
'handle': response.post.author.handle, |
|
|
|
'name': response.post.author.display_name, |
|
|
|
'datetime': response.post.record.created_at, |
|
|
|
'text': response.post.record.text }] |
|
|
|
'text': response.post.record.text, |
|
|
|
'embed': response.post.record.embed }] |
|
|
|
response = response.parent |
|
|
|
|
|
|
|
return records |
|
|
@@ -60,7 +61,14 @@ def main () -> None: |
|
|
|
for uri in check_notifications (client): |
|
|
|
records = get_thread_contents (client, uri, 20) |
|
|
|
if len (records) > 0: |
|
|
|
answer = Talk.main (records[0]['text'], |
|
|
|
answer = Talk.main ((records[0]['text'] |
|
|
|
if (records[0]['embed'] is None |
|
|
|
or not hasattr (records[0]['embed'], |
|
|
|
'images')) |
|
|
|
else [ |
|
|
|
{ 'type': 'text', 'text': records[0]['text'] }, |
|
|
|
{ 'type': 'image_url', 'image_url': { |
|
|
|
'url': f"https://cdn.bsky.app/img/feed_fullsize/plain/{ records[0]['did'] }/{ records[0]['embed'].images[0].image.ref.link }" } }]), |
|
|
|
records[0]['name'], |
|
|
|
[*map (lambda record: { |
|
|
|
'role': ('assistant' |
|
|
|