fix : execution problem when line start with block tag + dont load tts if disabled
This commit is contained in:
@@ -161,9 +161,7 @@ class Tools():
|
||||
if start_pos == -1:
|
||||
break
|
||||
|
||||
line_start = llm_text.rfind('\n', 0, start_pos) + 1
|
||||
if line_start == 0:
|
||||
line_start = 0
|
||||
line_start = llm_text.rfind('\n', 0, start_pos)+1
|
||||
leading_whitespace = llm_text[line_start:start_pos]
|
||||
|
||||
end_pos = llm_text.find(end_tag, start_pos + len(start_tag))
|
||||
@@ -191,15 +189,13 @@ class Tools():
|
||||
if __name__ == "__main__":
|
||||
tool = Tools()
|
||||
tool.tag = "python"
|
||||
rt = tool.load_exec_block("""
|
||||
Got it, let me show you the Python files in the current directory using Python:
|
||||
|
||||
```python
|
||||
rt = tool.load_exec_block("""```python
|
||||
import os
|
||||
|
||||
for file in os.listdir():
|
||||
if file.endswith('.py'):
|
||||
print(file)
|
||||
```
|
||||
goodbye!
|
||||
""")
|
||||
print(rt)
|
||||
Reference in New Issue
Block a user