From 8d984e5e56207d06a74530ab920bf0fe3e2a8b3c Mon Sep 17 00:00:00 2001 From: "alicja.kotyla" Date: Tue, 22 Oct 2024 13:31:51 +0200 Subject: [PATCH] add promptfoo docs update and prompt fix --- docs/integrations/promptfoo.md | 4 +++- packages/ragbits-core/src/ragbits/core/prompt/prompt.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/integrations/promptfoo.md b/docs/integrations/promptfoo.md index 8c110074e..05eeb7b63 100644 --- a/docs/integrations/promptfoo.md +++ b/docs/integrations/promptfoo.md @@ -20,5 +20,7 @@ You can then edit the generated file to add your custom `promptfoo` configuratio file is ready, you can run `promptfoo` with the following command: ```bash -promptfoo -c /path/to/generated/promptfoo-config.yaml eval +promptfoo eval -c /path/to/generated/promptfoo-config.yaml ``` + +**Important: To ensure compatibility, make sure Node.js version 20 is installed.** diff --git a/packages/ragbits-core/src/ragbits/core/prompt/prompt.py b/packages/ragbits-core/src/ragbits/core/prompt/prompt.py index 64d93ec39..b353e4b4b 100644 --- a/packages/ragbits-core/src/ragbits/core/prompt/prompt.py +++ b/packages/ragbits-core/src/ragbits/core/prompt/prompt.py @@ -71,7 +71,7 @@ def _render_template(cls, template: Template, input_data: Optional[InputT]) -> s # because of mypy issue: https://github.com/python/mypy/issues/12622 context = {} if isinstance(input_data, BaseModel): - context = input_data.model_dump() + context = input_data.model_dump(serialize_as_any=True) return template.render(**context) @classmethod