mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
feat: add manifest for LLMAPIRequester
This commit is contained in:
@@ -10,26 +10,6 @@ from .types import message as platform_message
|
||||
from .types import events as platform_events
|
||||
|
||||
|
||||
preregistered_adapters: list[typing.Type[MessagePlatformAdapter]] = []
|
||||
|
||||
def adapter_class(
|
||||
name: str
|
||||
):
|
||||
"""消息平台适配器类装饰器
|
||||
|
||||
Args:
|
||||
name (str): 适配器名称
|
||||
|
||||
Returns:
|
||||
typing.Callable[[typing.Type[MessageSourceAdapter]], typing.Type[MessageSourceAdapter]]: 装饰器
|
||||
"""
|
||||
def decorator(cls: typing.Type[MessagePlatformAdapter]) -> typing.Type[MessagePlatformAdapter]:
|
||||
cls.name = name
|
||||
preregistered_adapters.append(cls)
|
||||
return cls
|
||||
return decorator
|
||||
|
||||
|
||||
class MessagePlatformAdapter(metaclass=abc.ABCMeta):
|
||||
"""消息平台适配器基类"""
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: ComponentTemplate
|
||||
metadata:
|
||||
icon:
|
||||
name: MessagePlatformAdapter
|
||||
label:
|
||||
en_US: Message Platform Adapter
|
||||
|
||||
14
pkg/provider/modelmgr/requester.yaml
Normal file
14
pkg/provider/modelmgr/requester.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: ComponentTemplate
|
||||
metadata:
|
||||
name: LLMAPIRequester
|
||||
label:
|
||||
en_US: LLM API Requester
|
||||
zh_CN: LLM API 请求器
|
||||
spec:
|
||||
type:
|
||||
- python
|
||||
execution:
|
||||
python:
|
||||
path: ./requester.py
|
||||
attr: LLMAPIRequester
|
||||
Reference in New Issue
Block a user