openai-streams
Advanced tools
Comparing version 1.0.10 to 1.0.11
import type { CreateCompletionRequest, CreateEditRequest, CreateEmbeddingRequest, CreateFineTuneRequest, CreateImageRequest } from "openai"; | ||
export type StreamMode = "raw" | "tokens"; | ||
export type OpenAIAPIEndpoint = "completions" | "edits" | "embeddings" | "images" | "fine-tunes"; | ||
export type OpenAICreateArgs<T extends OpenAIAPIEndpoint> = T extends "completions" ? Exclude<CreateCompletionRequest, "stream"> : T extends "edits" ? CreateEditRequest : T extends "embeddings" ? CreateEmbeddingRequest : T extends "images" ? CreateImageRequest : T extends "fine-tunes" ? CreateFineTuneRequest : never; | ||
export type OpenAICreateArgs<T extends OpenAIAPIEndpoint> = T extends "completions" ? Omit<CreateCompletionRequest, "stream"> : T extends "edits" ? CreateEditRequest : T extends "embeddings" ? CreateEmbeddingRequest : T extends "images" ? CreateImageRequest : T extends "fine-tunes" ? CreateFineTuneRequest : never; | ||
export type OpenAIAPI = <T extends OpenAIAPIEndpoint>(endpoint: T, args: OpenAICreateArgs<T>, mode?: StreamMode) => Promise<ReadableStream<Uint8Array>>; | ||
export type { CreateCompletionRequest, CreateEditRequest, CreateEmbeddingRequest, CreateFineTuneRequest, CreateImageRequest, } from "openai"; |
{ | ||
"name": "openai-streams", | ||
"description": "Streams-first OpenAI API client, written in TypeScript.", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8650