Simplify reference formatting in LLM context generation
- Remove extra newlines in reference lists - Change code block type from text to generic
This commit is contained in:
parent
f83cde14df
commit
37e8898cf6
2 changed files with 4 additions and 4 deletions
|
|
@ -3233,7 +3233,7 @@ async def _build_llm_context(
|
||||||
text_units_str = "\n".join(
|
text_units_str = "\n".join(
|
||||||
json.dumps(text_unit, ensure_ascii=False) for text_unit in text_units_context
|
json.dumps(text_unit, ensure_ascii=False) for text_unit in text_units_context
|
||||||
)
|
)
|
||||||
reference_list_str = "\n\n".join(
|
reference_list_str = "\n".join(
|
||||||
f"[{ref['reference_id']}] {ref['file_path']}"
|
f"[{ref['reference_id']}] {ref['file_path']}"
|
||||||
for ref in reference_list
|
for ref in reference_list
|
||||||
if ref["reference_id"]
|
if ref["reference_id"]
|
||||||
|
|
@ -4124,7 +4124,7 @@ async def naive_query(
|
||||||
text_units_str = "\n".join(
|
text_units_str = "\n".join(
|
||||||
json.dumps(text_unit, ensure_ascii=False) for text_unit in text_units_context
|
json.dumps(text_unit, ensure_ascii=False) for text_unit in text_units_context
|
||||||
)
|
)
|
||||||
reference_list_str = "\n\n".join(
|
reference_list_str = "\n".join(
|
||||||
f"[{ref['reference_id']}] {ref['file_path']}"
|
f"[{ref['reference_id']}] {ref['file_path']}"
|
||||||
for ref in reference_list
|
for ref in reference_list
|
||||||
if ref["reference_id"]
|
if ref["reference_id"]
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ Document Chunks (Each entry has a reference_id refer to the `Reference Document
|
||||||
|
|
||||||
Reference Document List (Each entry starts with a [reference_id] that corresponds to entries in the Document Chunks):
|
Reference Document List (Each entry starts with a [reference_id] that corresponds to entries in the Document Chunks):
|
||||||
|
|
||||||
```text
|
```
|
||||||
{reference_list_str}
|
{reference_list_str}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -355,7 +355,7 @@ Document Chunks (Each entry has a reference_id refer to the `Reference Document
|
||||||
|
|
||||||
Reference Document List (Each entry starts with a [reference_id] that corresponds to entries in the Document Chunks):
|
Reference Document List (Each entry starts with a [reference_id] that corresponds to entries in the Document Chunks):
|
||||||
|
|
||||||
```text
|
```
|
||||||
{reference_list_str}
|
{reference_list_str}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue