update: 修改anthropic请求体
This commit is contained in:
@@ -133,8 +133,8 @@ async def get_chat_context(system_context: deque, plugin: AbsExtraConfigPlugin,
|
|||||||
获取总消息上下文
|
获取总消息上下文
|
||||||
"""
|
"""
|
||||||
async def get_context(plugin: AbsExtraConfigPlugin, platform: Platform, evt: MessageEvent) -> deque:
|
async def get_context(plugin: AbsExtraConfigPlugin, platform: Platform, evt: MessageEvent) -> deque:
|
||||||
system_context = get_system_context(plugin, platform, evt)
|
system_context = await get_system_context(plugin, platform, evt)
|
||||||
chat_context = get_chat_context(system_context, plugin, platform, evt)
|
chat_context = await get_chat_context(system_context, plugin, platform, evt)
|
||||||
return system_context + chat_context
|
return system_context + chat_context
|
||||||
|
|
||||||
async def generate_context_messages(plugin: Plugin, platform: Platform, evt: MessageEvent) -> Generator[MessageEvent, None, None]:
|
async def generate_context_messages(plugin: Plugin, platform: Platform, evt: MessageEvent) -> Generator[MessageEvent, None, None]:
|
||||||
|
|||||||
@@ -83,11 +83,10 @@ class Anthropic(Platform):
|
|||||||
|
|
||||||
async def create_chat_completion(self, plugin: AbsExtraConfigPlugin, evt: MessageEvent) -> ChatCompletion:
|
async def create_chat_completion(self, plugin: AbsExtraConfigPlugin, evt: MessageEvent) -> ChatCompletion:
|
||||||
full_chat_context = []
|
full_chat_context = []
|
||||||
chat_context = await maubot_llmplus.platforms.get_chat_context(plugin, self, evt)
|
|
||||||
full_chat_context.extend(list(chat_context))
|
|
||||||
|
|
||||||
full_system_context = []
|
|
||||||
system_context = await maubot_llmplus.platforms.get_system_context(plugin, self, evt)
|
system_context = await maubot_llmplus.platforms.get_system_context(plugin, self, evt)
|
||||||
|
full_system_context = []
|
||||||
|
chat_context = await maubot_llmplus.platforms.get_chat_context(system_context, plugin, self, evt)
|
||||||
|
full_chat_context.extend(list(chat_context))
|
||||||
full_system_context.extend(list(system_context))
|
full_system_context.extend(list(system_context))
|
||||||
|
|
||||||
endpoint = f"{self.url}/v1/messages"
|
endpoint = f"{self.url}/v1/messages"
|
||||||
|
|||||||
Reference in New Issue
Block a user