@singlestore/ai
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -0,3 +1,3 @@ | ||
import { ChatCompletionMessageParam } from 'openai/resources/chat/completions'; | ||
import z$1, { z } from 'zod'; | ||
import { ChatCompletionMessageParam } from 'openai/resources/chat/completions'; | ||
import { OpenAI } from 'openai'; | ||
@@ -74,2 +74,28 @@ import { ChatCompletionCreateParamsBase } from 'openai/resources/chat/completions.mjs'; | ||
declare function parseLengthErrorMessage(message: Error["message"]): [length: number | undefined, maxLength: number | undefined]; | ||
declare class MessageLengthExceededError extends Error { | ||
message: string; | ||
length?: number; | ||
maxLength?: number; | ||
cause?: unknown; | ||
constructor(message: string, options?: { | ||
length?: number; | ||
maxLength?: number; | ||
cause?: unknown; | ||
}); | ||
} | ||
declare class MessagesLengthExceededError extends Error { | ||
message: string; | ||
length?: number; | ||
maxLength?: number; | ||
cause?: unknown; | ||
constructor(message: string, options?: { | ||
length?: number; | ||
maxLength?: number; | ||
cause?: unknown; | ||
}); | ||
} | ||
type Embedding = number[]; | ||
@@ -110,2 +136,2 @@ | ||
export { AI, type AIConfig, type AnyAI }; | ||
export { AI, type AIConfig, type AnyAI, type AnyChatCompletionTool, type ChatCompletion, type ChatCompletionMessage, type ChatCompletionStream, ChatCompletionTool, type ChatCompletionToolCall, ChatCompletionsManager, type CreateChatCompletionParams, type CreateChatCompletionResult, type CreateEmbeddingsParams, type Embedding, EmbeddingsManager, type MergeChatCompletionTools, MessageLengthExceededError, MessagesLengthExceededError, type OnChatCompletionChunk, type OpenAIChatCompletionModel, OpenAIChatCompletions, type OpenAICreateChatCompletionParams, type OpenAICreateEmbeddingsParams, type OpenAIEmbeddingModel, OpenAIEmbeddingsManager, parseLengthErrorMessage }; |
@@ -33,9 +33,12 @@ "use strict"; | ||
__export(src_exports, { | ||
AI: () => AI | ||
AI: () => AI, | ||
ChatCompletionTool: () => ChatCompletionTool, | ||
ChatCompletionsManager: () => ChatCompletionsManager, | ||
EmbeddingsManager: () => EmbeddingsManager, | ||
MessageLengthExceededError: () => MessageLengthExceededError, | ||
MessagesLengthExceededError: () => MessagesLengthExceededError, | ||
parseLengthErrorMessage: () => parseLengthErrorMessage | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/ai.ts | ||
var import_openai2 = __toESM(require("openai")); | ||
// src/chat-completions/manager.ts | ||
@@ -262,2 +265,16 @@ var ChatCompletionsManager = class { | ||
// src/chat-completions/tool.ts | ||
var ChatCompletionTool = class { | ||
name; | ||
description; | ||
params; | ||
call; | ||
constructor(config) { | ||
this.name = config.name; | ||
this.description = config.description; | ||
this.params = config.params; | ||
this.call = config.call; | ||
} | ||
}; | ||
// src/embeddings/manager.ts | ||
@@ -284,2 +301,3 @@ var EmbeddingsManager = class { | ||
// src/ai.ts | ||
var import_openai2 = __toESM(require("openai")); | ||
var AI = class { | ||
@@ -299,4 +317,10 @@ embeddings; | ||
0 && (module.exports = { | ||
AI | ||
AI, | ||
ChatCompletionTool, | ||
ChatCompletionsManager, | ||
EmbeddingsManager, | ||
MessageLengthExceededError, | ||
MessagesLengthExceededError, | ||
parseLengthErrorMessage | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@singlestore/ai", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"license": "Apache-2.0", | ||
@@ -18,17 +18,2 @@ "sideEffects": false, | ||
"require": "./dist/index.js" | ||
}, | ||
"./embeddings": { | ||
"types": "./dist/embeddings/index.d.ts", | ||
"import": "./dist/embeddings/index.mjs", | ||
"require": "./dist/embeddings/index.js" | ||
}, | ||
"./chat-completions": { | ||
"types": "./dist/chat-completions/index.d.ts", | ||
"import": "./dist/chat-completions/index.mjs", | ||
"require": "./dist/chat-completions/index.js" | ||
}, | ||
"./chat-completions/errors": { | ||
"types": "./dist/chat-completions/errors/index.d.ts", | ||
"import": "./dist/chat-completions/errors/index.mjs", | ||
"require": "./dist/chat-completions/errors/index.js" | ||
} | ||
@@ -35,0 +20,0 @@ }, |
@@ -62,3 +62,3 @@ # SingleStore AI | ||
```ts | ||
import { type CreateEmbeddingsParams, type Embedding, EmbeddingsManager } from "@singlestore/ai/embeddings"; | ||
import { type CreateEmbeddingsParams, type Embedding, EmbeddingsManager } from "@singlestore/ai"; | ||
@@ -93,3 +93,3 @@ class CustomEmbeddingsManager extends EmbeddingsManager { | ||
type MergeChatCompletionTools, | ||
} from "@singlestore/ai/chat-completions"; | ||
} from "@singlestore/ai"; | ||
@@ -128,3 +128,3 @@ type ChatCompletionTools = undefined; // If an array of custom tools is created, use `typeof tools`. | ||
```ts | ||
import { ChatCompletionTool } from "@singlestore/ai/chat-completions"; | ||
import { ChatCompletionTool } from "@singlestore/ai"; | ||
import { z } from "zod"; | ||
@@ -131,0 +131,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
90600
8
705