Skip to content

Commit 134a277

Browse files
committed
Fix doctest examples format
1 parent 3daec26 commit 134a277

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

Diff for: interpreter/__init__.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@
1414
------------
1515
>>> from interpreter import Interpreter, Config
1616
17-
# Use defaults
18-
interpreter = Interpreter()
17+
Use defaults:
1918
20-
# Load from custom profile
21-
config = Config.from_file("~/custom_profile.py")
22-
interpreter = Interpreter(config)
19+
>>> interpreter = Interpreter()
20+
21+
Load from custom profile:
22+
23+
>>> config = Config.from_file("~/custom_profile.py")
24+
>>> interpreter = Interpreter(config)
25+
26+
Save current settings:
2327
24-
# Save current settings
25-
interpreter.save_config("~/my_settings.py")
28+
>>> interpreter.save_config("~/my_settings.py")
2629
"""
2730

2831
# Use lazy imports to avoid loading heavy modules immediately

Diff for: interpreter/interpreter.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,20 @@ class Interpreter:
9393
--------
9494
>>> from interpreter import Interpreter
9595
96-
# Basic usage
97-
interpreter = Interpreter()
98-
interpreter.chat()
96+
Basic usage:
9997
100-
# With custom configuration
101-
from interpreter import Profile
102-
profile = Profile.from_file("~/custom_profile.py")
103-
interpreter = Interpreter(profile)
98+
>>> interpreter = Interpreter()
99+
>>> interpreter.chat()
104100
105-
# Save settings for later
106-
interpreter.save_profile("~/my_settings.py")
101+
With custom configuration:
102+
103+
>>> from interpreter import Profile
104+
>>> profile = Profile.from_file("~/custom_profile.py")
105+
>>> interpreter = Interpreter(profile)
106+
107+
Save settings for later:
108+
109+
>>> interpreter.save_profile("~/my_settings.py")
107110
108111
Parameters
109112
----------

Diff for: interpreter/profiles.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ class Profile:
1616
--------
1717
>>> from interpreter import Profile
1818
19-
# Load defaults (and ~/.openinterpreter if it exists)
20-
profile = Profile()
19+
Load defaults (and ~/.openinterpreter if it exists):
2120
22-
# Load from specific profile
23-
profile = Profile.from_file("~/custom_profile.py")
21+
>>> profile = Profile()
2422
25-
# Save current settings
26-
profile.save("~/my_settings.py")
23+
Load from specific profile:
24+
25+
>>> profile = Profile.from_file("~/custom_profile.py")
26+
27+
Save current settings:
28+
29+
>>> profile.save("~/my_settings.py")
2730
"""
2831

2932
DEFAULT_PROFILE_FOLDER = "~/.openinterpreter"

0 commit comments

Comments
 (0)