From c111134a552ea7145e2ca5c319565233c9619c93 Mon Sep 17 00:00:00 2001 From: Daniel Quinteros Date: Tue, 23 May 2023 23:43:38 -0400 Subject: [PATCH] =?UTF-8?q?Clarification=20of=20the=20reference=20to=20the?= =?UTF-8?q?=20"get=5Ftext=5Flegth"=20function=20in=20ge=E2=80=A6=20(#5154)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Clarification of the reference to the "get_text_legth" function in getting_started.md Reference to the function "get_text_legth" in the documentation did not make sense. Comment added for clarification. @hwchase17 --- docs/modules/prompts/prompt_templates/getting_started.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/modules/prompts/prompt_templates/getting_started.md b/docs/modules/prompts/prompt_templates/getting_started.md index 69526242..d7ad361a 100644 --- a/docs/modules/prompts/prompt_templates/getting_started.md +++ b/docs/modules/prompts/prompt_templates/getting_started.md @@ -228,7 +228,11 @@ example_selector = LengthBasedExampleSelector( example_prompt=example_prompt, # This is the maximum length that the formatted examples should be. # Length is measured by the get_text_length function below. - max_length=25, + max_length=25 + # This is the function used to get the length of a string, which is used + # to determine which examples to include. It is commented out because + # it is provided as a default value if none is specified. + # get_text_length: Callable[[str], int] = lambda x: len(re.split("\n| ", x)) ) # We can now use the `example_selector` to create a `FewShotPromptTemplate`.