From b1049540a4d768e758dd1088f6289bfdff2d6883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E6=B0=B8=E4=BA=AE?= <702625325@qq.com> Date: Fri, 21 Feb 2025 22:26:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20claude=20=E6=94=AF=E6=8C=81=E7=BA=AF?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/provider/sources/anthropic_source.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/astrbot/core/provider/sources/anthropic_source.py b/astrbot/core/provider/sources/anthropic_source.py index 0947e4d97..35200bf23 100644 --- a/astrbot/core/provider/sources/anthropic_source.py +++ b/astrbot/core/provider/sources/anthropic_source.py @@ -98,6 +98,10 @@ class ProviderAnthropic(ProviderOpenAIOfficial): system_prompt=None, **kwargs ) -> LLMResponse: + + if not prompt: + prompt = "" + new_record = await self.assemble_context(prompt, image_urls) context_query = [*contexts, new_record] @@ -114,6 +118,7 @@ class ProviderAnthropic(ProviderOpenAIOfficial): # Anthropic has a different way of handling system prompts if system_prompt: payloads['system'] = system_prompt + llm_response = None try: llm_response = await self._query(payloads, func_tool)