We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61a57db commit 9832e39Copy full SHA for 9832e39
sigllm/primitives/prompting/huggingface.py
@@ -25,14 +25,17 @@
25
26
27
def get_examples(text, k=3):
28
- """Extracts the content within the first three sets of parentheses in a string.
+ """Extracts the content within the first k sets of parentheses in a string.
29
30
Args:
31
- text (str): Input string.
+ text (str):
32
+ Input string.
33
+ k (int):
34
+ Number of examples to return.
35
36
Returns:
37
list:
- A list containing the content within the first three sets of parentheses.
38
+ A list containing the content within the first k sets of parentheses.
39
"""
40
matches = re.findall(r'\(([^)]*)\)', text)
41
return matches[:k]
0 commit comments