Chat streams an assistant response on the returned channel, closing it when the stream ends. Reasoning runs at `high` effort by default; if the server rejects the tools + reasoning_effort combo (newer OpenAI models do), postChat drops reasoning_effort for this Client's lifetime so the model still wo
(parent context.Context, messages []chmctx.Message, tools []Tool)
| 284 | // drops reasoning_effort for this Client's lifetime so the model still works, |
| 285 | // with tools but no reasoning. Staying on chat-completions is the product line; |
| 286 | // we do not branch to /v1/responses to keep reasoning. |
| 287 | func (c *Client) Chat(parent context.Context, messages []chmctx.Message, tools []Tool) <-chan Event { |
| 288 | out := make(chan Event, 32) |
| 289 | go c.run(parent, messages, tools, out) |
| 290 | return out |
| 291 | } |
| 292 | |
| 293 | func (c *Client) run(parent context.Context, msgs []chmctx.Message, tools []Tool, out chan<- Event) { |