# Python 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-python.md). Match the API snapshot to your installed package before writing code.

## Contents

- [Functions](#functions)
- [GooseError](#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>

### `anthropic_default_model`

```python
def anthropic_default_model() -> str
```

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

### `anthropic_provider`

```python
def anthropic_provider(api_key: str, base_url: str | None, beta_headers: list[str]) -> Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-anthropic-provider-param-api-key"></a>`api_key` | `str` | — | — |
| <a id="fn-anthropic-provider-param-base-url"></a>`base_url` | `str \| None` | — | — |
| <a id="fn-anthropic-provider-param-beta-headers"></a>`beta_headers` | `list[str]` | — | — |

Raises `GooseError`.

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

### `databricks_default_model`

```python
def databricks_default_model() -> str
```

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

### `databricks_provider`

```python
def databricks_provider(host: str, token: str) -> Provider
```

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

Raises `GooseError`.

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

### `databricks_v2_default_model`

```python
def databricks_v2_default_model() -> str
```

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

### `databricks_v2_provider`

```python
def databricks_v2_provider(host: str, token: str, gateway_path: str | None = None) -> Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-databricks-v2-provider-param-host"></a>`host` | `str` | — | — |
| <a id="fn-databricks-v2-provider-param-token"></a>`token` | `str` | — | — |
| <a id="fn-databricks-v2-provider-param-gateway-path"></a>`gateway_path` | `str \| None` | `None` | — |

Raises `GooseError`.

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

### `declarative_provider_from_json`

```python
def declarative_provider_from_json(json: str) -> Provider
```

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

Raises `GooseError`.

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

### `default_compaction_templates`

```python
def default_compaction_templates() -> CompactionTemplates
```

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

### `groq_default_model`

```python
def groq_default_model() -> str
```

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

### `groq_provider`

```python
def groq_provider(api_key: str) -> Provider
```

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

Raises `GooseError`.

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

### `install_request_logger`

Installs the process-wide provider request logger.

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

```python
def install_request_logger(logger: RequestLogger)
```

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

Raises `GooseError`.

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

### `openai_default_model`

```python
def openai_default_model() -> str
```

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

### `openai_provider`

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.

```python
def openai_provider(api_key: str, base_url: str | None = None) -> Provider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-openai-provider-param-api-key"></a>`api_key` | `str` | — | — |
| <a id="fn-openai-provider-param-base-url"></a>`base_url` | `str \| None` | `None` | — |

Raises `GooseError`.

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

### `openai_provider_simple`

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.

```python
def openai_provider_simple(api_key: str) -> Provider
```

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

Raises `GooseError`.

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

### `openrouter_decision_default_model`

```python
def openrouter_decision_default_model() -> str
```

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

### `openrouter_decision_provider`

```python
def openrouter_decision_provider(api_key: str, base_url: str | None) -> DecisionProvider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-openrouter-decision-provider-param-api-key"></a>`api_key` | `str` | — | — |
| <a id="fn-openrouter-decision-provider-param-base-url"></a>`base_url` | `str \| None` | — | — |

Raises `GooseError`.

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

### `typesafe_decision_default_model`

```python
def typesafe_decision_default_model() -> str
```

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

### `typesafe_decision_provider`

```python
def typesafe_decision_provider(api_key: str, base_url: str | None) -> DecisionProvider
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="fn-typesafe-decision-provider-param-api-key"></a>`api_key` | `str` | — | — |
| <a id="fn-typesafe-decision-provider-param-base-url"></a>`base_url` | `str \| None` | — | — |

Raises `GooseError`.

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

## `GooseError`

Kind: error.

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

### `RateLimited`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="gooseerror-variant-ratelimited-field-retry-after-ms"></a>`retry_after_ms` | `int \| None` | — | — |
| <a id="gooseerror-variant-ratelimited-field-retry-after-suffix"></a>`retry_after_suffix` | `str` | — | — |

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

### `OutputTokenLimitExceeded`

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

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

### `ContextLengthExceeded`

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

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

### `Authentication`

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

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

### `Timeout`

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

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

### `ProviderUnavailable`

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

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

### `Generic`

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

<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`

```python
def RequestLogger.start() -> int
```

Raises `GooseError`.

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

#### `write`

```python
def RequestLogger.write(request_id: int, record: str)
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="requestlogger-write-param-request-id"></a>`request_id` | `int` | — | — |
| <a id="requestlogger-write-param-record"></a>`record` | `str` | — | — |

Raises `GooseError`.

<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` | `str` | — | — |

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

### `Image`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-image-field-mime-type"></a>`mime_type` | `str` | — | — |
| <a id="messagecontent-variant-image-field-data"></a>`data` | `bytes` | — | — |

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

### `Document`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-document-field-mime-type"></a>`mime_type` | `str` | — | — |
| <a id="messagecontent-variant-document-field-data"></a>`data` | `bytes` | — | — |
| <a id="messagecontent-variant-document-field-name"></a>`name` | `str \| None` | — | — |

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

### `ToolRequest`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-toolrequest-field-id"></a>`id` | `str` | — | — |
| <a id="messagecontent-variant-toolrequest-field-name"></a>`name` | `str` | — | — |
| <a id="messagecontent-variant-toolrequest-field-arguments-json"></a>`arguments_json` | `str` | — | — |
| <a id="messagecontent-variant-toolrequest-field-provider-metadata-json"></a>`provider_metadata_json` | `str \| None` | — | — |
| <a id="messagecontent-variant-toolrequest-field-tool-error-json"></a>`tool_error_json` | `str \| None` | — | — |

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

### `ToolResult`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="messagecontent-variant-toolresult-field-id"></a>`id` | `str` | — | — |
| <a id="messagecontent-variant-toolresult-field-success"></a>`success` | `bool` | — | — |
| <a id="messagecontent-variant-toolresult-field-content-json"></a>`content_json` | `str` | — | — |

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

### `Thinking`

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

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

### `RedactedThinking`

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

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

## `ProviderTool`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="providertool-field-name"></a>`name` | `str` | — | — |
| <a id="providertool-field-description"></a>`description` | `str` | — | — |
| <a id="providertool-field-input-schema-json"></a>`input_schema_json` | `str` | — | — |
| <a id="providertool-field-annotations-json"></a>`annotations_json` | `str \| None` | `None` | — |

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

## `ProviderModelConfig`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="providermodelconfig-field-model-name"></a>`model_name` | `str` | — | — |
| <a id="providermodelconfig-field-context-limit"></a>`context_limit` | `int \| None` | `None` | — |
| <a id="providermodelconfig-field-temperature"></a>`temperature` | `float \| None` | `None` | — |
| <a id="providermodelconfig-field-max-tokens"></a>`max_tokens` | `int \| None` | `None` | — |
| <a id="providermodelconfig-field-toolshim"></a>`toolshim` | `bool` | `False` | — |
| <a id="providermodelconfig-field-toolshim-model"></a>`toolshim_model` | `str \| None` | `None` | — |
| <a id="providermodelconfig-field-request-params-json"></a>`request_params_json` | `str \| None` | `None` | — |
| <a id="providermodelconfig-field-provider-params-json"></a>`provider_params_json` | `str \| None` | `None` | — |
| <a id="providermodelconfig-field-reasoning"></a>`reasoning` | `bool \| None` | `None` | — |
| <a id="providermodelconfig-field-timeout-ms"></a>`timeout_ms` | `int \| None` | `None` | — |
| <a id="providermodelconfig-field-request-headers"></a>`request_headers` | `dict[str, str] \| None` | `None` | 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` | `str` | — | — |
| <a id="providermodelinfo-field-context-limit"></a>`context_limit` | `int \| None` | — | — |
| <a id="providermodelinfo-field-supports-reasoning"></a>`supports_reasoning` | `bool` | — | — |

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

## `Usage`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="usage-field-input-tokens"></a>`input_tokens` | `int \| None` | — | — |
| <a id="usage-field-output-tokens"></a>`output_tokens` | `int \| None` | — | — |
| <a id="usage-field-total-tokens"></a>`total_tokens` | `int \| None` | — | — |
| <a id="usage-field-cache-read-input-tokens"></a>`cache_read_input_tokens` | `int \| None` | — | — |
| <a id="usage-field-cache-creation-input-tokens"></a>`cache_creation_input_tokens` | `int \| None` | — | — |
| <a id="usage-field-reasoning-tokens"></a>`reasoning_tokens` | `int \| None` | — | — |
| <a id="usage-field-model"></a>`model` | `str` | — | — |
| <a id="usage-field-request-id"></a>`request_id` | `str \| None` | — | 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>`provider_metadata_json` | `str \| None` | — | — |
| <a id="usage-field-additional-data-json"></a>`additional_data_json` | `str \| None` | — | 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` | `str` | — | — |

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

### `ToolChunk`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="streamchunk-variant-toolchunk-field-id"></a>`id` | `str` | — | — |
| <a id="streamchunk-variant-toolchunk-field-name"></a>`name` | `str` | — | — |
| <a id="streamchunk-variant-toolchunk-field-arguments-json"></a>`arguments_json` | `str` | — | — |
| <a id="streamchunk-variant-toolchunk-field-index"></a>`index` | `int \| None` | — | — |
| <a id="streamchunk-variant-toolchunk-field-provider-metadata-json"></a>`provider_metadata_json` | `str \| None` | — | — |

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

### `ThinkingChunk`

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

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

### `RedactedThinkingChunk`

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

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

### `EndChunk`

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

<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` | `str` | — | — |
| <a id="goosestreamerror-field-retry-after-ms"></a>`retry_after_ms` | `int \| None` | — | — |
| <a id="goosestreamerror-field-request-id"></a>`request_id` | `str \| None` | — | 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>`message_json` | `str` | — | — |
| <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 \| None` | — | — |

<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` | `str` | — | — |
| <a id="decisionquestion-variant-noul-field-criteria"></a>`criteria` | `NoulCriteria \| None` | — | — |

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

### `Choice`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionquestion-variant-choice-field-instructions"></a>`instructions` | `str` | — | — |
| <a id="decisionquestion-variant-choice-field-criteria"></a>`criteria` | `dict[str, str]` | — | — |

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

### `Score`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionquestion-variant-score-field-instructions"></a>`instructions` | `str` | — | — |
| <a id="decisionquestion-variant-score-field-criteria"></a>`criteria` | `list[str]` | — | — |

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

## `NoulCriteria`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="noulcriteria-field-true-description"></a>`true_description` | `str` | — | — |
| <a id="noulcriteria-field-false-description"></a>`false_description` | `str` | — | — |

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

## `DecisionRequest`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionrequest-field-model"></a>`model` | `str` | — | — |
| <a id="decisionrequest-field-state-json"></a>`state_json` | `str` | — | — |
| <a id="decisionrequest-field-questions"></a>`questions` | `dict[str, 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` | `float` | — | — |

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

### `Choice`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionanswer-variant-choice-field-choice"></a>`choice` | `str` | — | — |
| <a id="decisionanswer-variant-choice-field-confidence"></a>`confidence` | `float` | — | — |
| <a id="decisionanswer-variant-choice-field-probabilities"></a>`probabilities` | `dict[str, float]` | — | — |

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

### `Score`

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionanswer-variant-score-field-score"></a>`score` | `float` | — | — |
| <a id="decisionanswer-variant-score-field-confidence"></a>`confidence` | `float` | — | — |
| <a id="decisionanswer-variant-score-field-legend-json"></a>`legend_json` | `dict[str, str]` | — | — |
| <a id="decisionanswer-variant-score-field-probabilities"></a>`probabilities` | `dict[str, float]` | — | — |

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

## `DecisionResponse`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="decisionresponse-field-model"></a>`model` | `str` | — | — |
| <a id="decisionresponse-field-answers"></a>`answers` | `dict[str, DecisionAnswer]` | — | — |
| <a id="decisionresponse-field-input-tokens"></a>`input_tokens` | `int \| None` | — | — |
| <a id="decisionresponse-field-output-tokens"></a>`output_tokens` | `int \| None` | — | — |
| <a id="decisionresponse-field-cost"></a>`cost` | `float \| None` | — | — |
| <a id="decisionresponse-field-id"></a>`id` | `str \| None` | — | — |
| <a id="decisionresponse-field-provider"></a>`provider` | `str \| None` | — | — |

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

## `DecisionProvider`

Kind: object.

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

#### `create_decision`

```python
async def DecisionProvider.create_decision(request: DecisionRequest) -> DecisionResponse
```

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

Raises `GooseError`.

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

## `Provider`

Kind: object.

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

#### `name`

```python
def Provider.name() -> str
```

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

#### `supported_features`

```python
def Provider.supported_features() -> list[Feature]
```

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

#### `context_limit`

```python
async def Provider.context_limit(model: ProviderModelConfig) -> int
```

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

Raises `GooseError`.

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

#### `list_models`

```python
async def Provider.list_models() -> list[ProviderModelInfo]
```

Raises `GooseError`.

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

#### `stream`

```python
async def Provider.stream(model: ProviderModelConfig, system: str, 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` | `str` | — | — |
| <a id="provider-stream-param-messages"></a>`messages` | `list[ProviderMessage]` | — | — |
| <a id="provider-stream-param-tools"></a>`tools` | `list[ProviderTool]` | — | — |

Raises `GooseError`.

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

#### `complete`

```python
async def Provider.complete(model: ProviderModelConfig, system: str, 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` | `str` | — | — |
| <a id="provider-complete-param-messages"></a>`messages` | `list[ProviderMessage]` | — | — |
| <a id="provider-complete-param-tools"></a>`tools` | `list[ProviderTool]` | — | — |

Raises `GooseError`.

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

#### `compact`

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

```python
async def Provider.compact(model_name: str, messages: list[CompactionMessage], templates: CompactionTemplates | None) -> CompactionSummary
```

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="provider-compact-param-model-name"></a>`model_name` | `str` | — | — |
| <a id="provider-compact-param-messages"></a>`messages` | `list[CompactionMessage]` | — | — |
| <a id="provider-compact-param-templates"></a>`templates` | `CompactionTemplates \| None` | — | — |

Raises `GooseError`.

<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` | `str` | — | — |

<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` | `str` | — | — |
| <a id="compactiontemplates-field-summary"></a>`summary` | `str` | — | — |

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

## `CompactionSummary`

Kind: record.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| <a id="compactionsummary-field-text"></a>`text` | `str` | — | — |
| <a id="compactionsummary-field-input-tokens"></a>`input_tokens` | `int \| None` | — | — |
| <a id="compactionsummary-field-output-tokens"></a>`output_tokens` | `int \| None` | — | — |
| <a id="compactionsummary-field-total-tokens"></a>`total_tokens` | `int \| None` | — | — |
| <a id="compactionsummary-field-cache-read-input-tokens"></a>`cache_read_input_tokens` | `int \| None` | — | — |
| <a id="compactionsummary-field-cache-creation-input-tokens"></a>`cache_creation_input_tokens` | `int \| None` | — | — |

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

## `ProviderStream`

Kind: object.

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

#### `next_chunk`

```python
async def ProviderStream.next_chunk() -> StreamChunk | None
```

Raises `GooseError`.
