Config¶
pycodeloop.core.config.Config
¶
Import
You can import the Config class with:
from pycodeloop import Config
from pycodeloop.providers import GenericProvider
Example
class pycodeloop.core.config.Config
config = Config(
provider=GenericProvider.from_json("path/to/config.json"),
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
Optional[Provider]
|
LLM backend driving the agent —
always a |
None
|
tools
|
Optional[List[Tool]]
|
Tools exposed to the agent. Defaults to the built-in read/write/edit/grep/bash set. |
None
|
system_prompt
|
Optional[str]
|
Overrides the default system prompt. |
None
|
max_turns
|
int
|
Hard cap on tool-use loop iterations. |
MAX_TURNS
|
max_history_turns
|
Optional[int]
|
Cap the session on the
number of most recent user-initiated turns kept — older
turns are dropped as a whole unit (never mid tool_calls/
tool_result) before each provider call. Defaults to |
20
|
skills
|
bool
|
Discover Claude Code skills/memory, Cursor rules,
and AGENTS.md files on this machine and this project, expose
them as a |
False
|
skill_sources
|
Optional[Set[str]]
|
Limit discovery to these sources ("claude-skill", "claude-memory", "cursor-rule", "agents-md"). Defaults to all of them. |
None
|
skills_refresh
|
bool
|
Skip the |
False
|
delegation
|
bool
|
Expose a |
False
|
memory
|
bool
|
Load |
True
|
trace
|
bool
|
Append one JSON line per provider call, tool call/
result, retry, and compaction event to
|
True
|
storage
|
Optional[Sessions]
|
Persists the session so
|
None
|
workspace
|
bool
|
Jail read_file/write_file/edit_file/
delete_file/grep/glob to the process's working directory —
an absolute path or |
True
|
Attributes:
| Name | Type | Description |
|---|---|---|
provider |
Provider
|
|
tools |
List[Tool]
|
|
system_prompt |
Optional[str]
|
|
max_turns |
int
|
|
skills |
List[Skill]
|
|
storage |
Optional[Sessions]
|
|
Source code in pycodeloop/core/config.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
max_history_turns = max_history_turns
instance-attribute
¶
max_turns = max_turns
instance-attribute
¶
provider = provider if provider is not None else _default_provider()
instance-attribute
¶
skills = self._discover_skills(skills, skill_sources, skills_refresh)
instance-attribute
¶
storage = None if storage is False else storage or _default_storage()
instance-attribute
¶
system_prompt = system_prompt
instance-attribute
¶
tools = list(tools) if tools is not None else list(DEFAULT_TOOLS)
instance-attribute
¶
trace = trace
instance-attribute
¶
workspace = workspace
instance-attribute
¶
__init__(provider=None, tools=None, system_prompt=None, max_turns=Settings.MAX_TURNS, max_history_turns=20, skills=False, skill_sources=None, skills_refresh=False, delegation=False, memory=True, trace=True, storage=None, workspace=True)
¶
Source code in pycodeloop/core/config.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |