Skip to Content
Anuma SDKExpoInternalInterfacesUseChatStorageOptions

UseChatStorageOptions

Defined in: src/expo/useChatStorage.ts:199 

Options for useChatStorage hook (Expo version)

Uses the base options without React-specific features (no local chat, no tools).

Extends

  • BaseUseChatStorageOptions

Properties

apiType?

optional apiType: ApiType

Defined in: src/expo/useChatStorage.ts:205 

Which API endpoint to use. Default: “responses”

  • “responses”: OpenAI Responses API (supports thinking, reasoning, conversations)
  • “completions”: OpenAI Chat Completions API (wider model compatibility)

autoCreateConversation?

optional autoCreateConversation: boolean

Defined in: src/lib/db/chat/types.ts:303 

Automatically create a new conversation if none is set (default: true)

Inherited from

BaseUseChatStorageOptions.autoCreateConversation


autoEmbedMessages?

optional autoEmbedMessages: boolean

Defined in: src/lib/db/chat/types.ts:361 

Automatically generate embeddings for messages after saving. Enables semantic search over past conversations via searchMessages().

Default

true

Inherited from

BaseUseChatStorageOptions.autoEmbedMessages


autoFlushOnKeyAvailable?

optional autoFlushOnKeyAvailable: boolean

Defined in: src/expo/useChatStorage.ts:236 

Auto-flush queued operations when key becomes available.

Default

true

baseUrl?

optional baseUrl: string

Defined in: src/lib/db/chat/types.ts:309 

Base URL for the chat API endpoint

Inherited from

BaseUseChatStorageOptions.baseUrl


conversationId?

optional conversationId: string

Defined in: src/lib/db/chat/types.ts:301 

ID of an existing conversation to load and continue

Inherited from

BaseUseChatStorageOptions.conversationId


database

database: Database

Defined in: src/lib/db/chat/types.ts:299 

WatermelonDB database instance for storing conversations and messages

Inherited from

BaseUseChatStorageOptions.database


defaultConversationTitle?

optional defaultConversationTitle: string

Defined in: src/lib/db/chat/types.ts:305 

Title for auto-created conversations (default: “New conversation”)

Inherited from

BaseUseChatStorageOptions.defaultConversationTitle


embeddedWalletSigner?

optional embeddedWalletSigner: EmbeddedWalletSignerFn

Defined in: src/expo/useChatStorage.ts:221 

Function for silent signing with Privy embedded wallets.


embeddingModel?

optional embeddingModel: string

Defined in: src/lib/db/chat/types.ts:366 

Embedding model to use when autoEmbedMessages is enabled.

Default

DEFAULT_API_EMBEDDING_MODEL

Inherited from

BaseUseChatStorageOptions.embeddingModel


enableQueue?

optional enableQueue: boolean

Defined in: src/expo/useChatStorage.ts:231 

Enable the in-memory write queue.

Default

true

fileProcessingOptions?

optional fileProcessingOptions: object

Defined in: src/lib/db/chat/types.ts:338 

Options for file preprocessing behavior

keepOriginalFiles?

optional keepOriginalFiles: boolean

Whether to keep original file attachments (default: true)

maxFileSizeBytes?

optional maxFileSizeBytes: number

Max file size to process in bytes (default: 10MB)

onError()?

optional onError: (fileName: string, error: Error) => void

Callback for errors (non-fatal)

Parameters

ParameterType

fileName

string

error

Error

Returns

void

onProgress()?

optional onProgress: (current: number, total: number, fileName: string) => void

Callback for progress updates

Parameters

ParameterType

current

number

total

number

fileName

string

Returns

void

Inherited from

BaseUseChatStorageOptions.fileProcessingOptions


fileProcessors?

optional fileProcessors: FileProcessor[] | null

Defined in: src/lib/db/chat/types.ts:334 

File preprocessors to use for automatic text extraction.

  • undefined (default): Use all built-in processors (PDF, Excel, Word)
  • null or []: Disable preprocessing
  • FileProcessor[]: Use specific processors

