feat: claude 支持纯图片

This commit is contained in:
崔永亮
2025-02-21 22:26:31 +08:00
parent 5e2909df33
commit b1049540a4
@@ -98,6 +98,10 @@ class ProviderAnthropic(ProviderOpenAIOfficial):
system_prompt=None,
**kwargs
) -> LLMResponse:
if not prompt:
prompt = "<image>"
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)