Fix graphrag : "role" user (#2273)

### What problem does this PR solve?

#2270 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
H
2024-09-06 10:04:01 +08:00
committed by GitHub
parent fd3e55cfcf
commit c6e723f2ee
6 changed files with 9 additions and 8 deletions

View File

@ -163,7 +163,7 @@ class GraphExtractor:
token_count = 0
text = perform_variable_replacements(self._extraction_prompt, variables=variables)
gen_conf = {"temperature": 0.3}
response = self._llm.chat(text, [], gen_conf)
response = self._llm.chat(text, [{"role": "user", "content": "Output:"}], gen_conf)
token_count = num_tokens_from_string(text + response)
results = response or ""