Inherited from

BaseUseChatStorageOptions.fileProcessors


getToken()?

optional getToken: () => Promise<string | null>

Defined in: src/lib/db/chat/types.ts:307 

Function to retrieve the auth token for API requests

Returns

Promise<string | null>

Inherited from

BaseUseChatStorageOptions.getToken


getWalletAddress()?

optional getWalletAddress: () => Promise<string | null>

Defined in: src/expo/useChatStorage.ts:226 

Async function to poll for wallet address during Privy initialization.

Returns

Promise<string | null>


mcpR2Domain?

optional mcpR2Domain: string

Defined in: src/lib/db/chat/types.ts:378 

R2 domain for identifying MCP-generated image URLs. When set, enables OPFS caching of generated images. Defaults to the hardcoded MCP_R2_DOMAIN from clientConfig.

Inherited from

BaseUseChatStorageOptions.mcpR2Domain


minContentLength?

optional minContentLength: number

Defined in: src/lib/db/chat/types.ts:372 

Minimum content length required to generate embeddings. Messages shorter than this are skipped as they provide limited semantic value.

Default

10

Inherited from

BaseUseChatStorageOptions.minContentLength


onData()?

optional onData: (chunk: string) => void

Defined in: src/lib/db/chat/types.ts:311 

Callback invoked with each streamed response chunk

Parameters

ParameterType

chunk

string

Returns

void

Inherited from

BaseUseChatStorageOptions.onData


onError()?

optional onError: (error: Error) => void

Defined in: src/lib/db/chat/types.ts:317 

Callback invoked when an error occurs during the request

Parameters

ParameterType

error

Error

Returns

void

Inherited from

BaseUseChatStorageOptions.onError


onFinish()?

optional onFinish: (response: LlmapiResponseResponse) => void

Defined in: src/lib/db/chat/types.ts:315 

Callback invoked when the response completes successfully

Parameters

ParameterType

response

LlmapiResponseResponse

Returns

void

Inherited from

BaseUseChatStorageOptions.onFinish


onServerToolCall()?

optional onServerToolCall: (toolCall: ServerToolCallEvent) => void

Defined in: src/lib/db/chat/types.ts:322 

Callback invoked when a server-side tool (MCP) is called during streaming. Use this to show activity indicators like “Searching…” in the UI.

Parameters

ParameterType

toolCall

ServerToolCallEvent

Returns

void

Inherited from

BaseUseChatStorageOptions.onServerToolCall


onThinking()?

optional onThinking: (chunk: string) => void

Defined in: src/lib/db/chat/types.ts:313 

Callback invoked when thinking/reasoning content is received (from <think> tags or API reasoning)

Parameters

ParameterType

chunk

string

Returns

void

Inherited from

BaseUseChatStorageOptions.onThinking


onToolCallArgumentsDelta()?

optional onToolCallArgumentsDelta: (event: ToolCallArgumentsDeltaEvent) => void

Defined in: src/lib/db/chat/types.ts:327 

Called with partial tool call arguments as they stream in. Use for live preview of artifacts (HTML, slides) being generated.

Parameters

ParameterType

event

ToolCallArgumentsDeltaEvent

Returns

void

Inherited from

BaseUseChatStorageOptions.onToolCallArgumentsDelta


serverTools?

optional serverTools: object

Defined in: src/lib/db/chat/types.ts:352 

Configuration for server-side tools fetching and caching. Server tools are fetched from /api/v1/tools and cached in localStorage.

cacheExpirationMs?

optional cacheExpirationMs: number

Cache expiration time in milliseconds (default: 86400000 = 1 day)

Inherited from

BaseUseChatStorageOptions.serverTools


signMessage?

optional signMessage: SignMessageFn

Defined in: src/expo/useChatStorage.ts:216 

Function to sign a message for encryption key derivation.


walletAddress?

optional walletAddress: string

Defined in: src/expo/useChatStorage.ts:211 

Wallet address for field-level encryption. When provided with signMessage, all sensitive content is encrypted at rest.

Last updated on