Skip to content

Commit

Permalink
perf(GithubModelsCliGenerator): Optimize command generation
Browse files Browse the repository at this point in the history
- Refactor command preparation to use ensureWithOptions for cleaner code
- Reduce complexity by removing array_merge, streamlining the process
- Enhance maintainability and readability of the command execution logic
  • Loading branch information
[email protected] committed Nov 2, 2024
1 parent 2e0bcd1 commit cf1bc1d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/Generators/GithubModelsCliGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ public function generate(string $prompt): string
return resolve(
Process::class,
[
'command' => array_merge(
[$this->config['binary'], 'models', 'run', $this->config['model'], $prompt],
$this->hydratedOptions()
),
'command' => $this->ensureWithOptions([$this->config['binary'], 'models', 'run', $this->config['model'], $prompt]),
] + $this->config['parameters']
)->mustRun($this->defaultRunningCallback())->getOutput();
}
Expand Down

0 comments on commit cf1bc1d

Please sign in to comment.