mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-30 17:22:40 +00:00
Fix problem with only displaying one source for tool call excerpts.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
parent
a71db10124
commit
1c9911a4ac
@ -203,10 +203,11 @@ public:
|
|||||||
QList<SourceExcerpt> consolidateSources(const QList<SourceExcerpt> &sources) {
|
QList<SourceExcerpt> consolidateSources(const QList<SourceExcerpt> &sources) {
|
||||||
QMap<QString, SourceExcerpt> groupedData;
|
QMap<QString, SourceExcerpt> groupedData;
|
||||||
for (const SourceExcerpt &info : sources) {
|
for (const SourceExcerpt &info : sources) {
|
||||||
if (groupedData.contains(info.file)) {
|
QString key = !info.file.isEmpty() ? info.file : info.url;
|
||||||
groupedData[info.file].text += "\n---\n" + info.text;
|
if (groupedData.contains(key)) {
|
||||||
|
groupedData[key].text += "\n---\n" + info.text;
|
||||||
} else {
|
} else {
|
||||||
groupedData[info.file] = info;
|
groupedData[key] = info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QList<SourceExcerpt> consolidatedSources = groupedData.values();
|
QList<SourceExcerpt> consolidatedSources = groupedData.values();
|
||||||
|
Loading…
Reference in New Issue
Block a user