From 581377fc4b802a4c274c1bc824e8e347dd50a606 Mon Sep 17 00:00:00 2001 From: monst Date: Thu, 12 Oct 2023 12:44:11 +0200 Subject: [PATCH] Update docs --- app/services/guidance_wrapper.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/services/guidance_wrapper.py b/app/services/guidance_wrapper.py index baf3a29d..834a8fd3 100644 --- a/app/services/guidance_wrapper.py +++ b/app/services/guidance_wrapper.py @@ -31,10 +31,12 @@ def query(self) -> dict: Reraises exception from guidance package """ - # Perform a regex search to find the names of the variables being generated - # by the handlebars template - # This regex matches strings like: {{gen 'response' temperature=0.0 max_tokens=500}} - # and extracts the variable name 'response' + # Perform a regex search to find the names of the variables + # being generated in the program. This regex matches strings like: + # {{gen 'response' temperature=0.0 max_tokens=500}} + # {{#geneach 'values' num_iterations=3}} + # {{set 'answer' (truncate response 3)}} + # and extracts the variable names 'response', 'values', and 'answer' pattern = r'{{#?(?:gen|geneach|set) +[\'"]([^\'"]+)[\'"]' var_names = re.findall(pattern, self.handlebars)