fix: update max context window on base provider sync (#8803)
This commit is contained in:
@@ -737,7 +737,17 @@ class ProviderManager:
|
||||
# Roll back the session to clear the failed transaction
|
||||
await session.rollback()
|
||||
else:
|
||||
logger.info(f" LLM model {llm_config.handle} already exists (ID: {existing[0].id}), skipping")
|
||||
# Check if max_context_window needs to be updated
|
||||
existing_model = existing[0]
|
||||
if existing_model.max_context_window != llm_config.context_window:
|
||||
logger.info(
|
||||
f" Updating LLM model {llm_config.handle} max_context_window: "
|
||||
f"{existing_model.max_context_window} -> {llm_config.context_window}"
|
||||
)
|
||||
existing_model.max_context_window = llm_config.context_window
|
||||
await existing_model.update_async(session)
|
||||
else:
|
||||
logger.info(f" LLM model {llm_config.handle} already exists (ID: {existing[0].id}), skipping")
|
||||
|
||||
# Process embedding models - add new ones
|
||||
logger.info(f"Processing {len(embedding_models)} embedding models for provider {provider.name}")
|
||||
|
||||
Reference in New Issue
Block a user