ol.llx.ai
platforms: clj, cljs
complete*
clj
platforms: clj
(complete* env model context opts)
Runs one non-streaming assistant turn using provider-style options.
Use complete* when you need provider-level control and adapter-specific
options. This is the provider path.
opts is validated against :ol.llx/provider-request-options in
src/ol/llx/ai/impl/schema/options.cljc.
Adapter build-request boundaries also validate adapter-specific schemas:
:ol.llx/openai-completions-provider-options,
:ol.llx/openai-responses-provider-options,
:ol.llx/anthropic-provider-options, and
:ol.llx/google-provider-options.
Common provider option keys:
| key | description |
|---|---|
|
Requested output token cap. |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Provider reasoning map (shape depends on adapter). |
|
Optional session identifier for provider-side caching/routing. |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
|
Retry count for transient failures (default |
Returns a promise that resolves to one canonical assistant message map. Errors reject the promise with structured LLX exception data.
Use complete for the unified API.
cljs
platforms: cljs
(complete* env model context opts)
Runs one non-streaming assistant turn using provider-style options.
Use complete* when you need provider-level control and adapter-specific
options. This is the provider path.
opts is validated against :ol.llx/provider-request-options in
src/ol/llx/ai/impl/schema/options.cljc.
Adapter build-request boundaries also validate adapter-specific schemas:
:ol.llx/openai-completions-provider-options,
:ol.llx/openai-responses-provider-options,
:ol.llx/anthropic-provider-options, and
:ol.llx/google-provider-options.
Common provider option keys:
| key | description |
|---|---|
|
Requested output token cap. |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Provider reasoning map (shape depends on adapter). |
|
Optional session identifier for provider-side caching/routing. |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
|
Retry count for transient failures (default |
Returns a promise that resolves to one canonical assistant message map. Errors reject the promise with structured LLX exception data.
Use complete for the unified API.
stream*
clj
platforms: clj
(stream* env model context opts)
Runs one streaming assistant turn using provider-style options.
Use stream* when you need provider-level control and adapter-specific
options. This is the provider path.
opts is validated against :ol.llx/provider-request-options in
src/ol/llx/ai/impl/schema/options.cljc, and adapter-specific schemas are
enforced at each adapter build-request boundary.
Common provider option keys:
| key | description |
|---|---|
|
Requested output token cap. |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Provider reasoning map (shape depends on adapter). |
|
Optional session identifier for provider-side caching/routing. |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
|
Retry count for transient failures (default |
Returns a Promesa CSP channel emitting canonical LLX event maps.
Stream completion emits terminal :done or :error and closes the channel.
Consumer cancellation is channel closure.
Use stream for the unified API.
cljs
platforms: cljs
(stream* env model context opts)
Runs one streaming assistant turn using provider-style options.
Use stream* when you need provider-level control and adapter-specific
options. This is the provider path.
opts is validated against :ol.llx/provider-request-options in
src/ol/llx/ai/impl/schema/options.cljc, and adapter-specific schemas are
enforced at each adapter build-request boundary.
Common provider option keys:
| key | description |
|---|---|
|
Requested output token cap. |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Provider reasoning map (shape depends on adapter). |
|
Optional session identifier for provider-side caching/routing. |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
|
Retry count for transient failures (default |
Returns a Promesa CSP channel emitting canonical LLX event maps.
Stream completion emits terminal :done or :error and closes the channel.
Consumer cancellation is channel closure.
Use stream for the unified API.
complete
clj
platforms: clj
(complete env model context unified-opts)
Runs one non-streaming assistant turn using the unified options API.
This is the unified path and is recommended for most callers.
opts is validated against :ol.llx/unified-request-options in
src/ol/llx/ai/impl/schema/options.cljc.
Unified options are normalized and forwarded to provider adapters.
For example:
- :max-tokens → provider :max-output-tokens
- :reasoning / :reasoning-effort → provider reasoning shape
Unified option keys:
| key | description |
|---|---|
|
Requested output cap. Defaults to |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Reasoning level keyword ( |
|
Alias for |
|
Optional session identifier for provider-side caching/routing. |
|
Optional token budgets per reasoning level (provider-dependent). |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
Returns a promise that resolves to one canonical assistant message map. Errors reject the promise with structured LLX exception data.
Use complete* if you need provider-specific options that are outside the
unified schema.
cljs
platforms: cljs
(complete env model context unified-opts)
Runs one non-streaming assistant turn using the unified options API.
This is the unified path and is recommended for most callers.
opts is validated against :ol.llx/unified-request-options in
src/ol/llx/ai/impl/schema/options.cljc.
Unified options are normalized and forwarded to provider adapters.
For example:
- :max-tokens → provider :max-output-tokens
- :reasoning / :reasoning-effort → provider reasoning shape
Unified option keys:
| key | description |
|---|---|
|
Requested output cap. Defaults to |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Reasoning level keyword ( |
|
Alias for |
|
Optional session identifier for provider-side caching/routing. |
|
Optional token budgets per reasoning level (provider-dependent). |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
Returns a promise that resolves to one canonical assistant message map. Errors reject the promise with structured LLX exception data.
Use complete* if you need provider-specific options that are outside the
unified schema.
stream
clj
platforms: clj
(stream env model context unified-opts)
Runs one streaming assistant turn using the unified options API.
This is the unified path and is recommended for most callers.
opts is validated against :ol.llx/unified-request-options in
src/ol/llx/ai/impl/schema/options.cljc.
Unified option keys:
| key | description |
|---|---|
|
Requested output cap. Defaults to |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Reasoning level keyword ( |
|
Alias for |
|
Optional session identifier for provider-side caching/routing. |
|
Optional token budgets per reasoning level (provider-dependent). |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
Returns a Promesa CSP channel emitting canonical LLX event maps.
Stream completion emits terminal :done or :error and closes the channel.
Consumer cancellation is channel closure.
Use stream* for provider-specific option control.
cljs
platforms: cljs
(stream env model context unified-opts)
Runs one streaming assistant turn using the unified options API.
This is the unified path and is recommended for most callers.
opts is validated against :ol.llx/unified-request-options in
src/ol/llx/ai/impl/schema/options.cljc.
Unified option keys:
| key | description |
|---|---|
|
Requested output cap. Defaults to |
|
Sampling temperature. |
|
Nucleus sampling probability. |
|
Reasoning level keyword ( |
|
Alias for |
|
Optional session identifier for provider-side caching/routing. |
|
Optional token budgets per reasoning level (provider-dependent). |
|
Provider API key override for this call. |
|
Additional provider request headers. |
|
Abort/cancel signal forwarded to runtime/provider layer. |
|
Optional cap for server-requested retry delays. |
|
Request metadata map forwarded to adapter payload builders. |
|
Per-call adapter registry override. |
Returns a Promesa CSP channel emitting canonical LLX event maps.
Stream completion emits terminal :done or :error and closes the channel.
Consumer cancellation is channel closure.
Use stream* for provider-specific option control.
context-overflow?
clj
platforms: clj
(context-overflow? assistant-message)
(context-overflow? assistant-message context-window)
Returns true when the input matches known context-window overflow patterns.
cljs
platforms: cljs
(context-overflow? assistant-message)
(context-overflow? assistant-message context-window)
Returns true when the input matches known context-window overflow patterns.