Comparing version 1.1.0 to 1.1.1-snapshot.0
import { ChatCompletionStream } from 'openai/lib/ChatCompletionStream'; | ||
import { RunOptionsStream, RunResponseStream, RunOptions, RunResponse } from '@baseai/core'; | ||
export { RunOptions, RunOptionsStream, RunResponse, RunResponseStream } from '@baseai/core'; | ||
export * from '@baseai/core/helpers'; | ||
@@ -123,6 +126,11 @@ declare const fromReadableStream: (readableStream: ReadableStream) => ChatCompletionStream; | ||
baseUrl?: string; | ||
name?: string; | ||
} | ||
declare class Pipe { | ||
private request; | ||
private pipe; | ||
private pipeOptions; | ||
constructor(options: PipeOptions); | ||
run(options: RunOptionsStream): Promise<RunResponseStream>; | ||
run(options: RunOptions): Promise<RunResponse>; | ||
generateText(options: GenerateOptions): Promise<GenerateResponse>; | ||
@@ -129,0 +137,0 @@ streamText(options: StreamOptions): Promise<StreamResponse>; |
@@ -18,2 +18,3 @@ "use strict"; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -673,7 +674,25 @@ | ||
// src/pipes/pipes.ts | ||
var import_core = require("@baseai/core"); | ||
var Pipe = class { | ||
constructor(options) { | ||
var _a; | ||
const baseUrl = "https://api.langbase.com"; | ||
this.request = new Request({ apiKey: options.apiKey, baseUrl }); | ||
this.pipeOptions = options; | ||
this.pipe = new import_core.Pipe({ | ||
apiKey: options.apiKey, | ||
// Langbase API key | ||
name: ((_a = options.name) == null ? void 0 : _a.trim()) || "", | ||
// Pipe name | ||
prod: true | ||
}); | ||
} | ||
async run(options) { | ||
if (!this.pipeOptions.name) { | ||
throw new Error( | ||
"Pipe name is required with run. Please provide pipe name when creating Pipe instance." | ||
); | ||
} | ||
return await this.pipe.run({ ...options, runTools: false }); | ||
} | ||
async generateText(options) { | ||
@@ -699,2 +718,5 @@ return this.request.post({ | ||
}; | ||
// src/index.ts | ||
__reExport(src_exports, require("@baseai/core/helpers"), module.exports); | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -704,4 +726,5 @@ 0 && (module.exports = { | ||
fromReadableStream, | ||
printStreamToStdout | ||
printStreamToStdout, | ||
...require("@baseai/core/helpers") | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "langbase", | ||
"version": "1.1.0", | ||
"version": "1.1.1-snapshot.0", | ||
"license": "Apache-2.0", | ||
@@ -13,2 +13,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@baseai/core": "0.9.30", | ||
"dotenv": "^16.4.5", | ||
@@ -15,0 +16,0 @@ "openai": "^4.53.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
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
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
137816
1549
5
1
1
3
+ Added@baseai/core@0.9.30
+ Added@baseai/core@0.9.30(transitive)
+ Added@types/node@18.19.67(transitive)
- Removed@types/node@18.19.66(transitive)