Set default working directory for OpenCode to ~/Workspace
This commit is contained in:
@@ -508,6 +508,7 @@ def build_llm(args: argparse.Namespace, vocabulary=None, brain=None, observer=No
|
||||
system_prompt += "\n\n" + memory
|
||||
return OpenCodeLLM(
|
||||
model=args.opencode_model,
|
||||
cwd=args.cwd,
|
||||
system_prompt=system_prompt,
|
||||
observer=observer,
|
||||
)
|
||||
|
||||
@@ -79,12 +79,14 @@ class OpenCodeLLM(FrameProcessor):
|
||||
self,
|
||||
*,
|
||||
model: str = "ollama-cloud/gemma4:31b",
|
||||
cwd: str | Path | None = None,
|
||||
system_prompt: str | None = None,
|
||||
observer=None,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(**kwargs)
|
||||
self._model = model
|
||||
self._cwd = Path(cwd or Path.home() / "Workspace").expanduser().resolve()
|
||||
self._system_prompt = system_prompt or "You are a helpful spoken voice assistant. Keep answers brief and conversational."
|
||||
self._on_reply = observer
|
||||
self._turn_task: asyncio.Task | None = None
|
||||
@@ -157,11 +159,13 @@ class OpenCodeLLM(FrameProcessor):
|
||||
self._cli_path,
|
||||
"run",
|
||||
"-m", self._model,
|
||||
"--dir", str(self._cwd),
|
||||
"--pure",
|
||||
prompt_str,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
stdin=asyncio.subprocess.DEVNULL,
|
||||
cwd=str(self._cwd),
|
||||
)
|
||||
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user