fix(mana-llm): google-genai v1.73 keyword-only Part.from_text()

google-genai >=1.70 changed Part.from_text() from positional to
keyword-only argument. The production container installed v1.73.1
and crashed on startup with "Part.from_text() takes 1 positional
argument but 2 were given".

Fix: Part.from_text(msg.content) → Part.from_text(text=msg.content)

Tested live: curl https://llm.mana.how/v1/chat/completions with
model=google/gemini-2.5-flash returns correct response.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-16 12:43:54 +02:00
parent 3ce8420bc1
commit 3be4612f04
8 changed files with 4972 additions and 7 deletions

View file

@ -76,13 +76,13 @@ class GoogleProvider(LLMProvider):
role = "user" if msg.role == "user" else "model"
if isinstance(msg.content, str):
contents.append(types.Content(role=role, parts=[types.Part.from_text(msg.content)]))
contents.append(types.Content(role=role, parts=[types.Part.from_text(text=msg.content)]))
else:
# Multimodal content
parts: list[types.Part] = []
for part in msg.content:
if part.type == "text":
parts.append(types.Part.from_text(part.text))
parts.append(types.Part.from_text(text=part.text))
elif part.type == "image_url" and part.image_url:
url = part.image_url.url
if url.startswith("data:"):