refactor: Update tenant ID handling across the application
This commit is contained in:
@@ -109,7 +109,7 @@ func (e *EvaluationService) EvaluationResult(ctx context.Context, taskID string)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tenantID := ctx.Value(types.TenantIDContextKey).(uint)
|
||||
tenantID := ctx.Value(types.TenantIDContextKey).(uint64)
|
||||
logger.Infof(
|
||||
ctx,
|
||||
"Checking tenant ID match, task tenant ID: %d, current tenant ID: %d",
|
||||
@@ -138,7 +138,7 @@ func (e *EvaluationService) Evaluation(ctx context.Context,
|
||||
datasetID, knowledgeBaseID, chatModelID, rerankModelID)
|
||||
|
||||
// Get tenant ID from context for multi-tenancy support
|
||||
tenantID := ctx.Value(types.TenantIDContextKey).(uint)
|
||||
tenantID := ctx.Value(types.TenantIDContextKey).(uint64)
|
||||
logger.Infof(ctx, "Tenant ID: %d", tenantID)
|
||||
|
||||
// Handle knowledge base creation if not provided
|
||||
@@ -154,6 +154,9 @@ func (e *EvaluationService) Evaluation(ctx context.Context,
|
||||
|
||||
var embeddingModelID, llmModelID string
|
||||
for _, model := range models {
|
||||
if model == nil {
|
||||
continue
|
||||
}
|
||||
if model.Type == types.ModelTypeEmbedding {
|
||||
embeddingModelID = model.ID
|
||||
}
|
||||
@@ -212,6 +215,9 @@ func (e *EvaluationService) Evaluation(ctx context.Context,
|
||||
models, err := e.modelService.ListModels(ctx)
|
||||
if err == nil {
|
||||
for _, model := range models {
|
||||
if model == nil {
|
||||
continue
|
||||
}
|
||||
if model.Type == types.ModelTypeRerank {
|
||||
rerankModelID = model.ID
|
||||
break
|
||||
@@ -230,6 +236,9 @@ func (e *EvaluationService) Evaluation(ctx context.Context,
|
||||
models, err := e.modelService.ListModels(ctx)
|
||||
if err == nil {
|
||||
for _, model := range models {
|
||||
if model == nil {
|
||||
continue
|
||||
}
|
||||
if model.Type == types.ModelTypeKnowledgeQA {
|
||||
chatModelID = model.ID
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user