Fix too long context issue. (#4735)

### What problem does this PR solve?

#4728

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-02-06 11:37:23 +08:00
committed by GitHub
parent a3a70431f3
commit 2a07eb69a7
4 changed files with 6 additions and 3 deletions

View File

@ -120,7 +120,7 @@ class GraphExtractor(Extractor):
token_count += num_tokens_from_string(hint_prompt + response)
results = response or ""
history = [{"role": "system", "content": hint_prompt}, {"role": "assistant", "content": response}]
history = [{"role": "system", "content": hint_prompt}, {"role": "user", "content": response}]
# Repeat to ensure we maximize entity count
for i in range(self._max_gleanings):