Skip to main content

Function: createTauriFetch()

createTauriFetch(tauriFetch): {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: packages/core/src/utils/fetch-helpers.ts:399

Create a fetch function for Tauri apps

Helper that wraps Tauri's fetch with compatibility for Node.js-style fetch. Handles differences in how Tauri structures requests/responses.

Parameters

tauriFetch

any

Returns

(input, init?): Promise<Response>

MDN Reference

Parameters

input

RequestInfo | URL

init?

RequestInit

Returns

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

Parameters

input

string | Request | URL

init?

RequestInit

Returns

Promise<Response>

Deprecated

@tauri-apps/plugin-http (and @tauri-apps/api/http) already return a web-standard Response, so passing the Tauri http fetch directly into ProviderConfig.fetch / openai(..., { fetch: tauriFetch }) no longer needs this adapter. Prefer:

import { fetch as tauriFetch } from '@tauri-apps/plugin-http';
const bot = Baleybot.create({ ..., model: openai('gpt-5.6-luna', { fetch: tauriFetch }) });

This symbol remains exportable per the keep-list (codegen-exports.keep.json) as a deliberate, documented deprecation — it is not silently dropped. See the eng-ops keep-orphan review (fingerprint keep-orphan:createTauriFetch).

Example

import { fetch as tauriFetch } from '@tauri-apps/api/http';
import { createTauriFetch } from '@baleybots/core';

const bot = new Baleybot({
model: {
id: 'gpt-5.6-luna',
config: {
fetch: createTauriFetch(tauriFetch)
}
}
});