Skip to content

Commit

Permalink
fix(stream-object): fix interface name
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Jan 9, 2025
1 parent 831e080 commit c9914c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/stream-object/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { clean } from '@xsai/shared'
import { streamText, type StreamTextOptions, type StreamTextResult } from '@xsai/stream-text'
import { parse } from 'best-effort-json-parser'

export interface GenerateObjectOptions<T extends Schema> extends StreamTextOptions {
export interface StreamObjectOptions<T extends Schema> extends StreamTextOptions {
schema: T
schemaDescription?: string
schemaName?: string
}

export interface GenerateObjectResult<T extends Schema> extends StreamTextResult {
export interface StreamObjectResult<T extends Schema> extends StreamTextResult {
partialObjectStream: ReadableStream<PartialDeep<Infer<T>>>
}

/** @experimental WIP */
export const streamObject = async <T extends Schema>(options: GenerateObjectOptions<T>): Promise<GenerateObjectResult<T>> =>
export const streamObject = async <T extends Schema>(options: StreamObjectOptions<T>): Promise<StreamObjectResult<T>> =>
await streamText({
...options,
response_format: {
Expand Down

0 comments on commit c9914c7

Please sign in to comment.