File tree Expand file tree Collapse file tree 5 files changed +27
-11
lines changed
Expand file tree Collapse file tree 5 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 1- import { Workflow } from 'langbase' ;
1+ import { Langbase , Workflow } from 'langbase' ;
22
33async function main ( ) {
4- const workflow = new Workflow ( { debug : true } ) ;
4+ const langbase = new Langbase ( {
5+ apiKey : 'YOUR_API_KEY' , // Replace with actual API key or env var
6+ } ) ;
7+ const workflow = new Workflow ( { debug : true , langbase} ) ;
58 const result = await workflow . step ( {
69 id : 'hello' ,
710 run : async ( ) => 'world' ,
Original file line number Diff line number Diff line change 1- import { Workflow } from 'langbase' ;
1+ import { Langbase , Workflow } from 'langbase' ;
22
33export default {
44 async fetch ( request : Request ) {
5- // Simple workflow step
6- const workflow = new Workflow ( { debug : true } ) ;
5+ // Instantiate Langbase
6+ const langbase = new Langbase ( {
7+ apiKey : 'YOUR_API_KEY' , // Replace with actual API key or env var
8+ } ) ;
9+ // Create workflow with langbase instance
10+ const workflow = new Workflow ( { debug : true , langbase} ) ;
711 const result = await workflow . step ( {
812 id : 'hello' ,
913 run : async ( ) => 'world' ,
Original file line number Diff line number Diff line change 11// @deno -types="npm:[email protected] " 2- import { Workflow } from 'npm:[email protected] ' ; 2+ import { Langbase , Workflow } from 'npm:[email protected] ' ; 33
44async function main ( ) {
5- const workflow = new Workflow ( { debug : true } ) ;
5+ const langbase = new Langbase ( {
6+ apiKey : Deno . env . get ( 'LANGBASE_API_KEY' ) ?? 'YOUR_API_KEY' ,
7+ } ) ;
8+ const workflow = new Workflow ( { debug : true , langbase} ) ;
69 const result = await workflow . step ( {
710 id : 'hello' ,
811 run : async ( ) => 'world' ,
Original file line number Diff line number Diff line change 1- const { Workflow} = require ( 'langbase' ) ;
1+ const { Langbase , Workflow} = require ( 'langbase' ) ;
22
33async function main ( ) {
4- const workflow = new Workflow ( { debug : true } ) ;
4+ const langbase = new Langbase ( {
5+ apiKey : 'YOUR_API_KEY' , // Replace with actual API key or env var
6+ } ) ;
7+ const workflow = new Workflow ( { debug : true , langbase} ) ;
58 const result = await workflow . step ( {
69 id : 'hello' ,
710 run : async ( ) => 'world' ,
Original file line number Diff line number Diff line change 1- import { Workflow } from 'langbase' ;
1+ import { Langbase , Workflow } from 'langbase' ;
22
33async function main ( ) {
4- const workflow = new Workflow ( { debug : true } ) ;
4+ const langbase = new Langbase ( {
5+ apiKey : 'YOUR_API_KEY' , // Replace with actual API key or env var
6+ } ) ;
7+ const workflow = new Workflow ( { debug : true , langbase} ) ;
58 const result = await workflow . step ( {
69 id : 'hello' ,
710 run : async ( ) => 'world' ,
You can’t perform that action at this time.
0 commit comments