Tencent/WeKnora · error

questions can only be generated for text chunks

Error message

questions can only be generated for text chunks

What it means

Type guard in RegenerateChunkQuestions: the requested chunk's ChunkType is not ChunkTypeText (e.g. a summary or table chunk). Question generation is only defined for text chunks; the input chunkID points at the wrong kind of chunk.

Source

Thrown at internal/application/service/knowledge_process.go:2180

		}
	}

	return questions, nil
}

// RegenerateChunkQuestions synchronously refreshes Doc2Query-style auxiliary
// questions for the current chunk revision and atomically replaces their
// retrieval entries through updateChunkVector.
func (s *knowledgeService) RegenerateChunkQuestions(
	ctx context.Context, chunkID string,
) ([]types.GeneratedQuestion, error) {
	tenantID := types.MustTenantIDFromContext(ctx)
	chunk, err := s.chunkRepo.GetChunkByID(ctx, tenantID, chunkID)
	if err != nil {
		return nil, err
	}
	if chunk.ChunkType != types.ChunkTypeText {
		return nil, fmt.Errorf("questions can only be generated for text chunks")
	}
	generationRevision := chunk.ContentRevision
	knowledge, err := s.repo.GetKnowledgeByID(ctx, tenantID, chunk.KnowledgeID)
	if err != nil {
		return nil, err
	}
	kb, err := s.kbService.GetKnowledgeBaseByID(ctx, chunk.KnowledgeBaseID)
	if err != nil {
		return nil, err
	}
	if kb.SummaryModelID == "" {
		return nil, fmt.Errorf("summary model is required for question generation")
	}
	chatModel, err := s.modelService.GetChatModel(ctx, kb.SummaryModelID)
	if err != nil {
		return nil, err
	}
	resolveNeighbor := func(id string) string {

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Call the endpoint with a text chunk's ID
  2. List chunk types first to select a ChunkTypeText chunk
  3. Guard client-side against passing summary/table chunk IDs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/application/service/knowledge_process.go:2180 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/8d91ca5721d1e328. Report an issue: GitHub.