Merge pull request #10209 from i-infra/iinf/fix-for-openrouter

[fix] no unambiguous indexing on "owned_by" - fix OpenRouter.ai
This commit is contained in:
Timothy Jaeryang Baek
2025-02-17 15:24:21 -08:00
committed by GitHub
5 changed files with 7 additions and 7 deletions

View File

@@ -208,7 +208,7 @@ async def generate_title(
"stream": False,
**(
{"max_tokens": 1000}
if models[task_model_id]["owned_by"] == "ollama"
if models[task_model_id].get("owned_by") == "ollama"
else {
"max_completion_tokens": 1000,
}
@@ -571,7 +571,7 @@ async def generate_emoji(
"stream": False,
**(
{"max_tokens": 4}
if models[task_model_id]["owned_by"] == "ollama"
if models[task_model_id].get("owned_by") == "ollama"
else {
"max_completion_tokens": 4,
}