Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@singlestore/ai

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@singlestore/ai - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

8

dist/index.d.ts
import { OpenAI } from 'openai';
import { EmbeddingCreateParams } from 'openai/resources/embeddings';
import { ChatCompletionMessageParam, ChatCompletionCreateParams } from 'openai/resources/chat/completions';
import { ChatModel } from 'openai/resources/index.mjs';

@@ -16,3 +17,4 @@ type Embedder<T = any> = (input: string | string[], options?: T) => Promise<number[][]>;

type ChatCompletionMessage = ChatCompletionMessageParam;
type ChatCompletionOptions = {
type ChatCompletionOptions<T = any> = {
model: T;
systemRole: string;

@@ -23,2 +25,3 @@ stream: boolean;

interface LLM {
getModels(): Promise<string[]>;
createChatCompletion<T extends Partial<ChatCompletionOptions> & {

@@ -32,6 +35,7 @@ [K: string]: any;

type CreateChatCompletionOptions = Partial<ChatCompletionOptions> & Partial<Omit<ChatCompletionCreateParams, "input" | keyof ChatCompletionOptions>>;
type CreateChatCompletionOptions = Partial<ChatCompletionOptions<ChatModel> & Omit<ChatCompletionCreateParams, keyof ChatCompletionOptions>>;
declare class OpenAILLM implements LLM {
private _openai;
constructor(_openai: OpenAI);
getModels(): Promise<ChatModel[]>;
createChatCompletion<T extends CreateChatCompletionOptions, _ReturnType = T extends {

@@ -38,0 +42,0 @@ stream: true;

@@ -113,2 +113,3 @@ "use strict";

// src/llm/openai.ts
var import_models = require("openai/resources/models.mjs");
var OpenAILLM = class {

@@ -118,2 +119,9 @@ constructor(_openai) {

}
getModels() {
return __async(this, null, function* () {
const models = new import_models.Models(this._openai);
const list = yield models.list();
return list.data.map((model) => model.id);
});
}
createChatCompletion(prompt, options) {

@@ -120,0 +128,0 @@ return __async(this, null, function* () {

{
"name": "@singlestore/ai",
"version": "0.0.4",
"version": "0.0.5",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "sideEffects": false,

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc