mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-15 09:02:35 +00:00
10 lines
454 B
TypeScript
10 lines
454 B
TypeScript
import { Stream } from "effect"
|
|
import { LLMClient } from "../../src/route"
|
|
import type { Tools } from "../../src/tool"
|
|
import type { RunOptions } from "../../src/tool-runtime"
|
|
|
|
type CompatRunOptions<T extends Tools> = RunOptions<T> & { readonly maxSteps?: number }
|
|
|
|
export const runTools = <T extends Tools>(options: CompatRunOptions<T>) =>
|
|
LLMClient.stream({ ...options, stopWhen: options.stopWhen ?? LLMClient.stepCountIs(options.maxSteps ?? 10) })
|