# Kotlin API reference

Generated from `crates/goose-sdk/src/bindings.rs` for `goose-sdk 0.1.0-alpha.13` (documentation series 0.1). Do not edit this file.

This is the in-process provider and compaction API, not the full Rust agent runtime. Read the [crate overview](/docs/gdk/reference/index.md) for native Rust APIs.

[Versioned copy](/docs/gdk/sdk/0.1.0-alpha.13/api-reference-kotlin.md). Match the API snapshot to your installed package before writing code.

## Contents

- [Functions](#functions)
- [GooseException](#gooseerror)
- [RequestLogger](#requestlogger)
- [ProviderMessage](#providermessage)
- [MessageRole](#messagerole)
- [MessageContent](#messagecontent)
- [ProviderTool](#providertool)
- [ProviderModelConfig](#providermodelconfig)
- [ProviderModelInfo](#providermodelinfo)
- [Usage](#usage)
- [StreamChunk](#streamchunk)
- [GooseStreamError](#goosestreamerror)
- [GooseStreamErrorKind](#goosestreamerrorkind)
- [ProviderCompletion](#providercompletion)
- [Feature](#feature)
- [DecisionQuestion](#decisionquestion)
- [NoulCriteria](#noulcriteria)
- [DecisionRequest](#decisionrequest)
- [DecisionAnswer](#decisionanswer)
- [DecisionResponse](#decisionresponse)
- [DecisionProvider](#decisionprovider)
- [Provider](#provider)
- [CompactionMessage](#compactionmessage)
- [CompactionTemplates](#compactiontemplates)
- [CompactionSummary](#compactionsummary)
- [ProviderStream](#providerstream)

<a id="functions"></a>

## Functions

<a id="fn-anthropic-default-model"></a>

### `anthropicDefaultModel`

```kotlin
fun anthropicDefaultModel(): String
```

<a id="fn-anthropic-provider"></a>

### `anthropicProvider`

```kotlin
@Throws(GooseException::class)
fun anthropicProvider(apiKey: String, baseUrl: String?, betaHeaders: List<String>): Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-anthropic-provider-param-api-key"></a>`apiKey` | `String` | — | — |
| <a id="fn-anthropic-provider-param-base-url"></a>`baseUrl` | `String?` | — | — |
| <a id="fn-anthropic-provider-param-beta-headers"></a>`betaHeaders` | `List<String>` | — | — |

Raises `GooseException`.

<a id="fn-databricks-default-model"></a>

### `databricksDefaultModel`

```kotlin
fun databricksDefaultModel(): String
```

<a id="fn-databricks-provider"></a>

### `databricksProvider`

```kotlin
@Throws(GooseException::class)
fun databricksProvider(host: String, token: String): Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-databricks-provider-param-host"></a>`host` | `String` | — | — |
| <a id="fn-databricks-provider-param-token"></a>`token` | `String` | — | — |

Raises `GooseException`.

<a id="fn-databricks-v2-default-model"></a>

### `databricksV2DefaultModel`

```kotlin
fun databricksV2DefaultModel(): String
```

<a id="fn-databricks-v2-provider"></a>

### `databricksV2Provider`

```kotlin
@Throws(GooseException::class)
fun databricksV2Provider(host: String, token: String, gatewayPath: String? = null): Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-databricks-v2-provider-param-host"></a>`host` | `String` | — | — |
| <a id="fn-databricks-v2-provider-param-token"></a>`token` | `String` | — | — |
| <a id="fn-databricks-v2-provider-param-gateway-path"></a>`gatewayPath` | `String?` | `null` | — |

Raises `GooseException`.

<a id="fn-declarative-provider-from-json"></a>

### `declarativeProviderFromJson`

```kotlin
@Throws(GooseException::class)
fun declarativeProviderFromJson(json: String): Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-declarative-provider-from-json-param-json"></a>`json` | `String` | — | — |

Raises `GooseException`.

<a id="fn-default-compaction-templates"></a>

### `defaultCompactionTemplates`

```kotlin
fun defaultCompactionTemplates(): CompactionTemplates
```

<a id="fn-groq-default-model"></a>

### `groqDefaultModel`

```kotlin
fun groqDefaultModel(): String
```

<a id="fn-groq-provider"></a>

### `groqProvider`

```kotlin
@Throws(GooseException::class)
fun groqProvider(apiKey: String): Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-groq-provider-param-api-key"></a>`apiKey` | `String` | — | — |

Raises `GooseException`.

<a id="fn-install-request-logger"></a>

### `installRequestLogger`

Installs the process-wide provider request logger.

A logger can only be installed once for the lifetime of the process.

```kotlin
@Throws(GooseException::class)
fun installRequestLogger(logger: RequestLogger)
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-install-request-logger-param-logger"></a>`logger` | `RequestLogger` | — | — |

Raises `GooseException`.

<a id="fn-openai-default-model"></a>

### `openaiDefaultModel`

```kotlin
fun openaiDefaultModel(): String
```

<a id="fn-openai-provider"></a>

### `openaiProvider`

Create an OpenAI provider with an optional custom base URL.

Pass `None` for the default `https://api.openai.com`, or a custom host
(e.g. DeepSeek, Kimi) to enable reasoning-context preservation.

```kotlin
@Throws(GooseException::class)
fun openaiProvider(apiKey: String, baseUrl: String? = null): Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-openai-provider-param-api-key"></a>`apiKey` | `String` | — | — |
| <a id="fn-openai-provider-param-base-url"></a>`baseUrl` | `String?` | `null` | — |

Raises `GooseException`.

<a id="fn-openai-provider-simple"></a>

### `openaiProviderSimple`

Simple one-argument wrapper for Rust callers who do not need a custom base URL.

This preserves backward compatibility: existing code calling `openai_provider(api_key)`
can continue to compile after the `base_url` parameter was added.

```kotlin
@Throws(GooseException::class)
fun openaiProviderSimple(apiKey: String): Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-openai-provider-simple-param-api-key"></a>`apiKey` | `String` | — | — |

Raises `GooseException`.

<a id="fn-openrouter-decision-default-model"></a>

### `openrouterDecisionDefaultModel`

```kotlin
fun openrouterDecisionDefaultModel(): String
```

<a id="fn-openrouter-decision-provider"></a>

### `openrouterDecisionProvider`

```kotlin
@Throws(GooseException::class)
fun openrouterDecisionProvider(apiKey: String, baseUrl: String?): DecisionProvider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-openrouter-decision-provider-param-api-key"></a>`apiKey` | `String` | — | — |
| <a id="fn-openrouter-decision-provider-param-base-url"></a>`baseUrl` | `String?` | — | — |

Raises `GooseException`.

<a id="fn-typesafe-decision-default-model"></a>

### `typesafeDecisionDefaultModel`

```kotlin
fun typesafeDecisionDefaultModel(): String
```

<a id="fn-typesafe-decision-provider"></a>

### `typesafeDecisionProvider`

```kotlin
@Throws(GooseException::class)
fun typesafeDecisionProvider(apiKey: String, baseUrl: String?): DecisionProvider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-typesafe-decision-provider-param-api-key"></a>`apiKey` | `String` | — | — |
| <a id="fn-typesafe-decision-provider-param-base-url"></a>`baseUrl` | `String?` | — | — |

Raises `GooseException`.

<a id="gooseerror"></a>

## `GooseException`

Kind: error.

<a id="gooseerror-variant-ratelimited"></a>

### `GooseException.RateLimited`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-ratelimited-field-retry-after-ms"></a>`retryAfterMs` | `ULong?` | — | — |
| <a id="gooseerror-variant-ratelimited-field-retry-after-suffix"></a>`retryAfterSuffix` | `String` | — | — |

<a id="gooseerror-variant-outputtokenlimitexceeded"></a>

### `GooseException.OutputTokenLimitExceeded`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-outputtokenlimitexceeded-field-details"></a>`details` | `String` | — | — |

<a id="gooseerror-variant-contextlengthexceeded"></a>

### `GooseException.ContextLengthExceeded`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-contextlengthexceeded-field-details"></a>`details` | `String` | — | — |

<a id="gooseerror-variant-authentication"></a>

### `GooseException.Authentication`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-authentication-field-details"></a>`details` | `String` | — | — |

<a id="gooseerror-variant-timeout"></a>

### `GooseException.Timeout`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-timeout-field-details"></a>`details` | `String` | — | — |

<a id="gooseerror-variant-providerunavailable"></a>

### `GooseException.ProviderUnavailable`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-providerunavailable-field-details"></a>`details` | `String` | — | — |

<a id="gooseerror-variant-generic"></a>

### `GooseException.Generic`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-generic-field-details"></a>`details` | `String` | — | — |

<a id="requestlogger"></a>

## `RequestLogger`

Kind: callback.

Receives provider request logs as JSONL records.

`start` returns an identifier that is passed to `write` for every record in
that request, allowing callers to keep concurrent request logs separate.

<a id="requestlogger-start"></a>

#### `start`

```kotlin
@Throws(GooseException::class)
fun RequestLogger.start(): ULong
```

Raises `GooseException`.

<a id="requestlogger-write"></a>

#### `write`

```kotlin
@Throws(GooseException::class)
fun RequestLogger.write(requestId: ULong, record: String)
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="requestlogger-write-param-request-id"></a>`requestId` | `ULong` | — | — |
| <a id="requestlogger-write-param-record"></a>`record` | `String` | — | — |

Raises `GooseException`.

<a id="providermessage"></a>

## `ProviderMessage`

Kind: record.

A text message passed to a provider.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="providermessage-field-role"></a>`role` | `MessageRole` | — | — |
| <a id="providermessage-field-content"></a>`content` | `List<MessageContent>` | — | — |

<a id="messagerole"></a>

## `MessageRole`

Kind: enum.

<a id="messagerole-variant-user"></a>

### `USER`

<a id="messagerole-variant-assistant"></a>

### `ASSISTANT`

<a id="messagerole-variant-tool"></a>

### `TOOL`

<a id="messagecontent"></a>

## `MessageContent`

Kind: enum.

<a id="messagecontent-variant-text"></a>

### `Text`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-text-field-text"></a>`text` | `String` | — | — |

<a id="messagecontent-variant-image"></a>

### `Image`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-image-field-mime-type"></a>`mimeType` | `String` | — | — |
| <a id="messagecontent-variant-image-field-data"></a>`data` | `ByteArray` | — | — |

<a id="messagecontent-variant-document"></a>

### `Document`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-document-field-mime-type"></a>`mimeType` | `String` | — | — |
| <a id="messagecontent-variant-document-field-data"></a>`data` | `ByteArray` | — | — |
| <a id="messagecontent-variant-document-field-name"></a>`name` | `String?` | — | — |

<a id="messagecontent-variant-toolrequest"></a>

### `ToolRequest`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-toolrequest-field-id"></a>`id` | `String` | — | — |
| <a id="messagecontent-variant-toolrequest-field-name"></a>`name` | `String` | — | — |
| <a id="messagecontent-variant-toolrequest-field-arguments-json"></a>`argumentsJson` | `String` | — | — |
| <a id="messagecontent-variant-toolrequest-field-provider-metadata-json"></a>`providerMetadataJson` | `String?` | — | — |
| <a id="messagecontent-variant-toolrequest-field-tool-error-json"></a>`toolErrorJson` | `String?` | — | — |

<a id="messagecontent-variant-toolresult"></a>

### `ToolResult`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-toolresult-field-id"></a>`id` | `String` | — | — |
| <a id="messagecontent-variant-toolresult-field-success"></a>`success` | `Boolean` | — | — |
| <a id="messagecontent-variant-toolresult-field-content-json"></a>`contentJson` | `String` | — | — |

<a id="messagecontent-variant-thinking"></a>

### `Thinking`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-thinking-field-thinking"></a>`thinking` | `String` | — | — |
| <a id="messagecontent-variant-thinking-field-signature"></a>`signature` | `String` | — | — |

<a id="messagecontent-variant-redactedthinking"></a>

### `RedactedThinking`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-redactedthinking-field-data"></a>`data` | `String` | — | — |

<a id="providertool"></a>

## `ProviderTool`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="providertool-field-name"></a>`name` | `String` | — | — |
| <a id="providertool-field-description"></a>`description` | `String` | — | — |
| <a id="providertool-field-input-schema-json"></a>`inputSchemaJson` | `String` | — | — |
| <a id="providertool-field-annotations-json"></a>`annotationsJson` | `String?` | `null` | — |

<a id="providermodelconfig"></a>

## `ProviderModelConfig`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="providermodelconfig-field-model-name"></a>`modelName` | `String` | — | — |
| <a id="providermodelconfig-field-context-limit"></a>`contextLimit` | `Int?` | `null` | — |
| <a id="providermodelconfig-field-temperature"></a>`temperature` | `Float?` | `null` | — |
| <a id="providermodelconfig-field-max-tokens"></a>`maxTokens` | `Int?` | `null` | — |
| <a id="providermodelconfig-field-toolshim"></a>`toolshim` | `Boolean` | `false` | — |
| <a id="providermodelconfig-field-toolshim-model"></a>`toolshimModel` | `String?` | `null` | — |
| <a id="providermodelconfig-field-request-params-json"></a>`requestParamsJson` | `String?` | `null` | — |
| <a id="providermodelconfig-field-provider-params-json"></a>`providerParamsJson` | `String?` | `null` | — |
| <a id="providermodelconfig-field-reasoning"></a>`reasoning` | `Boolean?` | `null` | — |
| <a id="providermodelconfig-field-timeout-ms"></a>`timeoutMs` | `ULong?` | `null` | — |
| <a id="providermodelconfig-field-request-headers"></a>`requestHeaders` | `Map<String, String>?` | `null` | Per-request HTTP headers attached to the outgoing provider call. These override any static headers configured on the provider. |

<a id="providermodelinfo"></a>

## `ProviderModelInfo`

Kind: record.

A model advertised by the provider. Providers without model discovery
return an empty list rather than an error.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="providermodelinfo-field-name"></a>`name` | `String` | — | — |
| <a id="providermodelinfo-field-context-limit"></a>`contextLimit` | `ULong?` | — | — |
| <a id="providermodelinfo-field-supports-reasoning"></a>`supportsReasoning` | `Boolean` | — | — |

<a id="usage"></a>

## `Usage`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="usage-field-input-tokens"></a>`inputTokens` | `Int?` | — | — |
| <a id="usage-field-output-tokens"></a>`outputTokens` | `Int?` | — | — |
| <a id="usage-field-total-tokens"></a>`totalTokens` | `Int?` | — | — |
| <a id="usage-field-cache-read-input-tokens"></a>`cacheReadInputTokens` | `Int?` | — | — |
| <a id="usage-field-cache-creation-input-tokens"></a>`cacheCreationInputTokens` | `Int?` | — | — |
| <a id="usage-field-reasoning-tokens"></a>`reasoningTokens` | `Int?` | — | — |
| <a id="usage-field-model"></a>`model` | `String` | — | — |
| <a id="usage-field-request-id"></a>`requestId` | `String?` | — | The model vendor's own id for this call: Anthropic sends `request-id`, OpenAI `x-request-id`. |
| <a id="usage-field-provider-metadata-json"></a>`providerMetadataJson` | `String?` | — | — |
| <a id="usage-field-additional-data-json"></a>`additionalDataJson` | `String?` | — | Provider-specific response fields as a JSON object, present only when the provider reported fields with no canonical `Usage` equivalent. |

<a id="streamchunk"></a>

## `StreamChunk`

Kind: enum.

<a id="streamchunk-variant-textchunk"></a>

### `TextChunk`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="streamchunk-variant-textchunk-field-text"></a>`text` | `String` | — | — |

<a id="streamchunk-variant-toolchunk"></a>

### `ToolChunk`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="streamchunk-variant-toolchunk-field-id"></a>`id` | `String` | — | — |
| <a id="streamchunk-variant-toolchunk-field-name"></a>`name` | `String` | — | — |
| <a id="streamchunk-variant-toolchunk-field-arguments-json"></a>`argumentsJson` | `String` | — | — |
| <a id="streamchunk-variant-toolchunk-field-index"></a>`index` | `Int?` | — | — |
| <a id="streamchunk-variant-toolchunk-field-provider-metadata-json"></a>`providerMetadataJson` | `String?` | — | — |

<a id="streamchunk-variant-thinkingchunk"></a>

### `ThinkingChunk`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="streamchunk-variant-thinkingchunk-field-thinking"></a>`thinking` | `String` | — | — |
| <a id="streamchunk-variant-thinkingchunk-field-signature"></a>`signature` | `String` | — | — |

<a id="streamchunk-variant-redactedthinkingchunk"></a>

### `RedactedThinkingChunk`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="streamchunk-variant-redactedthinkingchunk-field-data"></a>`data` | `String` | — | — |

<a id="streamchunk-variant-endchunk"></a>

### `EndChunk`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="streamchunk-variant-endchunk-field-usage"></a>`usage` | `Usage?` | — | — |

<a id="streamchunk-variant-errorchunk"></a>

### `ErrorChunk`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="streamchunk-variant-errorchunk-field-error"></a>`error` | `GooseStreamError` | — | — |

<a id="goosestreamerror"></a>

## `GooseStreamError`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="goosestreamerror-field-kind"></a>`kind` | `GooseStreamErrorKind` | — | — |
| <a id="goosestreamerror-field-message"></a>`message` | `String` | — | — |
| <a id="goosestreamerror-field-retry-after-ms"></a>`retryAfterMs` | `ULong?` | — | — |
| <a id="goosestreamerror-field-request-id"></a>`requestId` | `String?` | — | Recovered from the message text, the only channel `ProviderError` has for it. |

<a id="goosestreamerrorkind"></a>

## `GooseStreamErrorKind`

Kind: enum.

<a id="goosestreamerrorkind-variant-ratelimited"></a>

### `RATE_LIMITED`

<a id="goosestreamerrorkind-variant-outputtokenlimitexceeded"></a>

### `OUTPUT_TOKEN_LIMIT_EXCEEDED`

<a id="goosestreamerrorkind-variant-contextlengthexceeded"></a>

### `CONTEXT_LENGTH_EXCEEDED`

<a id="goosestreamerrorkind-variant-authentication"></a>

### `AUTHENTICATION`

<a id="goosestreamerrorkind-variant-timeout"></a>

### `TIMEOUT`

<a id="goosestreamerrorkind-variant-providerunavailable"></a>

### `PROVIDER_UNAVAILABLE`

<a id="goosestreamerrorkind-variant-generic"></a>

### `GENERIC`

<a id="providercompletion"></a>

## `ProviderCompletion`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="providercompletion-field-message-json"></a>`messageJson` | `String` | — | — |
| <a id="providercompletion-field-content"></a>`content` | `List<MessageContent>` | — | The assistant turn as binding types, ready to append to history and replay on the next request without reparsing `message_json`. |
| <a id="providercompletion-field-usage"></a>`usage` | `Usage?` | — | — |

<a id="feature"></a>

## `Feature`

Kind: enum.

<a id="feature-variant-tools"></a>

### `TOOLS`

<a id="feature-variant-streaming"></a>

### `STREAMING`

<a id="feature-variant-images"></a>

### `IMAGES`

<a id="feature-variant-documents"></a>

### `DOCUMENTS`

<a id="feature-variant-jsonschema"></a>

### `JSON_SCHEMA`

<a id="feature-variant-reasoning"></a>

### `REASONING`

<a id="decisionquestion"></a>

## `DecisionQuestion`

Kind: enum.

<a id="decisionquestion-variant-noul"></a>

### `Noul`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionquestion-variant-noul-field-instructions"></a>`instructions` | `String` | — | — |
| <a id="decisionquestion-variant-noul-field-criteria"></a>`criteria` | `NoulCriteria?` | — | — |

<a id="decisionquestion-variant-choice"></a>

### `Choice`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionquestion-variant-choice-field-instructions"></a>`instructions` | `String` | — | — |
| <a id="decisionquestion-variant-choice-field-criteria"></a>`criteria` | `Map<String, String>` | — | — |

<a id="decisionquestion-variant-score"></a>

### `Score`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionquestion-variant-score-field-instructions"></a>`instructions` | `String` | — | — |
| <a id="decisionquestion-variant-score-field-criteria"></a>`criteria` | `List<String>` | — | — |

<a id="noulcriteria"></a>

## `NoulCriteria`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="noulcriteria-field-true-description"></a>`trueDescription` | `String` | — | — |
| <a id="noulcriteria-field-false-description"></a>`falseDescription` | `String` | — | — |

<a id="decisionrequest"></a>

## `DecisionRequest`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionrequest-field-model"></a>`model` | `String` | — | — |
| <a id="decisionrequest-field-state-json"></a>`stateJson` | `String` | — | — |
| <a id="decisionrequest-field-questions"></a>`questions` | `Map<String, DecisionQuestion>` | — | — |

<a id="decisionanswer"></a>

## `DecisionAnswer`

Kind: enum.

<a id="decisionanswer-variant-noul"></a>

### `Noul`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionanswer-variant-noul-field-noul"></a>`noul` | `Double` | — | — |

<a id="decisionanswer-variant-choice"></a>

### `Choice`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionanswer-variant-choice-field-choice"></a>`choice` | `String` | — | — |
| <a id="decisionanswer-variant-choice-field-confidence"></a>`confidence` | `Double` | — | — |
| <a id="decisionanswer-variant-choice-field-probabilities"></a>`probabilities` | `Map<String, Double>` | — | — |

<a id="decisionanswer-variant-score"></a>

### `Score`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionanswer-variant-score-field-score"></a>`score` | `Double` | — | — |
| <a id="decisionanswer-variant-score-field-confidence"></a>`confidence` | `Double` | — | — |
| <a id="decisionanswer-variant-score-field-legend-json"></a>`legendJson` | `Map<String, String>` | — | — |
| <a id="decisionanswer-variant-score-field-probabilities"></a>`probabilities` | `Map<String, Double>` | — | — |

<a id="decisionresponse"></a>

## `DecisionResponse`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionresponse-field-model"></a>`model` | `String` | — | — |
| <a id="decisionresponse-field-answers"></a>`answers` | `Map<String, DecisionAnswer>` | — | — |
| <a id="decisionresponse-field-input-tokens"></a>`inputTokens` | `ULong?` | — | — |
| <a id="decisionresponse-field-output-tokens"></a>`outputTokens` | `ULong?` | — | — |
| <a id="decisionresponse-field-cost"></a>`cost` | `Double?` | — | — |
| <a id="decisionresponse-field-id"></a>`id` | `String?` | — | — |
| <a id="decisionresponse-field-provider"></a>`provider` | `String?` | — | — |

<a id="decisionprovider"></a>

## `DecisionProvider`

Kind: object.

<a id="decisionprovider-create-decision"></a>

#### `createDecision`

```kotlin
@Throws(GooseException::class)
suspend fun DecisionProvider.createDecision(request: DecisionRequest): DecisionResponse
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionprovider-create-decision-param-request"></a>`request` | `DecisionRequest` | — | — |

Raises `GooseException`.

<a id="provider"></a>

## `Provider`

Kind: object.

<a id="provider-name"></a>

#### `name`

```kotlin
fun Provider.name(): String
```

<a id="provider-supported-features"></a>

#### `supportedFeatures`

```kotlin
fun Provider.supportedFeatures(): List<Feature>
```

<a id="provider-context-limit"></a>

#### `contextLimit`

```kotlin
@Throws(GooseException::class)
suspend fun Provider.contextLimit(model: ProviderModelConfig): ULong
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="provider-context-limit-param-model"></a>`model` | `ProviderModelConfig` | — | — |

Raises `GooseException`.

<a id="provider-list-models"></a>

#### `listModels`

```kotlin
@Throws(GooseException::class)
suspend fun Provider.listModels(): List<ProviderModelInfo>
```

Raises `GooseException`.

<a id="provider-stream"></a>

#### `stream`

```kotlin
@Throws(GooseException::class)
suspend fun Provider.stream(model: ProviderModelConfig, system: String, messages: List<ProviderMessage>, tools: List<ProviderTool>): ProviderStream
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="provider-stream-param-model"></a>`model` | `ProviderModelConfig` | — | — |
| <a id="provider-stream-param-system"></a>`system` | `String` | — | — |
| <a id="provider-stream-param-messages"></a>`messages` | `List<ProviderMessage>` | — | — |
| <a id="provider-stream-param-tools"></a>`tools` | `List<ProviderTool>` | — | — |

Raises `GooseException`.

<a id="provider-complete"></a>

#### `complete`

```kotlin
@Throws(GooseException::class)
suspend fun Provider.complete(model: ProviderModelConfig, system: String, messages: List<ProviderMessage>, tools: List<ProviderTool>): ProviderCompletion
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="provider-complete-param-model"></a>`model` | `ProviderModelConfig` | — | — |
| <a id="provider-complete-param-system"></a>`system` | `String` | — | — |
| <a id="provider-complete-param-messages"></a>`messages` | `List<ProviderMessage>` | — | — |
| <a id="provider-complete-param-tools"></a>`tools` | `List<ProviderTool>` | — | — |

Raises `GooseException`.

<a id="provider-compact"></a>

#### `compact`

Summarizes a conversation down to a single message so it can continue
past this model's context window.

```kotlin
@Throws(GooseException::class)
suspend fun Provider.compact(modelName: String, messages: List<CompactionMessage>, templates: CompactionTemplates?): CompactionSummary
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="provider-compact-param-model-name"></a>`modelName` | `String` | — | — |
| <a id="provider-compact-param-messages"></a>`messages` | `List<CompactionMessage>` | — | — |
| <a id="provider-compact-param-templates"></a>`templates` | `CompactionTemplates?` | — | — |

Raises `GooseException`.

<a id="compactionmessage"></a>

## `CompactionMessage`

Kind: record.

A text-only message. Compaction reads conversations as text, so this is the
whole input shape callers need across the language boundary.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="compactionmessage-field-role"></a>`role` | `MessageRole` | — | — |
| <a id="compactionmessage-field-text"></a>`text` | `String` | — | — |

<a id="compactiontemplates"></a>

## `CompactionTemplates`

Kind: record.

Overrides for the summarization and summary-rendering prompts.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="compactiontemplates-field-compaction"></a>`compaction` | `String` | — | — |
| <a id="compactiontemplates-field-summary"></a>`summary` | `String` | — | — |

<a id="compactionsummary"></a>

## `CompactionSummary`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="compactionsummary-field-text"></a>`text` | `String` | — | — |
| <a id="compactionsummary-field-input-tokens"></a>`inputTokens` | `Int?` | — | — |
| <a id="compactionsummary-field-output-tokens"></a>`outputTokens` | `Int?` | — | — |
| <a id="compactionsummary-field-total-tokens"></a>`totalTokens` | `Int?` | — | — |
| <a id="compactionsummary-field-cache-read-input-tokens"></a>`cacheReadInputTokens` | `Int?` | — | — |
| <a id="compactionsummary-field-cache-creation-input-tokens"></a>`cacheCreationInputTokens` | `Int?` | — | — |

<a id="providerstream"></a>

## `ProviderStream`

Kind: object.

<a id="providerstream-next-chunk"></a>

#### `nextChunk`

```kotlin
@Throws(GooseException::class)
suspend fun ProviderStream.nextChunk(): StreamChunk?
```

Raises `GooseException`.
