-
Notifications
You must be signed in to change notification settings - Fork 5k
/
Copy path__init__.py
46 lines (32 loc) · 1.15 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
Open Interpreter
===============
A natural language interface for your computer.
Basic Usage
----------
>>> from interpreter import Interpreter
>>> interpreter = Interpreter()
>>> interpreter.chat("Hello, what can you help me with?")
Configuration
------------
>>> from interpreter import Interpreter, Profile
Use defaults:
>>> interpreter = Interpreter()
Load from custom profile:
>>> profile = Profile.from_file("~/custom_profile.py")
>>> interpreter = Interpreter(profile)
Save current settings:
>>> interpreter.save_profile("~/my_settings.py")
"""
# Use lazy imports to avoid loading heavy modules immediately
from importlib import import_module
__version__ = "1.0.0" # Single source of truth for version
def __getattr__(name):
"""Lazy load attributes only when they're actually requested"""
if name in ["Interpreter", "Profile"]:
if name == "Interpreter":
return getattr(import_module(".interpreter", __package__), name)
else:
return getattr(import_module(".profiles", __package__), name)
raise AttributeError(f"module '{__package__}' has no attribute '{name}'")
__all__ = ["Interpreter", "Profile"]