Fix: cite disfunction for G component. (#7117)

### What problem does this PR solve?

#7097

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-04-18 18:05:26 +08:00
committed by GitHub
parent 8b8a2f2949
commit 487aed419e
3 changed files with 19 additions and 11 deletions

View File

@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import json
import logging
from abc import ABC
@ -103,7 +104,7 @@ class Retrieval(ComponentBase, ABC):
df["empty_response"] = self._param.empty_response
return df
df = pd.DataFrame({"content": kb_prompt(kbinfos, 200000)})
df = pd.DataFrame({"content": kb_prompt(kbinfos, 200000), "chunks": json.dumps(kbinfos["chunks"])})
logging.debug("{} {}".format(query, df))
return df.dropna()