Skip to content

refactor(aigc): remove character index references, keep only characte…#37

Merged
zhangzqs merged 1 commit into
mainfrom
xgopilot/claude/issue-34-1761383157
Oct 25, 2025
Merged

refactor(aigc): remove character index references, keep only characte…#37
zhangzqs merged 1 commit into
mainfrom
xgopilot/claude/issue-34-1761383157

Conversation

@zhangzqs

Copy link
Copy Markdown
Collaborator

…r names

  • Removed CharacterRefs field from SourceTextSegment struct
  • Removed character_refs from JSON schema
  • Updated prompt instructions to use only character_names without indices

Generated with codeagent

…r names

- Removed CharacterRefs field from SourceTextSegment struct
- Removed character_refs from JSON schema
- Updated prompt instructions to use only character_names without indices

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: zhangzqs <34616640+zhangzqs@users.noreply.github.com>
@zhangzqs zhangzqs merged commit b826774 into main Oct 25, 2025
@zhangzqs zhangzqs deleted the xgopilot/claude/issue-34-1761383157 branch October 25, 2025 09:18
@fennoai

fennoai Bot commented Oct 25, 2025

Copy link
Copy Markdown

Overall: Clean refactoring that simplifies the character reference system. The changes are well-executed with proper documentation updates. However, this PR introduces a breaking change that affects ai/demo/main.go.

Critical Issue: ai/demo/main.go:108-113 references the removed CharacterRefs field, causing compilation failure. Lines 108-113 should be deleted since character collection is now handled via CharacterNames (lines 104-106).

Positive aspects: Eliminates redundancy, improves maintainability, and makes the API more intuitive with name-based references instead of fragile index lookups.

Comment thread ai/gnxaigc/chapter.go
// CharacterRefs 标注对应角色画像在本章角色列表中的索引
CharacterRefs []int `json:"character_refs,omitempty"`
// CharacterNames 冗余记录角色姓名,便于生成端保持一致
// CharacterNames 记录角色姓名,便于生成端保持一致

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good simplification - removing "冗余" accurately reflects that CharacterNames is now the primary (not redundant) method for character references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants