Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed Oct 17, 2023
1 parent 1a884da commit ed65415
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
28 changes: 8 additions & 20 deletions llmbot_plugin_bilisearch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
# @Time : 2023/10/14 下午1:58
# @Author : sudoskys
# @File : __init__.py.py
# @Software: PyCharm
import os
__plugin_name__ = "search_in_bilibili"
__openapi_version__ = "20231017"

from llmkira.sdk.func_calling import verify_openapi_version

verify_openapi_version(__plugin_name__, __openapi_version__)

import os
import inscriptis
from llmkira.middleware.chain_box import Chain, CHAIN_MANAGER
from llmkira.middleware.user import SubManager, UserInfo
from llmkira.schema import RawMessage
from llmkira.sdk.endpoint import openai
Expand All @@ -17,8 +18,6 @@
from loguru import logger
from pydantic import BaseModel

__plugin_name__ = "search_in_bilibili"

bilibili = Function(name=__plugin_name__, description="Search videos on bilibili.com(哔哩哔哩)")
bilibili.add_property(
property_name="keywords",
Expand Down Expand Up @@ -141,14 +140,7 @@ async def llm_task(task, task_desc, raw_data):
return result.default_message.content

async def callback(self, sign: str, task: TaskHeader):
if sign == "reply":
chain: Chain = await CHAIN_MANAGER.get_task(user_id=str(task.receiver.user_id))
if chain:
logger.info(f"{__plugin_name__}:chain callback locate in {sign} be sent")
await Task(queue=chain.address).send_task(task=chain.arg)
return True
else:
return False
return True

async def run(self, task: TaskHeader, receiver: TaskHeader.Location, arg, **kwargs):
"""
Expand Down Expand Up @@ -194,7 +186,3 @@ async def run(self, task: TaskHeader, receiver: TaskHeader.Location, arg, **kwar
FuncPair(function=bilibili, tool=BiliBiliSearch)
}
)


def resign():
pass
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "llmbot_plugin_bilisearch"
version = "0.1.1"
version = "0.1.2"
description = ""
authors = ["Your Name <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit ed65415

Please sign in to comment.