4 Chat
(chat model |
#:messages messages #:tools tools #:tool-choice choice |
#:temperature temperature #:max-tokens max-tokens #:system system |
#:provider provider-id #:api-key api-key #:base-url base-url) |
-> response? |
(ask model prompt ...) -> string? |
(chat-with-tools model messages tools #:max-rounds rounds ...) -> response? |
(response content tool-calls stop-reason model usage raw) -> response? |
chat returns the full response: content, any tool calls (returned, never executed — run them yourself with run-tool-calls, or let chat-with-tools run the request/execute/reply loop until the model answers without calls or #:max-rounds is spent), the stop reason, token usage, and the raw JSON body.
The uniform surface keeps only options every provider honors the same way. Anthropic receives max-tokens with a 1024 default; hidden per-vendor extras belong in a dedicated adapter, not in the shared API.