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)