Collapse RunWithOpts duplicates into variadic options

Run, RunStreamed, and Resume each shipped both a no-options form and a
mirror *WithOpts form taking variadic RunOption. Variadic parameters
are backward-compatible additions, so the wrappers were dead surface.

Make Run, RunStreamed, and Resume directly variadic and update the two
internal callers.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
Aurélien Sibiril
2026-04-26 16:31:29 +02:00
parent feeb6496b9
commit e5b354c3b4
4 changed files with 5 additions and 17 deletions

View File

@@ -59,11 +59,7 @@ func (sr *StreamedRun) Wait() (*Result, error) {
return sr.result, sr.err
}
func (a *Agent) RunStreamed(ctx context.Context, messages []llm.Message) *StreamedRun {
return a.RunStreamedWithOpts(ctx, messages)
}
func (a *Agent) RunStreamedWithOpts(ctx context.Context, messages []llm.Message, opts ...RunOption) *StreamedRun {
func (a *Agent) RunStreamed(ctx context.Context, messages []llm.Message, opts ...RunOption) *StreamedRun {
events := make(chan StreamEvent, 64)
sr := &StreamedRun{
Events: events,