Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
node-version: '24'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -37,7 +37,7 @@ jobs:
build:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
node-version: '24'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down Expand Up @@ -77,15 +77,15 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
node-version: '24'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
with:
node-version: '20'
node-version: '24'

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.77.0"
".": "0.78.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 57
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread/mixedbread-54cb35d8551deb6317f8e788553104526265594097327545848d84f859e56f10.yml
openapi_spec_hash: 4e3d33f113c440a1578dd5001064b9bd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread/mixedbread-4561de49f80321b17fcf79c523820e306222ccf794acff026207ceb8668bfdb2.yml
openapi_spec_hash: 4aaddd4e89992b1241a8550a57ca1934
config_hash: e6d8bd7d4c4a20c75bbfbdb7fc688122
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.78.0 (2026-07-23)

Full Changelog: [v0.77.0...v0.78.0](https://github.com/mixedbread-ai/mixedbread-ts/compare/v0.77.0...v0.78.0)

### Features

* **api:** api update ([986a245](https://github.com/mixedbread-ai/mixedbread-ts/commit/986a245e18691f683e1ada03c1f555b6eda9a153))
* **api:** api update ([fb3bd31](https://github.com/mixedbread-ai/mixedbread-ts/commit/fb3bd314c4f2ba740d9588fddb39cc27f59e1fed))
* **api:** api update ([516c6df](https://github.com/mixedbread-ai/mixedbread-ts/commit/516c6df444df91f4a68fa49cadabbb07770b7b75))
* **api:** api update ([7b94dfb](https://github.com/mixedbread-ai/mixedbread-ts/commit/7b94dfb46fdeb344768b6f7b5a27b1f466917d2d))
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([d51614b](https://github.com/mixedbread-ai/mixedbread-ts/commit/d51614b1ff14c384ada30d50aa2fb8ad9c870472))


### Bug Fixes

* **ci:** bump @arethetypeswrong/cli to ^0.18.0 and run CI workflows on Node 24 ([d16c556](https://github.com/mixedbread-ai/mixedbread-ts/commit/d16c5563f59d913295b6aa9bb377dd9edb845c1f))

## 0.77.0 (2026-06-30)

Full Changelog: [v0.76.0...v0.77.0](https://github.com/mixedbread-ai/mixedbread-ts/compare/v0.76.0...v0.77.0)
Expand Down
29 changes: 0 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,6 @@ const store: Mixedbread.Store = await client.stores.create();

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.

## File uploads

Request parameters that correspond to file uploads can be passed in many different forms:

- `File` (or an object with the same structure)
- a `fetch` `Response` (or an object with the same structure)
- an `fs.ReadStream`
- the return value of our `toFile` helper

```ts
import fs from 'fs';
import Mixedbread, { toFile } from '@mixedbread/sdk';

const client = new Mixedbread();

// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
await client.files.create({ file: fs.createReadStream('/path/to/file') });

// Or if you have the web `File` API you can pass a `File` instance:
await client.files.create({ file: new File(['my bytes'], 'file') });

// You can also pass a `fetch` `Response`:
await client.files.create({ file: await fetch('https://somesite/file') });

// Finally, if none of the above are convenient, you can use our `toFile` helper:
await client.files.create({ file: await toFile(Buffer.from('my bytes'), 'file') });
await client.files.create({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });
```

## Handling errors

When the library is unable to connect to the API,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mixedbread/sdk",
"version": "0.77.0",
"version": "0.78.0",
"description": "The official TypeScript library for the Mixedbread API",
"author": "Mixedbread <support@mixedbread.com>",
"types": "dist/index.d.ts",
Expand All @@ -27,7 +27,7 @@
},
"dependencies": {},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.0",
"@arethetypeswrong/cli": "^0.18.0",
"@swc/core": "^1.3.102",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.4.0",
Expand Down
12 changes: 7 additions & 5 deletions src/resources/files/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from './uploads';
import { APIPromise } from '../../core/api-promise';
import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
import { type Uploadable } from '../../core/uploads';
import { buildHeaders } from '../../internal/headers';
import { RequestOptions } from '../../internal/request-options';
import { multipartFormRequestOptions } from '../../internal/uploads';
Expand All @@ -35,7 +34,7 @@ export class Files extends APIResource {
* @example
* ```ts
* const fileObject = await client.files.create({
* file: fs.createReadStream('path/to/file'),
* file: 'file',
* });
* ```
*/
Expand Down Expand Up @@ -72,7 +71,7 @@ export class Files extends APIResource {
* ```ts
* const fileObject = await client.files.update(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { file: fs.createReadStream('path/to/file') },
* { file: 'file' },
* );
* ```
*/
Expand Down Expand Up @@ -108,6 +107,9 @@ export class Files extends APIResource {
/**
* Delete a specific file by its ID.
*
* Removes the file from every store that references it (cleaning up chunks and
* store stats) before deleting the file object itself.
*
* Args: file_id: The ID of the file to delete.
*
* Returns: FileDeleted: The response containing the details of the deleted file.
Expand Down Expand Up @@ -235,7 +237,7 @@ export interface FileCreateParams {
/**
* The file to upload
*/
file: Uploadable;
file: string;

/**
* Optional configuration for automatic multipart uploads.
Expand All @@ -249,7 +251,7 @@ export interface FileUpdateParams {
/**
* The file to update
*/
file: Uploadable;
file: string;
}

export interface FileListParams extends CursorParams {
Expand Down
15 changes: 15 additions & 0 deletions src/resources/stores/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ export interface AudioURLInputChunk {
*/
transcription?: string | null;

/**
* LLM-generated context that situates this audio chunk within its source file
*/
context?: string | null;

/**
* summary of the audio
*/
Expand Down Expand Up @@ -501,6 +506,11 @@ export interface ImageURLInputChunk {
*/
ocr_text?: string | null;

/**
* LLM-generated context that situates this image within its source document
*/
context?: string | null;

/**
* summary of the image
*/
Expand Down Expand Up @@ -698,6 +708,11 @@ export interface VideoURLInputChunk {
*/
transcription?: string | null;

/**
* LLM-generated context that situates this video chunk within its source file
*/
context?: string | null;

/**
* summary of the video
*/
Expand Down
24 changes: 20 additions & 4 deletions src/resources/stores/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,10 @@ export interface ContextualizationConfig {
with_metadata?: boolean | Array<string>;

/**
* Use an LLM to generate a short context for each text chunk that situates it
* within the full document, improving retrieval accuracy. Only applies to text
* content during non-sliced ingestion.
* Use an LLM to generate a short context for each chunk with parsed text, OCR,
* transcription, or a summary that situates it within the document, improving
* retrieval accuracy. During sliced ingestion, chunks are situated within their
* current slice.
*/
with_file_context?: boolean;
}
Expand Down Expand Up @@ -680,6 +681,11 @@ export interface ScoredAudioURLInputChunk {
*/
transcription?: string | null;

/**
* LLM-generated context that situates this audio chunk within its source file
*/
context?: string | null;

/**
* summary of the audio
*/
Expand Down Expand Up @@ -765,6 +771,11 @@ export interface ScoredImageURLInputChunk {
*/
ocr_text?: string | null;

/**
* LLM-generated context that situates this image within its source document
*/
context?: string | null;

/**
* summary of the image
*/
Expand Down Expand Up @@ -930,6 +941,11 @@ export interface ScoredVideoURLInputChunk {
*/
transcription?: string | null;

/**
* LLM-generated context that situates this video chunk within its source file
*/
context?: string | null;

/**
* summary of the video
*/
Expand Down Expand Up @@ -1094,7 +1110,7 @@ export interface StoreConfig {
export interface TextChunkGeneratedMetadata {
type?: 'text';

file_type?: 'text/plain';
file_type?: 'text/plain' | 'message/rfc822';

language?: string | null;

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.77.0'; // x-release-please-version
export const VERSION = '0.78.0'; // x-release-please-version
18 changes: 5 additions & 13 deletions tests/api-resources/files/files.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import Mixedbread, { toFile } from '@mixedbread/sdk';
import Mixedbread from '@mixedbread/sdk';

const client = new Mixedbread({
apiKey: 'My API Key',
Expand All @@ -9,9 +9,7 @@ const client = new Mixedbread({

describe('resource files', () => {
test('create: only required params', async () => {
const responsePromise = client.files.create({
file: await toFile(Buffer.from('Example data'), 'README.md'),
});
const responsePromise = client.files.create({ file: 'file' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -22,9 +20,7 @@ describe('resource files', () => {
});

test('create: required and optional params', async () => {
const response = await client.files.create({
file: await toFile(Buffer.from('Example data'), 'README.md'),
});
const response = await client.files.create({ file: 'file' });
});

test('retrieve', async () => {
Expand All @@ -39,9 +35,7 @@ describe('resource files', () => {
});

test('update: only required params', async () => {
const responsePromise = client.files.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
file: await toFile(Buffer.from('Example data'), 'README.md'),
});
const responsePromise = client.files.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { file: 'file' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -52,9 +46,7 @@ describe('resource files', () => {
});

test('update: required and optional params', async () => {
const response = await client.files.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
file: await toFile(Buffer.from('Example data'), 'README.md'),
});
const response = await client.files.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { file: 'file' });
});

test('list', async () => {
Expand Down
Loading
Loading