Fix: long api key issue. (#6267)

### What problem does this PR solve?

#6248

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-03-19 13:30:40 +08:00 committed by GitHub
parent c2302abaf1
commit e689532e6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -648,7 +648,7 @@ class TenantLLM(DataBaseModel):
help_text="LLM name",
default="",
index=True)
api_key = CharField(max_length=1024, null=True, help_text="API KEY", index=True)
api_key = CharField(max_length=2048, null=True, help_text="API KEY", index=True)
api_base = CharField(max_length=255, null=True, help_text="API Base")
max_tokens = IntegerField(default=8192, index=True)
used_tokens = IntegerField(default=0, index=True)
@ -1027,7 +1027,7 @@ def migrate_db():
try:
migrate(
migrator.alter_column_type('tenant_llm', 'api_key',
CharField(max_length=1024, null=True, help_text="API KEY", index=True))
CharField(max_length=2048, null=True, help_text="API KEY", index=True))
)
except Exception:
pass