Fix incorrect API key header in summarization function

The "Bearer" prefix was mistakenly included in the API key header. This change removes it to align with the expected format required by the external service.
This commit is contained in:
ThomasTaroni 2025-06-21 21:57:17 +02:00
parent cfc124915f
commit 4c554b1472

View file

@ -29,7 +29,7 @@ mcp = FastMCP("SMD Researcher", host="0.0.0.0", port=8000, timeout_keep_alive=72
async def summarize_to_words(text: str, title: str, target_word_count: int = 1000) -> str:
url = f"https://maas.ai-2.kvant.cloud/engines/{os.getenv('SWISSDOX_SUMMARIZING_MODEL', '')}/chat/completions"
headers = {
"x-litellm-api-key": f"Bearer {os.getenv('SWISSDOX_SUMMARIZING_MODEL_APIKEY', '')}",
"x-litellm-api-key": f"{os.getenv('SWISSDOX_SUMMARIZING_MODEL_APIKEY', '')}",
"Content-type": "application/json",
}
payload = {