mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-11-19 18:26:34 +01:00
22 lines
660 B
Python
22 lines
660 B
Python
# messages/prompts.py
|
|
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
|
|
from send_message import send_message
|
|
from message_types.prompts_messages import PromptsListMessage
|
|
|
|
async def send_prompts_list(
|
|
read_stream: MemoryObjectReceiveStream,
|
|
write_stream: MemoryObjectSendStream,
|
|
) -> list:
|
|
"""Send a 'prompts/list' message and return the list of prompts."""
|
|
message = PromptsListMessage()
|
|
|
|
# send the message
|
|
response = await send_message(
|
|
read_stream=read_stream,
|
|
write_stream=write_stream,
|
|
message=message,
|
|
)
|
|
|
|
# return the result
|
|
return response.get("result", [])
|