MCPcopy
hub / github.com/Doorman11991/smallcode / constructor

Method constructor

src/api/index.js:25–43  ·  view source on GitHub ↗
(config = {})

Source from the content-addressed store, hash-verified

23
24class SmallCode extends EventEmitter {
25 constructor(config = {}) {
26 super();
27 this.config = {
28 model: config.model || process.env.SMALLCODE_MODEL || '',
29 baseUrl: config.baseUrl || process.env.SMALLCODE_BASE_URL || 'http://localhost:1234/v1',
30 provider: config.provider || process.env.SMALLCODE_PROVIDER || 'openai',
31 apiKey: config.apiKey || process.env.OPENAI_API_KEY || null,
32 contextWindow: config.contextWindow || 0,
33 maxToolCalls: config.maxToolCalls || 50,
34 timeout: config.timeout || 120000,
35 cwd: config.cwd || process.cwd(),
36 tools: config.tools || null, // null = all tools
37 verbose: config.verbose || false,
38 };
39
40 this.earlyStop = new EarlyStopDetector();
41 this.profile = getProfile(this.config.model, this.config.contextWindow);
42 this._history = [];
43 }
44
45 /**
46 * Run a single prompt through the agent loop.

Callers

nothing calls this directly

Calls 1

getProfileFunction · 0.85

Tested by

no test coverage detected