> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Aws

> JavaScript API reference for the aws llm plugin.

## AWSBedrockLLM

AWS Bedrock LLM provider (Converse API).

Streams text generation and function/tool calling from any Bedrock-hosted
model (Amazon Nova, Anthropic Claude, Meta Llama, Mistral, Google Gemma).

### Constructor

```typescript theme={null}
new AWSBedrockLLM(opts: AWSBedrockLLMOptions)
```

<ParamField path="model" type="string">
  Bedrock model id or inference profile ARN. Falls back to `BEDROCK_INFERENCE_PROFILE_ARN`. Default: `'amazon.nova-lite-v1:0'`.
</ParamField>

<ParamField path="region" type="string">
  AWS region for Bedrock Runtime. Falls back to `AWS_DEFAULT_REGION` / `AWS_REGION`, then `'us-east-1'`.
</ParamField>

<ParamField path="awsAccessKeyId" type="string">
  Falls back to the `AWS_ACCESS_KEY_ID` env var.
</ParamField>

<ParamField path="awsSecretAccessKey" type="string">
  Falls back to the `AWS_SECRET_ACCESS_KEY` env var.
</ParamField>

<ParamField path="awsSessionToken" type="string">
  Falls back to the `AWS_SESSION_TOKEN` env var.
</ParamField>

<ParamField path="temperature" type="number">
  Sampling temperature. Default: `0.7`.
</ParamField>

<ParamField path="maxOutputTokens" type="number">
  Max tokens generated per response. Default: `1024`. (Legacy `maxTokens`/`max_tokens` also accepted.)
</ParamField>

<ParamField path="topP" type="number | null">
  Nucleus sampling probability mass. Default: `null`.
</ParamField>

<ParamField path="topK" type="number | null">
  Top-K tokens considered (sent via additional request fields; model support varies). Default: `null`.
</ParamField>

<ParamField path="stopSequences" type="string[] | string | null">
  Sequences that stop generation; a string or list. Default: `null`.
</ParamField>

<ParamField path="toolChoice" type="string">
  `'auto'`, `'required'`, `'none'`, or a tool name. Default: `'auto'`.
</ParamField>

<ParamField path="cacheSystem" type="boolean | null">
  Add a prompt-cache checkpoint after the system prompt. Default: `null`.
</ParamField>

<ParamField path="cacheTools" type="boolean | null">
  Add a prompt-cache checkpoint after the tool definitions. Default: `null`.
</ParamField>

<ParamField path="stripThinking" type="boolean | null">
  Remove `<thinking>...</thinking>` spans from the streamed text. Default: `null` (provider default).
</ParamField>

<ParamField path="textToolCalls" type="boolean | null">
  Parse function calls a model prints as plain text instead of native Converse tool use. Default: `null` (auto).
</ParamField>

<ParamField path="additionalRequestFields" type="Record<string, any> | null">
  Extra `additionalModelRequestFields` merged into the Converse request. Default: `null`.
</ParamField>

### cancelCurrentGeneration

```typescript theme={null}
cancelCurrentGeneration(): Promise<void>
```

Cancel the in-flight generation for the current session, if any.

### chat

```typescript theme={null}
chat(_messages: any, _opts?: LLMChatOptions): AsyncIterator<LLMResponse>
```

Stream a completion for the given messages, yielding LLMResponse chunks.

<ResponseField name="returns" type="AsyncIterator<LLMResponse>" />

### close

```typescript theme={null}
close(): Promise<void>
```

Release any resources held by the provider.

### closeEmitter

```typescript theme={null}
closeEmitter(): Promise<void>
```

Close the emitter: drop all handlers and stop emitting. Waits up to 2 seconds
for in-flight async handlers to settle before returning.

### emit

```typescript theme={null}
emit(event: string, ...args: any[]): void
```

<ParamField path="event" type="string" required />

### getRuntimeConfig

```typescript theme={null}
getRuntimeConfig(): Record<string, any>
```

<ResponseField name="returns" type="Record<string, any>" />

### listenerCount

```typescript theme={null}
listenerCount(event: string): number
```

<ParamField path="event" type="string" required />

<ResponseField name="returns" type="number" />

### off

```typescript theme={null}
off(event: string, handler: EventHandler): void
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

### on

```typescript theme={null}
on(event: string, handler: EventHandler): EventHandler
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

<ResponseField name="returns" type="EventHandler" />

### once

```typescript theme={null}
once(event: string, handler: EventHandler): EventHandler
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

<ResponseField name="returns" type="EventHandler" />

### removeAllListeners

```typescript theme={null}
removeAllListeners(event?: string): void
```

<ParamField path="event" type="string" />
