重写config系统,报错

This commit is contained in:
2024-10-23 17:07:34 +08:00
parent 4aa590b3a0
commit 6596944905
5 changed files with 51 additions and 28 deletions

View File

@ -7,13 +7,15 @@ from melobot.protocols.onebot.v11.adapter.event import MessageEvent
import traceback
from azure.core.credentials import AzureKeyCredential
from .constants import *
from config import *
from .config import Config
from .util import *
from .models import MarshoContext
model_name = marshoai_default_model
config = Config()
model_name = config.marshoai_default_model
context = MarshoContext()
token = marshoai_token
endpoint = marshoai_azure_endpoint
token = config.marshoai_token
endpoint = config.marshoai_azure_endpoint
client = ChatCompletionsClient(
endpoint=endpoint,
credential=AzureKeyCredential(token)
@ -74,7 +76,6 @@ async def marsho(event: MessageEvent):
await send_text(str(choice.message.content))
except Exception as e:
await send_text(str(e)+suggest_solution(str(e)))
traceback.print_exc()
return