Skip to content

Commit 28f2c48

Browse files
committed
📦 NEW: Pipe API key support in pipe.run()
1 parent 83d7ddd commit 28f2c48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/langbase/src/langbase/langbase.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ export type Role = 'user' | 'assistant' | 'system' | 'tool';
1212
export interface RunOptions extends RunOptionsT {
1313
name: string;
1414
messages: Message[];
15+
apiKey?: string;
1516
}
1617

1718
export interface RunOptionsStream extends RunOptionsStreamT {
1819
name: string;
1920
messages: Message[];
21+
apiKey?: string;
2022
}
2123

2224
export interface Function {
@@ -313,7 +315,7 @@ export class Langbase {
313315
options: RunOptions | RunOptionsStream,
314316
): Promise<RunResponse | RunResponseStream> {
315317
const pipe = new PipeBaseAI({
316-
apiKey: this.apiKey,
318+
apiKey: options.apiKey ?? this.apiKey,
317319
name: options.name?.trim() || '', // Pipe name
318320
prod: true,
319321
// default values

0 commit comments

Comments
 (0)