From 86ccc2919fae5bec27e7aad11c1292c841f71922 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Thu, 30 Apr 2026 16:29:07 -0400 Subject: [PATCH 01/11] Bumps docs/examples/intrinsics to 4.1. The commented-out code in intrinsics.py still needs to be changed. Signed-off-by: Nathan Fulton --- docs/examples/intrinsics/answerability.py | 2 +- docs/examples/intrinsics/citations.py | 2 +- docs/examples/intrinsics/context_attribution.py | 2 +- docs/examples/intrinsics/context_relevance.py | 2 +- docs/examples/intrinsics/factuality_correction.py | 2 +- docs/examples/intrinsics/factuality_detection.py | 2 +- docs/examples/intrinsics/guardian_core.py | 2 +- docs/examples/intrinsics/hallucination_detection.py | 2 +- docs/examples/intrinsics/intrinsics.py | 5 +++-- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/examples/intrinsics/answerability.py b/docs/examples/intrinsics/answerability.py index 514e1f1b7..25bbc10ec 100644 --- a/docs/examples/intrinsics/answerability.py +++ b/docs/examples/intrinsics/answerability.py @@ -12,7 +12,7 @@ from mellea.stdlib.components.intrinsic import rag ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/citations.py b/docs/examples/intrinsics/citations.py index aee26117b..0278a0790 100644 --- a/docs/examples/intrinsics/citations.py +++ b/docs/examples/intrinsics/citations.py @@ -15,7 +15,7 @@ from mellea.stdlib.components.intrinsic import rag ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/context_attribution.py b/docs/examples/intrinsics/context_attribution.py index 465a2f9ee..73ffee19e 100644 --- a/docs/examples/intrinsics/context_attribution.py +++ b/docs/examples/intrinsics/context_attribution.py @@ -19,7 +19,7 @@ from mellea.stdlib.components.intrinsic import core ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/context_relevance.py b/docs/examples/intrinsics/context_relevance.py index 0c10f1d9e..6fe4adf9d 100644 --- a/docs/examples/intrinsics/context_relevance.py +++ b/docs/examples/intrinsics/context_relevance.py @@ -12,7 +12,7 @@ from mellea.stdlib.components.intrinsic import rag ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/factuality_correction.py b/docs/examples/intrinsics/factuality_correction.py index 2e767e73f..80310a009 100644 --- a/docs/examples/intrinsics/factuality_correction.py +++ b/docs/examples/intrinsics/factuality_correction.py @@ -82,7 +82,7 @@ # Create the backend. ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/factuality_detection.py b/docs/examples/intrinsics/factuality_detection.py index 15c1357a7..a292eea94 100644 --- a/docs/examples/intrinsics/factuality_detection.py +++ b/docs/examples/intrinsics/factuality_detection.py @@ -25,7 +25,7 @@ # Create the backend. ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/guardian_core.py b/docs/examples/intrinsics/guardian_core.py index e2ed9b77c..57f679220 100644 --- a/docs/examples/intrinsics/guardian_core.py +++ b/docs/examples/intrinsics/guardian_core.py @@ -19,7 +19,7 @@ from mellea.stdlib.components.intrinsic import guardian ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/hallucination_detection.py b/docs/examples/intrinsics/hallucination_detection.py index 2a8a19d61..86074251f 100644 --- a/docs/examples/intrinsics/hallucination_detection.py +++ b/docs/examples/intrinsics/hallucination_detection.py @@ -15,7 +15,7 @@ from mellea.stdlib.components.intrinsic import rag ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/intrinsics.py b/docs/examples/intrinsics/intrinsics.py index 65a07d8a2..4bfe0672c 100644 --- a/docs/examples/intrinsics/intrinsics.py +++ b/docs/examples/intrinsics/intrinsics.py @@ -1,6 +1,7 @@ # pytest: huggingface, e2e import mellea.stdlib.functional as mfuncs +from mellea.backends import model_ids from mellea.backends.adapters.adapter import AdapterType, IntrinsicAdapter from mellea.backends.huggingface import LocalHFBackend from mellea.stdlib.components import Intrinsic, Message @@ -9,12 +10,12 @@ # This is an example for how you would directly use intrinsics. See `mellea/stdlib/intrinsics/rag.py` # for helper functions. -backend = LocalHFBackend(model_id="ibm-granite/granite-3.3-8b-instruct") +backend = LocalHFBackend(model_id=model_ids.IBM_GRANITE_4_1_3B) # --- Alternative: OpenAI backend with Granite Switch (requires vLLM server) --- # Requires the adapter for this intrinsic to be embedded in the Granite Switch # model. See docs/examples/granite-switch/ for a full runnable example. # from mellea.backends.openai import OpenAIBackend -# from mellea.backends.model_ids import IBM_GRANITE_SWITCH_4_1_3B +# from mellea.backends.model_ids import IBM_GRANITE_4_1_3B # from mellea.formatters import TemplateFormatter # # backend = OpenAIBackend( From 7cdef5353244ab52e9421fe92efc66746b707896 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Thu, 30 Apr 2026 16:43:31 -0400 Subject: [PATCH 02/11] change query intrinsic examples to use 4.1 Signed-off-by: Nathan Fulton --- docs/examples/intrinsics/policy_guardrails.py | 2 +- docs/examples/intrinsics/query_clarification.py | 2 +- docs/examples/intrinsics/query_rewrite.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/examples/intrinsics/policy_guardrails.py b/docs/examples/intrinsics/policy_guardrails.py index 658d83d3e..96624f293 100644 --- a/docs/examples/intrinsics/policy_guardrails.py +++ b/docs/examples/intrinsics/policy_guardrails.py @@ -17,7 +17,7 @@ # Create the backend. ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/query_clarification.py b/docs/examples/intrinsics/query_clarification.py index 675b34d33..25e48394a 100644 --- a/docs/examples/intrinsics/query_clarification.py +++ b/docs/examples/intrinsics/query_clarification.py @@ -13,7 +13,7 @@ from mellea.stdlib.components.intrinsic import rag ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/query_rewrite.py b/docs/examples/intrinsics/query_rewrite.py index d5bc74553..d3c9880f0 100644 --- a/docs/examples/intrinsics/query_rewrite.py +++ b/docs/examples/intrinsics/query_rewrite.py @@ -13,7 +13,7 @@ from mellea.stdlib.components.intrinsic import rag ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. From 94885c2d4d15d5dabec75d1fe5371ac60126836b Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Thu, 30 Apr 2026 17:04:36 -0400 Subject: [PATCH 03/11] Change back to SWITCH to make later search/replace easier. Signed-off-by: Nathan Fulton --- docs/examples/intrinsics/intrinsics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/intrinsics/intrinsics.py b/docs/examples/intrinsics/intrinsics.py index 4bfe0672c..83a6f2631 100644 --- a/docs/examples/intrinsics/intrinsics.py +++ b/docs/examples/intrinsics/intrinsics.py @@ -15,7 +15,7 @@ # Requires the adapter for this intrinsic to be embedded in the Granite Switch # model. See docs/examples/granite-switch/ for a full runnable example. # from mellea.backends.openai import OpenAIBackend -# from mellea.backends.model_ids import IBM_GRANITE_4_1_3B +# from mellea.backends.model_ids import IBM_GRANITE_SWITCH_4_1_3B # from mellea.formatters import TemplateFormatter # # backend = OpenAIBackend( From f01ee35379cc915ec7e763d956c13c73a1770d67 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 11:36:26 -0400 Subject: [PATCH 04/11] Updates examples for 3 intrinsics * context_relevance: use 4.0 and leave comment explaining why. * requirement check: switch to 4.1 * uncertainty: switch to 4.1 Signed-off-by: Nathan Fulton --- docs/examples/intrinsics/context_relevance.py | 4 ++-- docs/examples/intrinsics/requirement_check.py | 2 +- docs/examples/intrinsics/uncertainty.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/intrinsics/context_relevance.py b/docs/examples/intrinsics/context_relevance.py index 6fe4adf9d..2080f8141 100644 --- a/docs/examples/intrinsics/context_relevance.py +++ b/docs/examples/intrinsics/context_relevance.py @@ -12,9 +12,9 @@ from mellea.stdlib.components.intrinsic import rag ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" ) -# NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. +# NOTE: this example uses Granite 4.0 micro because there is no context_relevance intrinsic for Graniet 4.1 question = "Who is the CEO of Microsoft?" document = ( diff --git a/docs/examples/intrinsics/requirement_check.py b/docs/examples/intrinsics/requirement_check.py index 8fbfe0991..58da63d9c 100644 --- a/docs/examples/intrinsics/requirement_check.py +++ b/docs/examples/intrinsics/requirement_check.py @@ -40,7 +40,7 @@ requirement = "Use a professional tone." ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. diff --git a/docs/examples/intrinsics/uncertainty.py b/docs/examples/intrinsics/uncertainty.py index 17c7d84ac..3982f0c3a 100644 --- a/docs/examples/intrinsics/uncertainty.py +++ b/docs/examples/intrinsics/uncertainty.py @@ -16,7 +16,7 @@ from mellea.stdlib.components.intrinsic import core ctx, backend = start_backend( - "hf", model_id=model_ids.IBM_GRANITE_4_MICRO_3B, context_type="chat" + "hf", model_id=model_ids.IBM_GRANITE_4_1_3B, context_type="chat" ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. From 50aca7ea7adfd60560fb57a190e0d582ebc673d7 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 11:42:39 -0400 Subject: [PATCH 05/11] update AGENDA.md to granite 4.1 Signed-off-by: Nathan Fulton --- AGENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index cc068f107..d76298fff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -187,7 +187,7 @@ from mellea.stdlib.components import Message from mellea.stdlib.components.intrinsic import core from mellea.stdlib.context import ChatContext -backend = LocalHFBackend(model_id="ibm-granite/granite-4.0-micro") +backend = LocalHFBackend(model_id="ibm-granite/granite-4.1-3b") context = ( ChatContext() .add(Message("user", "What is the square root of 4?")) @@ -223,5 +223,5 @@ https://huggingface.co/ibm-granite/granitelib-rag-r1.0/blob/main/{intrinsic_name Core and Guardian intrinsics (include model subfolder): ``` -https://huggingface.co/ibm-granite/granitelib-{core,guardian}-r1.0/blob/main/{intrinsic_name}/granite-4.0-micro/README.md +https://huggingface.co/ibm-granite/granitelib-{core,guardian,rag}-r1.0/blob/main/{intrinsic_name}/granite-4.1-{3b,8b,30b}/{lora,alora}/README.md ``` From 599d98f90820be28e5709d2d9aae8917afe8cb4a Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 11:43:49 -0400 Subject: [PATCH 06/11] mention context-relevance model availability in AGENTS.md long-term it probably makes sense to add another column to the intrinsics list. Signed-off-by: Nathan Fulton --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index d76298fff..cb07d5b31 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -178,7 +178,7 @@ Intrinsics are specialized LoRA adapters that add task-specific capabilities (RA | `rag` | `rewrite_question(question, context, backend)` | Rewrite question into a retrieval query | | `rag` | `clarify_query(question, documents, context, backend)` | Generate clarification or return "CLEAR" | | `rag` | `find_citations(response, documents, context, backend)` | Document sentences supporting the response | -| `rag` | `check_context_relevance(question, document, context, backend)` | Whether a document is relevant (0–1) | +| `rag` | `check_context_relevance(question, document, context, backend)` | Whether a document is relevant (0–1); only supported for granite-4.0, not granite-4.1 | | `rag` | `flag_hallucinated_content(response, documents, context, backend)` | Flag potentially hallucinated sentences | ```python From 06c6f59956025e634644a7e8ef63d04e19ffbe59 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 11:47:43 -0400 Subject: [PATCH 07/11] Adds 3b/8b/30b models to BASE_MODEL_TO_CANONICAL_NAME Signed-off-by: Nathan Fulton --- mellea/formatters/granite/intrinsics/constants.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mellea/formatters/granite/intrinsics/constants.py b/mellea/formatters/granite/intrinsics/constants.py index 497d54845..5ff18a0b7 100644 --- a/mellea/formatters/granite/intrinsics/constants.py +++ b/mellea/formatters/granite/intrinsics/constants.py @@ -33,6 +33,9 @@ "ibm-granite/granite-3.3-2b-instruct": "granite-3.3-2b-instruct", "openai/gpt-oss-20b": "gpt-oss-20b", "ibm-granite/granite-4.0-micro": "granite-4.0-micro", + "ibm-granite/granite-4.1-3b": "granite-4.1-3b", + "ibm-granite/granite-4.1-8b": "granite-4.1-8b", + "ibm-granite/granite-4.1-30b": "granite-4.1-30b", "granite4:micro": "granite4_micro", } """Base model names that we accept for LoRA/aLoRA adapters in intrinsics libraries. From d24162c4a4727aaa6aec923de086ea2f51999cf3 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 11:54:39 -0400 Subject: [PATCH 08/11] Adds 4.1-3b to _LOCAL_BASE_MODELS for intrinsics formatter tests. Signed-off-by: Nathan Fulton --- test/formatters/granite/test_intrinsics_formatters.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/formatters/granite/test_intrinsics_formatters.py b/test/formatters/granite/test_intrinsics_formatters.py index d1ae3618d..30be6f1d2 100644 --- a/test/formatters/granite/test_intrinsics_formatters.py +++ b/test/formatters/granite/test_intrinsics_formatters.py @@ -254,6 +254,7 @@ def _resolve_yaml(self): # Base models that are small enough to run locally with transformers _LOCAL_BASE_MODELS = { + "ibm-granite/granite-4.1-3b", "ibm-granite/granite-4.0-micro", "ibm-granite/granite-3.3-2b-instruct", } From f37b94f580ca514bd8a149fced34404d9dd76ef9 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 11:55:39 -0400 Subject: [PATCH 09/11] Changes tests and examples from 4.0 to 4.1 Signed-off-by: Nathan Fulton --- docs/examples/aLora/example_readme_generator.py | 2 +- test/stdlib/components/intrinsic/test_core.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/aLora/example_readme_generator.py b/docs/examples/aLora/example_readme_generator.py index 94ef46883..c7369ed34 100644 --- a/docs/examples/aLora/example_readme_generator.py +++ b/docs/examples/aLora/example_readme_generator.py @@ -6,7 +6,7 @@ if __name__ == "__main__": generate_readme( dataset_path="stembolt_failure_dataset.jsonl", - base_model="granite-4.0-micro", + base_model="granite-4.1-3b", prompt_file=None, output_path="stembolts_model_readme.md", name="your-username/stembolts-alora", diff --git a/test/stdlib/components/intrinsic/test_core.py b/test/stdlib/components/intrinsic/test_core.py index 600e27b30..3c8df0eb9 100644 --- a/test/stdlib/components/intrinsic/test_core.py +++ b/test/stdlib/components/intrinsic/test_core.py @@ -39,7 +39,7 @@ """Location of data files for the tests in this file.""" -BASE_MODEL = "ibm-granite/granite-4.0-micro" +BASE_MODEL = "ibm-granite/granite-4.1-3b" @pytest.fixture(name="backend", scope="module") From 8569329ef634a18c7a8e0c1efb5183f8073a1c50 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 13:48:40 -0400 Subject: [PATCH 10/11] requirement_check -> requirement-check Signed-off-by: Nathan Fulton --- docs/examples/intrinsics/intrinsics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/intrinsics/intrinsics.py b/docs/examples/intrinsics/intrinsics.py index 83a6f2631..36eb19b26 100644 --- a/docs/examples/intrinsics/intrinsics.py +++ b/docs/examples/intrinsics/intrinsics.py @@ -29,7 +29,7 @@ # Create the Adapter. IntrinsicAdapter's default to ALORAs. req_adapter = IntrinsicAdapter( - "requirement_check", base_model_name=backend.base_model_name + "requirement-check", base_model_name=backend.base_model_name ) # Add the adapter to the backend. @@ -43,15 +43,15 @@ # ALORA and then LORA adapters. out, new_ctx = mfuncs.act( Intrinsic( - "requirement_check", + "requirement-check", intrinsic_kwargs={"requirement": "The assistant is helpful."}, ), ctx, backend, ) -# Print the output. The requirement_check adapter has a specific output format: -print(out) # {"requirement_likelihood": 1.0} +# Print the output. The requirement-check adapter has a specific output format: +print(out) # {"requirement_check": {"score": 0.41272119992000356}} # The AloraRequirement uses this adapter. It automatically parses that output # when validating the output. From 121307a9bd5620f21df23a1694e14d223f21db19 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Fri, 1 May 2026 15:54:39 -0400 Subject: [PATCH 11/11] A little bit of style cleanup. Signed-off-by: Nathan Fulton --- docs/examples/intrinsics/query_rewrite.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/examples/intrinsics/query_rewrite.py b/docs/examples/intrinsics/query_rewrite.py index d3c9880f0..943fd8014 100644 --- a/docs/examples/intrinsics/query_rewrite.py +++ b/docs/examples/intrinsics/query_rewrite.py @@ -1,13 +1,3 @@ -# pytest: huggingface, e2e - -"""Example usage of the query rewrite intrinsic for RAG applications. - -To run this script from the root of the Mellea source tree, use the command: -``` -uv run python docs/examples/intrinsics/query_rewrite.py -``` -""" - from mellea import model_ids, start_backend from mellea.stdlib.components import Message from mellea.stdlib.components.intrinsic import rag @@ -17,7 +7,7 @@ ) # NOTE: This example can also be run with the OpenAIBackend using a GraniteSwitch model. See docs/examples/granite-switch/. -ctx = ( +ctx_with_question = ( ctx.add(Message("assistant", "Welcome to pet questions!")) .add( Message( @@ -34,12 +24,10 @@ "probably enjoys her cozy indoor life.", ) ) + .add(Message("user", "But is he more likely to get fleas because of that?")) ) -next_user_turn = "But is he more likely to get fleas because of that?" -ctx_with_question = ctx.add(Message("user", next_user_turn)) - -print(f"Original user question: {next_user_turn}") +print("Original user question: 'But is he more likely to get fleas because of that?'") result = rag.rewrite_question(None, ctx_with_question, backend) print(f"Rewritten user question: {result}")