Skip to content

Commit

Permalink
Merge pull request #13 from LlmKira/dev
Browse files Browse the repository at this point in the history
bilibili data
  • Loading branch information
sudoskys authored Sep 6, 2023
2 parents 177d29a + 62a1f28 commit 9e78220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions plugins/bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def search_on_bilibili(keywords):
_video_play = video.get("play")
_video_info = f"(Title={_video_title},Author={_video_author},Link={_video_url},Tag={_video_tag},Love={_video_play})"
_info.append(_video_info)
return "\n\n".join(_info)
return "\nHintData".join(_info)


class Bili(BaseModel):
Expand Down Expand Up @@ -143,17 +143,13 @@ async def run(self, task: TaskHeader, receiver: TaskHeader.Location, arg, **kwar
_set = Bili.parse_obj(arg)
_search_result = await search_on_bilibili(_set.keywords)
_question = task.message[0].text
_summary = await self.llm_task(
task,
task_desc=f"""按照上文搜索结果,总结比较信息,以模仿人类以中文短讯回答我的问题: *{_question}* ,附上链接""",
raw_data=_search_result
)
await Task(queue=receiver.platform).send_task(
task=TaskHeader(
sender=task.sender, # 继承发送者
receiver=receiver, # 因为可能有转发,所以可以单配
task_meta=TaskHeader.Meta(
no_future_action=True,
additional_reply=True,
callback=TaskHeader.Meta.Callback(
role="function",
name=__plugin_name__
Expand All @@ -163,7 +159,7 @@ async def run(self, task: TaskHeader, receiver: TaskHeader.Location, arg, **kwar
RawMessage(
user_id=receiver.user_id,
chat_id=receiver.chat_id,
text=_summary
text=_search_result
)
]
)
Expand Down
2 changes: 1 addition & 1 deletion schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Callback(BaseModel):
name: str = Field(None, description="功能名称", regex=r"^[a-zA-Z0-9_]+$")

no_future_action: bool = Field(False, description="非 LLM 转发")
additional_reply: bool = Field(False, description="追加LLM回复")
additional_reply: bool = Field(False, description="追加LLM回复,追加存储处理后再回复")
function_enable: bool = Field(False, description="功能开关")
parent_call: Any = Field(None, description="父消息")
callback: Callback = Field(Callback(), description="函数回调信息")
Expand Down

0 comments on commit 9e78220

Please sign in to comment.