Restore to commit 74e578279624c6045ca440a3459ebfa1f8d54191
This commit is contained in:
26
scripts/_test_opencode_config.js
Normal file
26
scripts/_test_opencode_config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const OPENCODE_OLLAMA_PROVIDER='ollama';
|
||||
const OPENCODE_OLLAMA_MODEL='qwen3:0.6b';
|
||||
const OPENCODE_OLLAMA_BASE_URL='https://ollama.plugincompass.com';
|
||||
const OPENCODE_OLLAMA_API_KEY='abc123';
|
||||
const baseUrl=(OPENCODE_OLLAMA_BASE_URL||'https://ollama.plugincompass.com').replace(/\/+$/,'');
|
||||
const providerCfg={
|
||||
options:{ baseURL: baseUrl },
|
||||
models: {
|
||||
[OPENCODE_OLLAMA_MODEL]: {
|
||||
id: OPENCODE_OLLAMA_MODEL,
|
||||
name: OPENCODE_OLLAMA_MODEL,
|
||||
tool_call: true,
|
||||
temperature: true
|
||||
}
|
||||
}
|
||||
};
|
||||
if (OPENCODE_OLLAMA_API_KEY) providerCfg.options.apiKey = OPENCODE_OLLAMA_API_KEY;
|
||||
const cfg = {
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
model: `${OPENCODE_OLLAMA_PROVIDER}/${OPENCODE_OLLAMA_MODEL}`,
|
||||
small_model: `${OPENCODE_OLLAMA_PROVIDER}/${OPENCODE_OLLAMA_MODEL}`,
|
||||
provider: {
|
||||
[OPENCODE_OLLAMA_PROVIDER]: providerCfg
|
||||
}
|
||||
};
|
||||
console.log(JSON.stringify(cfg, null, 2));
|
||||
Reference in New Issue
Block a user