mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-01 22:59:53 +00:00
更好的缓存,扬掉global,重构代码,整理聊天逻辑 (#16)
* 实现缓存装饰器,优化数据获取和存储逻辑
* 重构代码,准备将聊天请求逻辑移入MarshoHandler
* 记录点(
* unfinished
* 🎨 重写基本完毕
* 移除未使用import,添加漏掉的换行
This commit is contained in:
@ -3,7 +3,7 @@ from nonebot import get_driver
|
||||
from openai import AsyncOpenAI
|
||||
|
||||
from .config import config
|
||||
from .models import Cache, MarshoContext, MarshoTools
|
||||
from .models import MarshoContext, MarshoTools
|
||||
|
||||
driver = get_driver()
|
||||
|
||||
@ -11,7 +11,6 @@ command_start = driver.config.command_start
|
||||
model_name = config.marshoai_default_model
|
||||
context = MarshoContext()
|
||||
tools = MarshoTools()
|
||||
cache = Cache()
|
||||
token = config.marshoai_token
|
||||
endpoint = config.marshoai_azure_endpoint
|
||||
# client = ChatCompletionsClient(endpoint=endpoint, credential=AzureKeyCredential(token))
|
||||
|
Reference in New Issue
Block a user