Story maker support telegram
This commit is contained in:
@@ -13,13 +13,17 @@ enable_function = []
|
||||
[[roles.manager.prompt]]
|
||||
role="system"
|
||||
content="""
|
||||
你是一个语音故事制作总导演,与客户对接并向团队下达指令。你的团队分为下面几个成员:writer,speecher。一个故事制作分成两个阶段:让writer写出故事,再交由speecher演播故事生成音频文件。你的基本工作模式是:
|
||||
你当前的职位是语音故事制作总负责人,负责与客户对接并向团队下达指令,不需要自己直接完成任务。你的团队分为下面两个成员:writer,speecher。一个故事制作分成两个阶段:让writer写出故事,再交由speecher演播故事生成音频文件。你的基本工作模式是:
|
||||
1. 收到客户的明确的指令后,让writer写出故事
|
||||
2. 将writer写出的故事交给speecher演播
|
||||
3. 获得音频文件之后,将音频文件的存放路径交给客户
|
||||
3. 获得音频文件之后,整个任务已完成,将音频文件的存放路径以如下格式返回给客户:
|
||||
```
|
||||
故事制作完成。
|
||||
audio file:音频文件路径
|
||||
```
|
||||
4. 当你决定要和成员通信时,请使用下面形式输出需要通信的消息
|
||||
```
|
||||
##/send_msg 成员名称
|
||||
##/send_msg "成员名称"
|
||||
内容
|
||||
```
|
||||
"""
|
||||
@@ -39,4 +43,9 @@ agent = "speecher"
|
||||
enable_function = ["text_to_speech"]
|
||||
[[roles.speecher.prompt]]
|
||||
role="system"
|
||||
content=""
|
||||
content="""你现在的职责是演播一个故事,故事完成之后请以如下格式返回:
|
||||
```
|
||||
故事演播完成。
|
||||
audio file:音频文件路径
|
||||
```
|
||||
"""
|
||||
|
||||
@@ -148,6 +148,14 @@ class TelegramTunnel(AgentTunnel):
|
||||
await update.message.reply_text(f"{self.target_id} process message error")
|
||||
else:
|
||||
if resp_msg.body_mime is None:
|
||||
if resp_msg.body is not None:
|
||||
pos = resp_msg.body.find("audio file")
|
||||
if pos != -1:
|
||||
audio_file = resp_msg.body[pos+11:].strip()
|
||||
if audio_file.startswith("\""):
|
||||
audio_file = audio_file[1:-1]
|
||||
await update.message.reply_voice(audio_file)
|
||||
return
|
||||
await update.message.reply_text(resp_msg.body)
|
||||
else:
|
||||
if resp_msg.body_mime.startswith("image"):
|
||||
@@ -162,4 +170,3 @@ class TelegramTunnel(AgentTunnel):
|
||||
await update.message.reply_text(resp_msg.body)
|
||||
|
||||
|
||||
|
||||
@@ -440,7 +440,7 @@ class Workflow:
|
||||
prompt.append(await self._get_prompt_from_session(workflow_chat_session))
|
||||
|
||||
msg_prompt = AgentPrompt()
|
||||
msg_prompt.messages = [{"role":"user","content":f"{msg.sender}:{msg.body}"}]
|
||||
msg_prompt.messages = [{"role":"user","content":f"user name is {msg.sender}, his question is :{msg.body}"}]
|
||||
prompt.append(msg_prompt)
|
||||
|
||||
self._format_msg_by_env_value(prompt)
|
||||
|
||||
Reference in New Issue
Block a user