MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / create_message

Function create_message

backend/app/services/assistant/message.py:11–39  ·  view source on GitHub ↗

Create message :param assistant_id: the assistant id :param chat_id: the chat id :param role: the message role :param content: the message content :param metadata: the message metadata :return: the created message

(
    assistant_id: str,
    chat_id: str,
    role: MessageRole,
    content: MessageContent,
    metadata: Dict[str, str],
)

Source from the content-addressed store, hash-verified

9
10
11async def create_message(
12 assistant_id: str,
13 chat_id: str,
14 role: MessageRole,
15 content: MessageContent,
16 metadata: Dict[str, str],
17) -> Message:
18 """
19 Create message
20 :param assistant_id: the assistant id
21 :param chat_id: the chat id
22 :param role: the message role
23 :param content: the message content
24 :param metadata: the message metadata
25 :return: the created message
26 """
27
28 # create message
29 message: Message = await message_ops.create(
30 assistant_id=assistant_id,
31 chat_id=chat_id,
32 create_dict={
33 "role": role,
34 "content": content,
35 "metadata": metadata,
36 },
37 )
38
39 return message

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected